This is a little bash script that I used to convert country, state, and city data from NaturalEarth to topojson for use in a D3.js project. File structure will be COUNTRYID1/states.topo.json
, COUNTRYID1/STATEID1_cities.topo.json
, COUNTRYID1/STATEID2_cities.topo.json
.
Be sure to check out the annotated source if you're curious about how it works.
Feel free to use, change, and share as you see fit!