Consider GADM as source for admin module
hugolpz opened this issue · 3 comments
- inspect data in QGIS
- adapt makefile
- change loop data / frames ?
Sources
- http://bl.ocks.org/hugolpz/4f8d6eaeaf41c72e268b
- https://stackoverflow.com/a/52189536/1974961
- https://hugolpz.github.io/distillery/
- https://mapshaper.org
- /03_administrative/administrative.makefile
- @mbostock's World-atlas
Npm toolchain
Former:
-
topojson: see #api-reference for equivalence of ancient options with recent modules.
-
shapefile for converting ESRI shapefiles to GeoJSON
- shp2json -n input.shp > output.geojson
- shp2json --encoding utf8
-
topojson-server for converting GeoJSON to TopoJSON
- geo2topo --quantization count
-
topojson-simplify for topology-preserving simplification and filtering for TopoJSON.
- toposimplify -s value
- toposimplify --filter-all
-
topojson-client for manipulating TopoJSON and converting it back to GeoJSON
- topo2geo [options…] <name=file>… : Converts one or more TopoJSON objects from an input topology to one or more GeoJSON features.
topo2geo states=us-states.geo.json < US-input.topo.json # `states` is a feature collection within input topojson, copied and expanded in us-states.geo.json
- topo2geo --list : List the names of the objects in the input topology, and then exit. For example
topo2geo -l < administrative.topo.json
returnsadmin_0 admin_1 places disputed
. - topoquantize [options…] [file] : quantized number of possible coordinates on any axis, usually either
1e4
,1e5
or1e6
.
- topo2geo [options…] <name=file>… : Converts one or more TopoJSON objects from an input topology to one or more GeoJSON features.
-
d3-geo-projection for manipulating GeoJSON,
-
ndjson-cli for operating on newline-delimited JSON streams.
- ndjson-map [expression]
ndjson-map 'd.properties = {prop1: d.properties.prop1, p2: d.properties.prop2}, d' \
< myfile.ndjson \
> myfile-filtered.ndjson
Output can be chained:
- -o file
- -out file
Specify the output TopoJSON file name. Defaults to “-” for stdout.
# download data
# source: https://gadm.org/download_country_v3.html
curl \
-L -C - 'https://biogeo.ucdavis.edu/data/gadm3.6/shp/gadm36_KHM_shp.zip' \
-o ./KHM_adm.zip \
unzip -n ./KHM_adm.zip -d ./
topojson \
--bbox \
--id-property none \
-p name=NAME_1 \
-p code=ID_1 \
-p L0=NAME_0 \
-q 1e4 \
--filter=small \
-o KHM_adm.topo.json \
-- admin_1=KHM_adm1.shp admin_2=KHM_adm2.shp
Shapefile
Topojson
Command
npx topojson --bbox --id-property none -p name=NAME_1 -p code=ID_1 -p L0=NAME_0 -q 1e4 --filter=small -o KHM_adm.topo.json -- admin_1=gadm36_KHM_1.shp admin_2=gadm36_KHM_2.shp
This would be epic. I'm interested in this.
@curran, thanks for this hint it has great value :D This repository is ancient but that gives opportunity to upgrade it to gadm 3.6.
If you want to see the edge of what I'am doing, visually, it's on wikipedia. I'am in a friendly competition with an Belgian developer. He is damn good !
Very cool!