topojson

WebJar for topojson

License

License

BSD 3-Clause
Categories

Categories

JSON Data
GroupId

GroupId

org.webjars.bower
ArtifactId

ArtifactId

topojson
Last Version

Last Version

2.2.0
Release Date

Release Date

Type

Type

jar
Description

Description

topojson
WebJar for topojson
Project URL

Project URL

http://webjars.org
Source Code Management

Source Code Management

https://github.com/mbostock-bower/topojson-bower

Download topojson

How to add to project

<!-- https://jarcasting.com/artifacts/org.webjars.bower/topojson/ -->
<dependency>
    <groupId>org.webjars.bower</groupId>
    <artifactId>topojson</artifactId>
    <version>2.2.0</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.bower/topojson/
implementation 'org.webjars.bower:topojson:2.2.0'
// https://jarcasting.com/artifacts/org.webjars.bower/topojson/
implementation ("org.webjars.bower:topojson:2.2.0")
'org.webjars.bower:topojson:jar:2.2.0'
<dependency org="org.webjars.bower" name="topojson" rev="2.2.0">
  <artifact name="topojson" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.bower', module='topojson', version='2.2.0')
)
libraryDependencies += "org.webjars.bower" % "topojson" % "2.2.0"
[org.webjars.bower/topojson "2.2.0"]

Dependencies

There are no dependencies for this project. It is a standalone project that does not depend on any other jars.

Project Modules

There are no modules declared in this project.

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.

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)

org.webjars.bower
Bower needs generated files in git. Bower gets generated files in git.

Versions

Version
2.2.0
1.6.26
1.6.19
1.4.9