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

Igor Brejc igor.brejc at gmail.com
Thu Jul 28 22:04:30 BST 2011


On Thu, Jul 28, 2011 at 12:37 PM, Richard Fairhurst <richard at systemed.net>wrote:

>
> (Incidentally, I missed out from my previous posting one thing that I did
> want to say: my one disappointment with all of this is that Maperitive
> doesn't use MapCSS or indeed anything of that ilk.)
>
>
Richard, if you remember two years ago I _was_ considering using MapCSS for
the (then) Kosmos successor and we had a brief discussion about certain
things (see http://wiki.openstreetmap.org/wiki/Talk:MapCSS). Kosmos wiki
table rules were becoming cumbersome and I was looking for an alternative.

The basic reason why MapCSS wasn't chosen is because I couldn't see how I
could implement an efficient way of rendering maps in real-time using
declarative-style rules like CSS or MapCSS, especially in scenarios when the
map data is fetched from a database (and I'm talking about a direct OSM
schema, not Mapnik's preprocessed one). Maperitive now uses an imperative
DSL: you match the feature and then give a sequence of commands for
rendering that feature. There are also conditional statements, pattern
matching of feature names etc. which allow writing rules without too much
duplication. On the other hand I didn't want to employ OSM-specific hacking
logic into the rendering engine (which was suggested to me at that time as a
possible solution for my problem), I wanted the engine to remain OSM-neutral
(except for a few things like multipolygon handling and the layer tag).

As it turns out even that DSL isn't enough for some users, so in the next
few months I plan to extend Maperitive with a Python toolkit (instead of
implementing a monster general-purpose DSL). The main problem is handling
various OSM relation types in a generic way (again, without hard-coded
OSM-specific logic. I don't want Maperitive to have an embedded knowledge
about cycle routes, for example - I want that knowledge to be expressed
externally, by the user. I don't know how that could be achieved using
MapCSS (but I haven't followed news on MapCSS, so maybe there is a way now).

Igor
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/dev/attachments/20110728/dd374460/attachment.html>


More information about the dev mailing list