Skip to content

Instantly share code, notes, and snippets.

View john-sanders's full-sized avatar

John Sanders john-sanders

View GitHub Profile
import mapnik
#datasource rasters for land and sea, plus world vector
landDatasource = mapnik.Gdal(file="land/land.vrt")
seaDatasource = mapnik.Gdal(file="sea/sea.vrt")
vectorDatasource = mapnik.GeoJSON(file="ne_10m_admin_0_countries_lakes/ne_10m_admin_0_countries_lakes.geojson")
# create our three layers: sea, land, vector mask
landLayer = mapnik.Layer("land")
landLayer.datasource = landDatasource