[OSM-dev] Magnacarto and Kosmtik

nebulon42 nebulon42 at yandex.com
Wed Apr 6 18:51:27 UTC 2016

I was working for some time on connecting Magnacarto and Kosmtik. If you
don't know them: Magnacarto is a Go implementation of CartoCSS
(https://github.com/omniscale/magnacarto) and Kosmtik
(https://github.com/kosmtik/kosmtik) is a tool for developing map styles
with Mapnik and CartoCSS.

Magnacarto comes with its own development app, but since I'm used to
Kosmtik I wanted to make Magnacarto available to Node.js through a
native extension. Magnacarto may not support the full feature set of the
CartoCSS JavaScript reference implementation, but comes very close.
Since Go is a compiled and statically typed language Magnacarto is much
faster in parsing complex styles than the interpreted JavaScript

For openstreetmap-carto the difference is as large as 1.24s for
Magnacarto vs. 10.08s for Carto on my machine (Intel Core i5-4300U,
Linux x64 and 12 GB RAM, January 2016). This makes a huge difference
when working on such complex map styles like openstreetmap-carto.

If you want to give it a try: Magnacarto comes as plugin for Kosmtik
(see https://github.com/kosmtik/kosmtik-magnacarto), which can be
installed just like other Kosmtik plugins. The necessary changes to
Kosmtik core were merged only yesterday so you need to run the latest
master for it to work. Then enable the custom renderer through the
--renderer magnacarto option.

There is one caveat: The extension is currently not available for
Windows, because Go does not support building Windows shared libraries yet.

I'm happy if you try it out and let me know how it works for you and
what you think.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: OpenPGP digital signature
URL: <http://lists.openstreetmap.org/pipermail/dev/attachments/20160406/d529f39f/attachment.sig>

More information about the dev mailing list