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.
- Generate styles for Mapnik 2/3 and MapServer
- Supports nearly all features of CartoCSS
- Attachments
- Instances
- Classes
- Color functions
- Expressions
- etc.
- Can successfully convert complex styles (like the OSM Carto style)
- Regexp filters
- Not all CartoCSS features are supported by the MapServer builder
- Improved configuration
- ...
There are binarie releases available for Windows, Linux and Mac OS X (Darwin): http://download.omniscale.de/magnacarto/rel/
There are some dependencies:
You need Go.
Magnacarto uses the following libraries.
The tests require:
go get
will fetch these, but you can also use godep to use a provided (vendorized) set of these dependencies.
Fetching Magnacarto requires git.
Create a new Go workspace:
mkdir magnacarto
cd magnacarto
export GOPATH=`pwd`
Get Magnacarto and all dependencies:
go get github.com/omniscale/magnacarto
go install github.com/omniscale/magnacarto
Done. You should now have a magnacarto
binary in $GOPATH/bin
.
Go compiles to static binaries and so Magnacarto has no runtime dependencies to Go.
Just copy the magnacarto
binary to your server for deployment.
Magnacarto contains a fixed set of the dependencies that are known to work. You need to install Magnacarto with godep to compile with this set.
git clone https://github.com/omniscale/magnacarto src/github.com/omniscale/magnacarto
cd src/github.com/omniscale/magnacarto
godep go install ./...
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/magnacarto.map
See magnacarto -help
for more options.
Refer to the Carto project for documentation of the CartoCSS format.
- https://github.com/mapbox/carto/blob/master/docs/latest.md
- https://www.mapbox.com/tilemill/docs/crashcourse/styling/
Refer to the following CartoCSS projects for example .mml and .mss files.
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: https://github.com/omniscale/magnacarto/issues
For commercial support contact Omniscale.
The latest developer documentation can be found here: http://godoc.org/github.com/omniscale/magnacarto
The source code is available at: https://github.com/omniscale/magnacarto/
You can report any issues at: https://github.com/omniscale/magnacarto/issues
go test -short ./...
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 ./...