Magnacarto is a CartoCSS map style processor that generates Mapnik XML and MapServer map files.
Clone or download
Type Name Latest commit message Commit time
Failed to load latest commit information.
app Added icon to warning messages Sep 12, 2017
builder mapserver: do not err for unsupported transform functions (backwards … Nov 14, 2018
cmd Merge branch 'master' into render-feedback Aug 8, 2017
color husl-go renamed to hsluv-go Jul 24, 2017
config config: set datadir to lookuplocator Aug 3, 2017
docs examples: update titles Sep 1, 2015
maps app: parse SRS from request Jul 27, 2017
mml mapserver: support gdal raster datasources with processing parameters Aug 22, 2017
mss fix regression tests with OGR2 Aug 7, 2018
regression fix regression tests with OGR2 Aug 7, 2018
render render: support for forced bgcolor in mapnik Apr 5, 2018
vendor vendor: add missing Aug 28, 2017
.gitignore ignore magnacarto-mapnik Aug 4, 2015
.travis.yml drop Go 1.6 support: does not support Stderr in CGI hander Jul 26, 2017
Gopkg.lock magnaserv: improve change detection (update fsnotify, re-add after al… Aug 28, 2017
Gopkg.toml magnaserv: improve change detection (update fsnotify, re-add after al… Aug 28, 2017
LICENSE add README and LICENSE Jun 11, 2015
Makefile ignore /cmd for coverages Feb 15, 2016 update Missings section in readme Mar 4, 2016 crosscompile: do not use godep Aug 3, 2017
doc.go add package doc strings May 22, 2015
example-magncarto.tml add missing example-magnacarto.tml (closes #10) Jan 14, 2016
version.go set buildVersion with '-ldflags -X' Aug 4, 2015


Magnacarto is a CartoCSS map style processor that generates Mapnik XML and MapServer map files.

It is released as open source under the Apache License 2.0.

The development of Magnacarto is sponsored by Omniscale and development will continue as resources permit. Please get in touch if you need commercial support or if you need specific features.


  • Easy to use map viewer


  • Generate styles for Mapnik 2/3 and MapServer


OSM-Bright MapServer


OSM-Bright Mapnik

Current status

  • Supports nearly all features of CartoCSS
    • Attachments
    • Instances
    • Classes
    • Color functions
    • Expressions
    • etc.
  • Can successfully convert complex styles (like the OSM Carto style)


  • Not all CartoCSS features are supported by the MapServer builder
  • Improved configuration
  • ...



There are binary releases available for Windows, Linux and Mac OS X (Darwin):



You need Go>1.5 and git.


First create a GOPATH directory for all your Go code, if you don't have one already:

mkdir -p go
cd go
export GOPATH=`pwd`

Then you need to enable GO15VENDOREXPERIMENT, if you are using Go 1.5. You can skip this if you are using 1.6 or higher:


Next you can fetch the source code and build/install it:

go get -u
cd $GOPATH/src/
make install

Render Plugins

The web-frontend of Magnacarto can render map images with Mapserver and Mapnik.


The Mapserver plugin is already included in the default magnaserv installation and it requires the mapserv binary in your PATH on runtime.


The Mapnik plugin needs to be compiled as an additional binary (magnacarto-mapnik). You need to have Mapnik installed with all header files. It supports Mapnik 2.2 and 3.0. Make sure mapnik-config is in your PATH. Call make install to build the plugin binary.



magnacarto takes a single -mml file.

magnacarto -mml project.mml > /tmp/magnacarto.xml

To build a MapServer map file:

magnacarto -builder mapserver -mml project.mml > /tmp/

See magnacarto -help for more options.


Magnaserv is a web-frontend for Magnacarto. Make sure the ./app directory is in your working directory or next to the magnaserv executable.

To start magnaserv on port 7070:


Magnaserv will search for .mml files in the current working directory or in direct sub-directories.

To start magnaserv on port 8080 with the Mapserver plugin enabled:

magnaserv -builder mapserver -listen

You can configure the location of stylings, shapefiles or images, and database connection parameters with a configuration file. See example-magnacarto.tml:

magnaserv -builder mapserver -config magnacarto.tml


See docs/examples for example files and usage instructions.

Refer to the Carto project for documentation of the CartoCSS format.

Refer to the following CartoCSS projects for larger .mml and .mss examples.

Please note that openstreetmap-carto relies on a few advanced Mapnik features that are not supported by Mapserver. Future versions of Magnacarto might work around these limitations.


Please use GitHub for questions:

For commercial support contact Omniscale.


The latest developer documentation can be found here:

The source code is available at:

You can report any issues at:


Unit tests

go test -short ./...

Regression tests

There are regression tests that generate Mapnik and MapServer map files, renders images and compares them. These tests require Image Magick (compare) and MapServer >=7 (shp2img).

go test ./...