CartoCSS → Mapnik XML
osm
Find a file
2015-09-22 16:03:15 +02:00
app app: Switch to dashboard after restore bookmarks 2015-09-22 16:03:15 +02:00
builder do not return FilesMissingError with empty file list 2015-08-11 11:54:41 +02:00
cmd magnaserv: fix project base for absolute style_dirs 2015-08-13 16:54:51 +02:00
color fix test for rgba formatting 2015-07-21 10:59:25 +02:00
config fix absolute paths for relative baseDir 2015-08-13 12:46:40 +02:00
docs examples: update titles 2015-09-01 16:01:06 +02:00
Godeps update Godeps with natefinch/pie 2015-08-17 11:48:48 +02:00
maps add first version of mapnikserv cmd 2015-07-23 15:31:38 +02:00
mml use layer id instead of name from mml as the layer identifier 2015-07-30 11:18:37 +02:00
mss Merge branch 'master' into magnaserv 2015-08-17 10:21:54 +02:00
regression use new render package for regression tests 2015-08-04 14:40:57 +02:00
render remove global httptest flag from render package 2015-08-13 11:04:48 +02:00
.gitignore ignore magnacarto-mapnik 2015-08-04 14:42:05 +02:00
crosscompile.sh only add files from repo to releases 2015-09-01 15:35:14 +02:00
doc.go add package doc strings 2015-05-22 14:37:37 +02:00
LICENSE add README and LICENSE 2015-06-11 10:20:49 +02:00
Makefile update -ldflags -X syntax for go 1.5 2015-09-01 15:34:29 +02:00
README.md update README for magnaserv 2015-08-17 11:51:54 +02:00
version.go set buildVersion with '-ldflags -X' 2015-08-04 11:04:42 +02:00

Magnacarto

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.

Features

  • Easy to use map viewer

Magnaserv

  • Generate styles for Mapnik 2/3 and MapServer

MapServer

OSM-Bright MapServer

Mapnik

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)

Missing

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

Installation

Binary

There are binary releases available for Windows, Linux and Mac OS X (Darwin): http://download.omniscale.de/magnacarto/rel/

Source

Dependencies

You need Go and git.

Compiling

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. First create a GOPATH and install godep:

mkdir magnacarto
cd magnacarto
export GOPATH=`pwd`
go get github.com/tools/godep

Then call the following commands:

cd $GOPATH
git clone https://github.com/omniscale/magnacarto src/github.com/omniscale/magnacarto
cd src/github.com/omniscale/magnacarto
make install

Render Plugins

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

Mapserver

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

Mapnik

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

Usage

magnacarto

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.

magnaserv

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

To start magnaserv on port 7070:

magnaserv

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 127.0.0.1:8080

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

Documentation

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.

Support

Please use GitHub for questions: https://github.com/omniscale/magnacarto/issues

For commercial support contact Omniscale.

Development

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

Test

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 ./...