Questions tagged [topojson]

TopoJSON is an extension of GeoJSON that encodes topology. TopoJSON eliminates redundancy, offering much more compact representations of geometry than with GeoJSON; typical TopoJSON files are 80% smaller than their GeoJSON equivalents. In addition, TopoJSON facilitates applications that use topology, such as topology-preserving shape simplification, automatic map coloring, and cartograms.

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. TopoJSON eliminates redundancy, offering much more compact representations of geometry than with GeoJSON; typical TopoJSON files are 80% smaller than their GeoJSON equivalents. In addition, TopoJSON facilitates applications that use topology, such as topology-preserving shape simplification, automatic map coloring, and cartograms.

Topojson toolkits has seen major changes at v.2, as of April 2017 :

  • Topojson Specification
  • Topojson v1 - CLI
  • Topojson v2,v3 -- An extension of GeoJSON that encodes topology! Calls :
    • topojson-client (3.0.0) : Manipulate TopoJSON, such as to merge shapes, and convert it back to GeoJSON
    • topojson-server (3.0.0) : Convert GeoJSON to TopoJSON.
    • topojson-simplify (3.0.0) : Filter and simplify geometries while preserving topology for smaller files and faster rendering!
611 questions
3
votes
1 answer

D3js not projecting longitude/latitude points properly onto topojson map

I'm using topojson to draw a world map with D3js. I believe this is working fine. However, when I try and project latitude/longitude points onto the map, the projection function is returning "NaN" for points with negative values, and the projection…
3
votes
1 answer

My topojson won't display when adapting a canonical example

I'm starting to study D3 in order to create a choropleth/heatmap with filter by year. Problem: I would like to display this topojson file. I've tried to adapt Mike Bostock's topojson example here. However, when I adapt the example for my topojson…
abaporu
  • 320
  • 2
  • 12
3
votes
0 answers

Merge/join geometries with TopoJSON Client

Is it possible, using TopoJSON Client to merge/join geometries. So, for example, this: {"type":"Topology","objects":{"areas":{"type":"GeometryCollection","geometries":[{"type":"MultiPolygon","properties":{"common":"S B","class":"range…
dbj44
  • 1,919
  • 2
  • 24
  • 45
3
votes
0 answers

D3 - How to zoom a map on click of marker?

I'm using d3 to create a map and following is my requirement : 1. Plot markers on map 2. On click of marker, zoom into the map and update the map with new markers. 3. On click of the new markers show a tooltip. Till now, I've managed to do the steps…
shwetap
  • 621
  • 1
  • 6
  • 14
3
votes
0 answers

Isolate Country/Region from TopoJSON

I am using the natural earth 10m files to reduce, simplify, and quantize them into TopoJSON. However, for my use case, I'm attempting to store the data on the server and request a country or region I am currently interested in to display with d3.…
3
votes
1 answer

d3.js extract coordinates of SVG path elements

After spending quite some time on this problem without any success, I decided to post my (first!) question here. For a project I used topojson to plot part of a map. In my SVG I have some groups containing some points (which I placed using the…
J. Offenberg
  • 487
  • 7
  • 14
3
votes
1 answer

Setting projection of d3.geoPath() not working as documented

I've made a lot of maps in D3 and never had this problem, where the output is so small you can't see it. I've included a small geojson file, which is easily viewable using various other tools (e.g. here). It appears that the projection is not being…
Al R.
  • 2,430
  • 4
  • 28
  • 40
3
votes
1 answer

shp2json produces GeoJSON with bounding and coordinates not in (-180,180) range

I am doing @mbostock's tutorial on Command Line Cartography 1. Here is what I've done: 1) Download the zip file wget https://www.arb.ca.gov/ei/gislib/gislib.htm/ca_air_basins.zip (from California Air Resources Board site) 2) Manually unzip by…
mlimb
  • 2,083
  • 2
  • 14
  • 9
3
votes
2 answers

Render geoJSON with d3

I have a geoJSON file I'm trying to render using d3 but am having difficulty targeting the correct features for projection. Currently I've been working quite a bit with the us.json file found in many of the d3 examples but the map I'm currently…
MatOwen11
  • 71
  • 1
  • 10
3
votes
1 answer

Geojson map not showing up

I'm struggling with creating a map. I am simply using one of the new york times geojsons ("census_tracts_2010.geojson") from here ( https://github.com/dwillis/nyc-maps ). I'd appreciate it if someone could look at my code below, and let me know why…
pr338
  • 8,730
  • 19
  • 52
  • 71
3
votes
1 answer

Using ONS maps with D3

I'm sorry this is probably a very basic issue, but I just can't seem to figure it out. I wanted to map some data using D3.js and the map shape I wanted to use is provided by the UK's Office for National Statistics. I managed to get their geojson…
djwhiting
  • 33
  • 3
3
votes
1 answer

How to get projected path definition strings (not SVG elements) from a GeoJSON dataset with D3?

There are plenty of examples of drawing SVG paths from D3 geo data using D3's path projection tools. For example, here's one I wrote earlier (D3 v3) and here's a recent example using D3 v4. They all look something like this: svg.append("path") …
user56reinstatemonica8
  • 32,576
  • 21
  • 101
  • 125
3
votes
1 answer

topojson / D3 / Map with longitude + latitude

Im using the follwing UK Geo JSON to render a UK SVG Map http://martinjc.github.io/UK-GeoJSON/json/eng/topo_eer.json On this map i want to be able to take longitude + latitude points and plot onto the map. I am adding a GeometryCollection place to…
Peter I
  • 843
  • 1
  • 9
  • 31
3
votes
0 answers

TopoJson Install Error?

I am trying to install topojson with node.js and I am getting a frustrating error. I reinstalled the latest version of node.js (4.4.5) and running the standard install method. It seems like everything installs correctly. Then I try to do something…
3
votes
1 answer

How to bind data to the corresponding D3.js map elements?

My introductory question is: What is the best way to bind data to a D3.js map? I came up with three possibilities: 1. Apply a class based on the data, then apply style to the class. .attr("class", function(d) { return quantize(rateById.get(d.id));…
cplindem
  • 73
  • 5