Q. 重要參考資料

https://medium.com/@mbostock/command-line-cartography-part-1-897aa8f8ca2c

https://medium.com/@mbostock/command-line-cartography-part-2-c3a82c5c0f3

https://medium.com/@mbostock/command-line-cartography-part-3-1158e4c55a1e

https://medium.com/@mbostock/command-line-cartography-part-4-82d0d26df0cf

Q. Where to get shapefile

Q. shapefile to GeoJSON

Using shapefile - a parser has a command-line interface, shp2json, for this purpose.

npm install -g shapefile

How to use

shp2json COUNTY_MOI_1060525.shp --encoding big5 -o tw_county_2.json

Note that this also reads COUNTY_MOI_1060525.dbf, a dBASE file, defining feature properties on the resulting GeoJSON

Q. GeoJSON to TopoJSON

Install the TopoJSON CLI:

npm install -g topojson

Use geo2topo to convert to TopoJSON

geo2topo tw_county_2.json -o twCounty-topo.json

Simplify TopoJSON to reduce map file size

toposimplify twCounty-topo.json -s 0.00000001 -o twCounty-simple-topo.json

results matching ""

    No results matching ""