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
6
votes
1 answer

How to control the order of the layers on a map in d3js

I have a simple question about making maps with d3js. I want to make a map with two layers. One layer is the contour of the map (geoJson) and the other layer contains the streets (topoJson). My problem is that streets layer always is loaded in front…
Pablo
  • 211
  • 5
  • 11
6
votes
1 answer

Where can I get the .geojson file for India and not separate files for each state/territory or any other distinction?

Does India have a .geoJSON file? I want to make data visualization using d3.js for the states, cities and hence need the GEOJSON File representing India. Where should I start from or what should be my approach? Also Mike's Tutorial doesn't help…
godimedia
  • 987
  • 2
  • 12
  • 28
6
votes
2 answers

Trouble installing topojson on ubuntu

I've been trying to install topojson by following Mike Bostock's Let's Make a Map tutorial http://bost.ocks.org/mike/map/ and I believe I have managed to get the most recent version of Node.js and npm. $which ogr2ogr works as well. I'm quite new to…
natecraft1
  • 2,737
  • 9
  • 36
  • 56
6
votes
2 answers

Map with d3.js and TopoJSON, Albers Siberia projection

I'm trying to make a Choropleth with d3.js but I got stucked just at the beginning. I found a Shapefile and generated GeoJSON and TopoJson files from it just like here. The map uses Albers-Siberia projection. What I found about this…
KoGor
  • 237
  • 5
  • 12
5
votes
1 answer

Putting coordinate value on topojson US map

I am using react-d3-map-bubble library to plot US map. react lib- https://github.com/react-d3/react-d3-map-bubble US map json file used - https://d3js.org/us-10m.v1.json My target is to plot points on that map. In current js file, counties object…
Siddharth
  • 213
  • 5
  • 14
5
votes
1 answer

Pre-projected geometry v getting the browser to do it (aka efficiency v flexibility)

To improve the performance of my online maps, especially on smartphones, I'm following Mike Bostock's advice to prepare the geodata as much as possible before uploading it to the server (as per his command-line cartography). For example, I'm…
Markus
  • 479
  • 4
  • 17
5
votes
1 answer

How to divide a map into zipcodes using d3, javascript, and a json file?

I'm trying to create a nyc map with zipcode areas I can color in based on census data (like color an area red if majority white or blue if majority nonwhite). I am simply using one of the shape files I found online from here (…
pr338
  • 8,730
  • 19
  • 52
  • 71
5
votes
2 answers

Find centroid of topoJSON path and use it to position a circle in D3

In my data I have values associated with countries. I have created scaled circles for each country and would now like to position them at the centre of each country using cx and cy. I have generated a map using topoJSON that has country-code 'ids'…
user3821345
  • 648
  • 1
  • 11
  • 33
5
votes
1 answer

How to remove a leaflet label when a topojson layer containing it is removed

I am trying to create an interactive map that visualizes certain data. I used leaflet map and a topojson layer on it. Next, I tried to add static labels on each of the topojson polygons using leaflet label plugin i.e. the labels should always be…
jimmypage
  • 656
  • 5
  • 17
5
votes
1 answer

Retrieving removed TOPOJSON polygon on clicking a new one

I am trying to create an interactive map using leaflet and topojson layer. I want to do the following: 1- When one clicks a certain topojson polygon, it should remove. 2- When one clicks the other polygon, it should remove and the previously clicked…
jimmypage
  • 656
  • 5
  • 17
5
votes
0 answers

How to convert from D3 svg to topojson/geojson?

D3 allows to convert geojson/topojson arrays of points' coordinates [ [x,y],[x,y],[x,y],...] // aka, a geojson arc. And, via a projection, into svg paths // aka, an svg-xml path Note: the values actually…
Hugolpz
  • 17,296
  • 26
  • 100
  • 187
5
votes
1 answer

D3.js - how to add zoom button with the default wheelmouse zoom behavior

So I got a worldmap with mouse zoom using the default d3.behavior.zoom() and limits to prevent the map from being dragged completely out of the page. This was a pain to get working, but it now work. My problem now is that this project also require…
jfmmm
  • 381
  • 1
  • 3
  • 15
5
votes
1 answer

Maximum Data File Size for D3.js

What is the limiting factor with data file size for D3js? Is it just how long it takes for the file to load from the server to the client? I'm trying to create a road map of Chicago, where you can hover over the road to get it's name and highlight…
Jared
  • 3,651
  • 11
  • 39
  • 64
5
votes
1 answer

D3 - How to get correct scale and translate origin after manual zoom and pan to country path

I've got a topology map with pan and zoom functionality. Clicking on the country, I'm zoom/panning into the country, using this: if (this.active === d) return var g = this.vis.select('g') g.selectAll(".active").classed("active", false) …
bcm
  • 5,470
  • 10
  • 59
  • 92
5
votes
1 answer

Adding tooltip in d3.js map

I'm trying to add a tooltip showing the name of districts when you hover over it in the map in d3.js. The input is a topojson file and I've been able to successfully generate the map with district boundaries and highlight the currently selected…
sfactor
  • 12,592
  • 32
  • 102
  • 152
1 2
3
40 41