I have US state topojson and Canada state topojson I want to merge them into single file. Can some one tell me how to merge two files into single topojson file. I'm using mercator projection while creating map
A TopoJSON file format is a geoJSON format extension that encodes geospatial topology. TopoJSON files contain both attribute data and geospatial data (arcs).
I was facing a similar issue, and ended up converting topojson files to geojson, merging them with geojson-merge, finally converting to topojson.
As Canada and the US share some boundaries (arcs
in topojson), it should reduce the total file size.
for item in "us" "ca"
do
topo2geo tracts=$item-geo.json < $item-topo.json
done
geojson-merge *-geo.json > combined-geo.json
geo2topo tracts=combined-geo.json > combined-topo.json
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With