Skip to content

Instantly share code, notes, and snippets.

Avatar

John Sanders john-sanders

View GitHub Profile
View gist:800b973858bc13e4417c
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