topojson

An extension of GeoJSON that encodes topology! ?

  • 所有者: topojson/topojson
  • 平台:
  • 许可证: Other
  • 分类:
  • 主题:
  • 喜欢:
    0
      比较:

Github星跟踪图

TopoJSON

TopoJSON is an extension of GeoJSON that encodes topology. Rather than representing geometries discretely, geometries in TopoJSON files are stitched together from shared line segments called arcs. This technique is similar to Matt Bloch’s MapShaper and the Arc/Info Export format, .e00.

TopoJSON eliminates redundancy, allowing related geometries to be stored efficiently in the same file. For example, the shared boundary between California and Nevada is represented only once, rather than being duplicated for both states. A single TopoJSON file can contain multiple feature collections without duplication, such as states and counties. Or, a TopoJSON file can efficiently represent both polygons (for fill) and boundaries (for stroke) as two feature collections that share the same arc mesh. See How To Infer Topology for a visual explanation of how TopoJSON works. See Command-Line Cartography for an introduction to TopoJSON and related tools. See TopoJSON Format Specification for the format specification.

To further reduce file size, TopoJSON can use quantized delta-encoding for integer coordinates. This is similar to rounding coordinate values (e.g., LilJSON), but with greater efficiency and control over loss of information. And like GeoJSON, TopoJSON files are easily modified in a text editor and amenable to gzip compression.

As a result, TopoJSON is substantially more compact than GeoJSON, frequently offering a reduction of 80% or more even without simplification. Yet encoding topology also has numerous useful applications for maps and visualization above! It allows topology-preserving shape simplification, which ensures that adjacent features remain connected after simplification; this applies even across feature collections, such as simultaneous consistent simplification of state and county boundaries. Topology can also be used for Dorling or hexagonal cartograms, as well as other techniques that need shared boundary information such as automatic map coloring.

Installing

If you use NPM, npm install topojson. Otherwise, download the latest release. You can also load directly from d3js.org as a standalone library. AMD, CommonJS, and vanilla environments are supported. In vanilla, a topojson global is exported:

<script src="https://unpkg.com/topojson@3"></script>
<script>

var topology = topojson.topology({foo: geojson});

</script>

Try topojson in your browser.

API Reference

Generation (topojson-server)

Simplification (topojson-simplify)

Manipulation (topojson-client)

主要指标

概览
名称与所有者topojson/topojson
主编程语言JavaScript
编程语言JavaScript (语言数: 1)
平台
许可证Other
所有者活动
创建于2012-11-16 01:23:44
推送于2024-09-20 23:03:27
最后一次提交2024-09-20 15:50:11
发布数92
最新版本名称v3.0.2 (发布于 2017-09-02 15:22:41)
第一版名称v0.0.5 (发布于 2012-12-28 16:43:00)
用户参与
星数4.8k
关注者数193
派生数679
提交数633
已启用问题?
问题数221
打开的问题数11
拉请求数60
打开的拉请求数5
关闭的拉请求数43
项目设置
已启用Wiki?
已存档?
是复刻?
已锁定?
是镜像?
是私有?