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
4
votes
2 answers

US Zipcode TOPOJson for D3

I am creating US map using D3 , i have to implemented three level zooming , from nation map to state , from state to county and from county to zip boundaries. I am already done with first two level , I used AngularJS directives. GIST URL : D3 two…
Senthil
  • 946
  • 1
  • 14
  • 34
4
votes
1 answer

Find topojson feature by latitude longitude

The demo I'm working on is based on World tour, which uses canvas instead of SVG, so I cannot attach mouse event to country path to find what country was clicked. Is there any way to find which feature contains lat/long I get from mouse…
Nikolay
  • 309
  • 2
  • 8
4
votes
0 answers

Rotating Globe Choropleth in D3

I'm trying to make a chorolpleth with a rotating globe in d3. I can get the globe to render out fine but I can't get the countries to fill with the proper color scale. Longer explanation. I basically started with Mike Bostock's code for the…
noLongerRandom
  • 521
  • 1
  • 5
  • 17
4
votes
1 answer

Topojson-svg topojson to svg output is upside-down

Topojson-svg trial: I gave it a shoot... curl -o uk.topo.json 'http://bost.ocks.org/mike/map/uk.json' #get an online topoJSON file topojson-svg -o output.svg uk.topo.json #works ! But the uk.json => output.svg result is a #000000FF version of…
Hugolpz
  • 17,296
  • 26
  • 100
  • 187
4
votes
2 answers

Leaflet: Error in geoJson overlay at Russia Finland border

I'm using the 1:50m Cultural Vectors shape file from naturalearthdata.com. I use ogr2ogr to create a geoJson file with the following command: ogr2ogr -f GeoJSON geo_world_50m.json ne_50m_admin_0_countries.shp I then create a topoJson file with this…
GrantE
  • 159
  • 1
  • 7
4
votes
2 answers

Geojson to Topojson in node.js

I have a shape file in my postGIS database.I have retrieved that into geojson in node.js by using the following code. var moisql = 'SELECT *, (ST_AsGeoJSON(geom)) from xxx;' Works fine..But my requirement is i have to convert this geojson file…
Subburaj
  • 5,114
  • 10
  • 44
  • 87
4
votes
1 answer

Bathymetric maps with PostGIS and D3

I'm working on an application where I want to present bathymetric visualizations of different bodies of water on top of a slippy map. In essence these are geographically contained topographic visualisations based on interpolated DEM data. The result…
averas
  • 545
  • 1
  • 6
  • 15
4
votes
1 answer

D3.js Flood Map Killer

Here is an example of a Flood Map using D3.js and topojson. http://bl.ocks.org/cappelaere/6472064 https://gist.github.com/cappelaere/6472064 It is really taxing D3. Simplification of the topojson at load time does seem to hang Firefox. We really…
Pat Cappelaere
  • 391
  • 1
  • 2
  • 11
4
votes
0 answers

Can't run topojson after installation

I'm working through Mike Bostock's mapping tutorial. I've followed the instructions, installing v0.10.5 of node and using the npm to install topojson. If I run 'whereis topojson ' it displays 'topojson: /usr/bin/topojson /usr/bin/X11/topojson '.…
user1440303
  • 103
  • 6
3
votes
1 answer

How to center and scale using geoPath

I'm filtering out a subset of US counties with D3 and topojson. I can successfully filter out the counties and draw them to an SVG element, but how do I change the map bounds to fit the new selected counties? It's rendering the map as if the bounds…
Andrew
  • 12,172
  • 16
  • 46
  • 61
3
votes
1 answer

Merging topojson using topomerge messes up winding order

I'm trying to create a custom world map where countries are merged into regions instead of having individual countries. Unfortunately for some reason something seems to get messed up with the winding order along the process. As base data I'm using…
Flavio
  • 1,507
  • 5
  • 17
  • 30
3
votes
1 answer

d3.js v5 : Unable to get data points to show on map of US

I can successfully get a map of the US to render however, my data points do not. (I understand that d3.js made some significant changes with v5 so please note that similar questions previously asked do not apply) $(document).ready(function ()…
3
votes
1 answer

Is there a way to change the projection in a topojson file?

I am trying to create a topojson file projected using geoAlbersUsa, originating from the US Census's ZCTA (Zip Codes, essentially) shapefile. I was able to successfully get through the examples in the excellent…
CindyHoskey
  • 67
  • 1
  • 3
3
votes
1 answer

d3js v5 + Topojson v3 Optimization about joining csv & json

In order to make maps, I need to import some values from csv to json directly in the code. For loading json and csv files, I use an asynchronous operation with Promise object and I use two loops and a common key to add new properties on json…
Bellice
  • 322
  • 1
  • 14
3
votes
1 answer

ReactJs and D3.js : Uncaught (in promise) SyntaxError: Unexpected token < in JSON at position 0 at responseJson

In my App.js, import React, { Component } from 'react'; import * as d3 from "d3"; import * as d3queue from 'd3-queue'; import * as topojson from 'topojson'; var usState = require("./us-states.json"); var usCounty =…
Atul kumar singh
  • 454
  • 10
  • 24