http://pennstategeog467.github.io/pop-carte/
http://pennstategeog467.github.io/emergency-campus-map/#15/40.8016/-77.8559
#!/usr/bin/env node | |
var fs = require('fs'); | |
var osmium = require('osmium'); | |
var turf = require('turf'); | |
var Cardboard = require('cardboard'); | |
var cardboard = Cardboard({ | |
table: 'hdm-vt-table', | |
region: 'us-east-1', |
The Mapbox Studio style hdm-style.tm2 is a humanitarian map design that relies on three vector tile sources, two of which are hosted and served by Mapbox:
The third source is the focus of this writeup. Currently, hdm-style.tm2
uses a hand-processed, non-updating snapshot of HDM vector tiles for small subregions of the world. This gist explains in rough psuedocode and theory how you could set up a HDM vector tiles source that would update hourly (or minutely or daily) from the OSM database and cover the entire planet.
To generate an MBTiles file with PNG image map tiles from the Humanitarian Data Model style, follow this steps (on Mac OS X).
Use this workflow to generate a vector tile based map in Mapbox Studio from an osm.pbf
file. https://gist.github.com/aaronpdennis/a53f9afb8ef24d499e96
Install tl.
node blood-type-donors-map.js ./data/blood_drives_verified.geojson | tippecanoe -f -z 8 -b 12 -r 2.0 -o ../blood_types.mbtiles |
tippecanoe -z 9 -f -o ../hex-tiles.mbtiles ./data/grid-agg.geojson |
{ | |
"water_source": { | |
"class": { | |
"water well": ["man_made=water_well"], | |
"water tower": ["man_made=water_tower"], | |
"water tank": ["man_made=storage_tank", "man_made=water_tank"], | |
"spring": ["natural=spring"], | |
"drinking water": ["amenity=drinking_water"] | |
}, | |
"potable": { |
tippecanoe \ | |
-z 14 -Z 13 \ | |
-d12 -D12 \ | |
-b 20 \ | |
-pc -f \ | |
-o hdm.mbtiles \ | |
hdm-data/hdm_label.json\ | |
hdm-data/water_source.json \ | |
hdm-data/communication.json \ | |
hdm-data/electric_utility.json \ |
topojson \ | |
-o ../site/countries_topo.json \ | |
-p \ | |
-- countries.json |