Adding external properties to TopoJSON file of counties

大兔子大兔子 提交于 2019-12-04 08:49:51

Very nice question, I spent an hour on this problem spinning my wheels. It turns out the External Properties section provides a simple example which uses the reference id FIPS as the id.

You should be able to use your csv with one simple modification. Rename id_county to FIPS. Next specify your external resource with the -e flag.

-p name=COUNTY,name=STATE,area=+SQUARE_MIL,population=+percent_population  -e data.csv
bjoseph

This answer worked for me: How to add properties to topojson file?

In your case the call would look like:

topojson -o us-counties-with-population.json -e data.csv --id-property=id_county,id -p properties population=+percent_population -- us-counties.json

Note: I'm assuming the id-property of your topojson file is id.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!