Skip to content

Instantly share code, notes, and snippets.

@slattery
Last active March 6, 2020 19:15
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/791d6fd7e4ec60e18ded917ebc7aac33 to your computer and use it in GitHub Desktop.
Save slattery/791d6fd7e4ec60e18ded917ebc7aac33 to your computer and use it in GitHub Desktop.
topojson landmasses 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" || d.properties.SUBREGION == "Northern Africa" || d.properties.REGION_WB == "Sub-Saharan Africa" || d.properties.REGION_WB == "Oceania" || d.properties.REGION_WB == "Latin America & Caribbean"' \
  | 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_studyarea.ndjson
  
geo2topo -n countries=ne50_studyarea.ndjson  > ne_50m_6f_countries.studyarea.topo.json
topomerge land=countries < ne_50m_6f_countries.studyarea.topo.json > ne_50m_countries_land.studyarea.topo.json
topo2geo land=land.studyarea.geo.json < ne_50m_countries_land.studyarea.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