Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Mapnik: An Overview

Mapnik: An Overview

Presented to the Northwest Washington GIS User Group. June 18th, 2010. A high-level overview of Mapnik.

Matthew Kenny

June 18, 2010
Tweet

More Decks by Matthew Kenny

Other Decks in Programming

Transcript

  1. Mapnik: An Overview
    June 18, 2010 – NWWaGIS

    View Slide

  2. What is Mapnik?
    • Toolkit for generating static map images
    – Most commonly used for generating custom web-
    mapping tiles.
    • Cross-platform
    – Windows Binaries available
    • Accepts many data formats
    – SHP/PostGIS/TIFF/OSM/GDAL/OGR
    • Produces many data outputs
    – PNG/JPEG/SVG/PDF
    • Built-in WMS Server

    View Slide

  3. Who is using it?
    • OpenStreetMap
    • Cloudmade
    • EveryBlock
    • Others

    View Slide

  4. How does it work?

    View Slide

  5. Styling
    • Multiple rules style a
    single feature
    • Features rendered in
    a ‘Painters Order’

    View Slide

  6. Styling
    • Mapfile can be large
    – OpenStreetMap XML:
    • 6763 lines long
    • 30 Layers
    • 106 Styles
    • 628 Rules

    View Slide

  7. Render the Map
    • Python script to seed a tile cache
    – Declare Bounding Box, Zoom Scales, Source Map File, Output
    Directory
    – Creates a Z/X/Y File Structure
    – http://mkgeomatics.com/apps/bus/tiles/15/5239/11286.png
    • File structure can be accessed directly
    by display client
    – OpenLayers

    View Slide

  8. Extending Mapnik
    • Quantumnik
    – Developed by Seattle based geo-developer Dane
    Springmeyer (dbsgeo.com)
    – Style the map in QGIS GUI
    – Generate the XML mapfile automatically
    – Can view mapfile live via console
    – Great tool to learn mapfile syntax

    View Slide

  9. Extending Mapnik
    • Cascadenik
    – Developed by Stamen Design’s Michal Migurski
    – CSS Preprocessor
    • CSS is converted into an XML map file
    • Familiar to web designers

    View Slide

  10. The Future
    • Better typography controls
    • New expression engine
    – Support filtering with Regular Expressions
    • Increase performance
    – Planned entry in FOSS4G WMS Shootout
    • Single File Map (SFM)
    – Create a map package with the data and styling to
    be viewable offline.

    View Slide

  11. Learn More
    • Mapnik: mapnik.org
    • Quantumnik:
    http://bitbucket.org/springmeyer/quantumnik/wiki/Home
    • Cascadenik: http://mike.teczno.com/notes/cascadenik.html
    • E-mail: [email protected]

    View Slide