the core of geospatial visualization & processing
mapnik combines pixel-perfect image output with lightning-fast cartographic algorithms, and exposes interfaces in C++, Python, and Node.
latest news
code in your language

mapnik's high-quality bindings let's you choose from Node.js, Python, and C++.

import mapnik
m = mapnik.Map(256,256)
mapnik.load_map(m, "path/to/file.xml")
mapnik.render_to_file(m, "the_image.png")
var mapnik = require("mapnik");
var fs = require("fs");
// register fonts and datasource plugins
var map = new mapnik.Map(256, 256);
map.load("./test/stylesheet.xml", function(err,map) {
    if (err) throw err;
    var im = new mapnik.Image(256, 256);
    map.render(im, function(err,im) {
        if (err) throw err;
        im.encode("png", function(err,buffer) {
            if (err) throw err;
            fs.writeFile("map.png",buffer, function(err) {
                if (err) throw err;
                console.log("saved map image to map.png");
#include <mapnik/map.hpp>
#include <mapnik/load_map.hpp>
#include <mapnik/agg_renderer.hpp>
#include <mapnik/image.hpp>
#include <mapnik/image_util.hpp>

    mapnik::Map m(256,256);
    mapnik::load_map(m, "path/to/file.xml");
    mapnik::image_rgba8 im(256,256);
    mapnik::agg_renderer<mapnik::image_rgba8> ren(m, im);
    mapnik::save_to_file(im, "the_image.png");

style with a stylesheet

Only a single XML stylesheet for your map, regardless of the code binding.
XML Configuration
<Map background-color="blue" srs="+init=epsg:4326">
  <Style name="My Style">
      <PolygonSymbolizer fill="#f2eff9" />
      <LineSymbolizer stroke="rgb(50%,50%,50%)" stroke-width="0.1" />
  <Layer name="world" srs="+init=epsg:4326">
    <StyleName>My Style</StyleName>
      <Parameter name="file">path/to/shapefile.shp</Parameter>
      <Parameter name="type">shape</Parameter>
above all else, beautiful maps
stacks built with mapnik
Copyright © 2016 Artem Pavlenko | Downloads | License | Media