如何将多个topojson文件合并到单个topojson文件中

din*_*esh 6 topojson

我有美国州topojson和加拿大州topojson我想将它们合并为单个文件.有人可以告诉我如何将两个文件合并到单个topojson文件中.我正在创建地图时使用墨卡托投影

Nob*_*obu 5

我遇到了类似的问题,最终将topojson文件转换为geojson,并将其与geojson-merge合并,最后转换为topojson。

由于加拿大和美国(arcs在topojson中)共享某些边界,因此应减小文件的总大小。

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
Run Code Online (Sandbox Code Playgroud)