[OSM-dev] Converting OSM Mapnik stylesheet to Cascadenik or Carto

Andy Allan gravitystorm at gmail.com
Wed Jul 27 16:33:56 BST 2011


On Wed, Jul 27, 2011 at 3:52 PM, Josh Doe <josh at joshdoe.com> wrote:
> I'm curious if anyone has ever attempted to convert the massive OSM Mapnik
> stylesheet to one of the CSS-like languages such as Cascadenik or Carto. Is
> it even possible? Maybe some features used are not implemented by either of
> these preprocessors...

I've never tried. In Carto there's a utility (cartox) to convert
mapnik2-xml into carto, but the most recent commit message ("Pushing
cartox towards osm.xml compatibility") suggests it might not be fully
there.

As for compatibility, I haven't used carto enough to comment. There
might well be some symbolizer attributes that aren't supported.

It's definitely no longer possible to use Cascadenik for any styles
involving fontsets though, since they aren't exposed in the python
bindings that Cascadenik now uses exclusively.

https://trac.mapnik.org/ticket/348

And dashes with more than 2 values are no longer supported either,
possibly for the same reason?

https://github.com/mapnik/Cascadenik/issues/11

The fontset thing has been a killer for me. Unfortunately it seems
like it's not getting fixed any time soon, with much of the current
effort around mapnik/cascadenik/carto now being plowed exclusively
into carto and tilemill-related functionality.

Taking a step back though, I wouldn't expect any automated conversion
utility to work and produce the best output in your language of
choice. I've recently converted a Cascadenik project to carto and -
after having been badly burned by the automated converter - simply
went though it and reworked things piece by piece. Obviously there's
much more work involved in converting the whole osm-xml stylesheet
though but in the end might well be worth it.

Cheers,
Andy



More information about the dev mailing list