Skip to content

Geospatial Assets

Drew Bollinger edited this page May 26, 2017 · 4 revisions

Map Updating

Map display aggregation is controlled by the file in app/assets/data/geo/aggregation.csv.

The first column, "id", contains the ids for each shape/polygon/country on the map. The following columns, "region", "continent", and "subcontinent" control which values from the database are mapped on to that map area. For example, the China polygon, CHN, corresponds to the IMPACT region EAP-China (China Mainland), the continent Asia, and the subcontinent Eastern Asia.

Note for developers: The file app/assets/data/aggregate_region.json can be created from the csv with the following one-liner perl -p -e 'tr/A-Z/a-z/' raw/aggregate_region.csv | sed -E "s/ /_/g" | csv2json | jq 'map({(.id): { region, continent, subcontinent}}) | add'

Initial Map Creation

For documentation purposes only. Needed only if you want new boundaries

  1. Download shapefile from Natural Earth: 50m cultural

  2. Manually edit shapefile to make French Guyana its own polygon (not part of France) and give it the adm0_a3 code FGY

  3. Use QGIS plugin 'Multipart Split' option: 'split selected multi-part features to a single part'

  4. Select all the new separate polygons of France, excluding French Guyana, and merge back into one (France)

  5. Save as a GeoJSON

  6. Use Command Line Tool topojson to simplify and convert to topojson

    topojson --simplify-proportion 0.2 -o world_sim.topojson --id-property=adm0_a3 -- natural_earth_50m.geojson