Cascadenik

From OpenStreetMap Wiki
Jump to navigation Jump to search

Cascadenik is a Mapnik-preprocessor by Michal Migurski that accepts CSS-type stylesheets and produces traditional Mapnik stylesheets.

Using Mike Migurski's openstreetmap style

git clone https://github.com/mapnik/Cascadenik

Edit openstreetmap/style.mml as directed in the file. If you follow the rest of the OSM-with-Mapnik instructions in this wiki, you'll want the following header:

<!DOCTYPE Map[
    <!ENTITY map_srs "+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +no_defs +over">
    <!ENTITY coastlines "<path_to>/world_boundaries/processed_p">
    <!ENTITY coastlines_srs "+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +no_defs +over">
    <!ENTITY osm_srs "+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +no_defs +over">
    <!ENTITY user "postgres">
    <!ENTITY dbname "gis">
    <!ENTITY estimate_extent "false">
]>

Then run

python cascadenik-compile.py openstreetmap/style.mml > osm_teczno.xml

Prerequisites

  • Debian/Ubuntu: sudo aptitude install python-cssutils

See Also

  • CartoCSS, a renderer and language inspired by Cascadenik