Skip to content

Instantly share code, notes, and snippets.

@slattery
Created March 6, 2020 17:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save slattery/f1416671704af303a573c37e160ccc7b to your computer and use it in GitHub Desktop.
Save slattery/f1416671704af303a573c37e160ccc7b to your computer and use it in GitHub Desktop.
topojson countries from 50m natural earth source

Source: https://raw.githubusercontent.com/nvkelso/natural-earth-vector/master/geojson/ne_50m_admin_0_countries.geojson

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

Example:

ndjson-split 'd.features' \
 < ne_50m_admin_0_countries.geojson \
 | ndjson-filter 'd.properties.SUBREGION == "South-Eastern Asia" || d.properties.SUBREGION == "Southern Asia"' \
 | ndjson-filter 'd.properties = {ISO_A3: d.properties.ISO_A3, ISO_N3: d.properties.ISO_N3, REGION_UN: d.properties.REGION_UN, SUBREGION: d.properties.SUBREGION, NAME: d.properties.GEOUNIT, REGION_WB: d.properties.REGION_WB, CONTINENT: d.properties.CONTINENT }' \
 > ne50_ssndseaasia.ndjson
 
geo2topo -n countries=ne50_ssndseaasia.ndjson  > ne_50m_6f_countries.sseasia.topo.json
Display the source blob
Display the rendered blob
Raw
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Display the source blob
Display the rendered blob
Raw
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Display the source blob
Display the rendered blob
Raw
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Display the source blob
Display the rendered blob
Raw
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Display the source blob
Display the rendered blob
Raw
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment