World roads (topojson mesh + simplify)
✓ Published0🌍 Public
PPhilippe Rivière
Last edited May 15, 2017
Created on May 15, 2017
This example visualizes global road networks rendered as a fine white mesh over a satellite-projected world map. Using TopoJSON data derived from Natural Earth and processed with `toposimplify` and `topomerge`, the roads are drawn as SVG paths with `d3.geoPath`. The map rotates continuously via `d3.interval`, updating the projection and re-rendering paths. Landmasses use a dark fill, while the sphere and graticule provide geographic context.
AI-generated descriptionWe use topojson tools to get the roads data file as small as possible.
Data from Natural Earth.
Makefile (thank you @mbostock!)
ne_10m_roads.json:
wget https://github.com/visionscarto/some-geo-data/blob/master/ne_10m_roads.json
roads_4-simplified.json:
ndjson-cat ne_10m_roads.json | ndjson-split 'd.features' | ndjson-filter 'd.properties.scalerank <= 4' | ndjson-reduce 'delete d.properties,p.features.push(d), p' '{type: "FeatureCollection", features: []}' | geo2topo roads=- > roads_4.json
toposimplify --spherical-quantile 0.05 roads_4.json | topomerge --mesh roads=roads --filter 'true' | topoquantize 2e4 > roads_4-simplified.json
mit Licensed