November 2017
Beginner to intermediate
298 pages
6h 47m
English
The final tip involves merging multiple shapefiles into a single TopoJSON file. This is extremely useful if you need separate geographic information but want to fetch it in a single Fetch request. To append additional files, you simply add them on to the command.
Consider the following commands:
First, create a new GeoJSON from the region shapefile:
shp2json ESP_adm1.shp --out ESP_adm1.json
Then concatenate them together:
geo2topo ESP_adm1.json ESP_adm0.json > spain-regions.json
It will take each GeoJSON file, convert them to TopoJSON, and produce the following object structure, where the data for ESP_adm0 is the data for the country, and ESP_adm1 is the data for the regions:
There is also the opportunity to rename the object ...
Read now
Unlock full access