[Mapcss] Layering model enhancements

Komяpa me at komzpa.net
Wed Aug 10 13:07:30 BST 2011


Whoops, really missed these answers - sorry for that.

2011/4/20 Paul Hartmann <phaaurlt at googlemail.com>:
>> Imagine a linear road that finishes as asphalted surface inside a
>> forest. Let the road be highway=service; the asphalted surface -
>> highway=service area=yes, and forest - landuse=forest.
>>
>> Currently, we draw:
>>  - forest as green;
>>  - highway=service area=yes polygon as white
>>  - casings for both highways. The casing for linear service overlaps
>> with white area's polygon.
>>  - linear fill for highway.
>
> I don't understand completely. I assume the casing for the linear way is
> grey and it is filled white. What do you mean by casing of the area? Is this
> a simple line style that uses the same way as the area? What is it's colour,
> is it grey?

Yes.

In terms of Mapnik, casing is a LineSymbolizer that lies under lines
and is wider than the main line to get a thin line around the roads
(and other ways).

To render OSM nicely using Painter's algorithm you need to:
 - render background
 - render coaslines as polygons
 - render all the backgrounds (like forests, grass, different kinds of
landuse=, ...)
 - render hillshading (optionally, of course)

then, for each layer= tag in order from lowest to highest:
 - render casings in order of z-index-es
 - render *both* polygons and lines that represent foreground features
(buildings, roads) in order of z-indexes

then, render icons and labels in order that is backward for z-indexes
(if renderer can detect collisions) or in order of z-indexes (if
renderer can detect collisions).

The problem is that currently there's no way to describe "background" features.


> Can't this be solved with explicit z-index?

If you assign a z-index, it should apply to both area, casing, line,
text and all the other features, IMHO. Don't you want thick bright
casing for motorway to be drawn over dark casing for footway on lower
zooms (as example)?


> Now, you probably want to draw the asphalted area on top of the way casing,
> so you could raise the area to a z-index of -50.

well, I think of the following situation:

way[highway=motorway]{color:red; width:10}
way[highway=tertiary]{color:yellow; width:5}
way[highway=footway]{color:green; width:2}

area[highway]{fill-color:eval(prop(color)); width:0}

-- 
Darafei "Komяpa" Praliaskouski
OSM BY Team
xmpp:me at komzpa.net mailto:me at komzpa.net



More information about the Mapcss mailing list