[OSM-talk] Proper use of layer tag with the Mapnik renderer?

Michal Migurski mike at stamen.com
Mon Jun 22 01:05:32 BST 2009


On Jun 21, 2009, at 4:46 AM, Jon Burgess wrote:

> The tagging seems reasonable. The current rendering is down to the  
> rules
> in the oxm.xml:
>
> <Layer name="bridges" status="on" srs="...">
>    <StyleName>road-bridges-casing</StyleName>
>    <StyleName>road-bridges-fill</StyleName>
>    <StyleName>noncased-ways-bridges</StyleName>
>    <StyleName>mwaybridge_layer0_casing</StyleName>
>    <StyleName>mwaybridge_layer0_fill</StyleName>
>    <StyleName>mwaybridge_layer1_casing</StyleName>
>    <StyleName>mwaybridge_layer1_fill</StyleName>
>    <StyleName>mwaybridge_layer2_casing</StyleName>
>    <StyleName>mwaybridge_layer2_fill</StyleName>
>    <StyleName>mwaybridge_layer3_casing</StyleName>
>    <StyleName>mwaybridge_layer3_fill</StyleName>
>    <StyleName>mwaybridge_layer4_casing</StyleName>
>    <StyleName>mwaybridge_layer4_fill</StyleName>
>    <StyleName>mwaybridge_layer5_casing</StyleName>
>    <StyleName>mwaybridge_layer5_fill</StyleName>
>    <StyleName>primarybridge_layer0_casing</StyleName>
>    <StyleName>primarybridge_layer0_fill</StyleName>
>    <StyleName>primarybridge_layer1_casing</StyleName>
>    <StyleName>primarybridge_layer1_fill</StyleName>
>    <StyleName>primarybridge_layer2_casing</StyleName>
>    <StyleName>primarybridge_layer2_fill</StyleName>
>
>
> These rules will draw the motorway bridges above any secondary bridges
> regardless of the layering. I don't understand the logic behind the
> current rules, I believe they were done like this to fix some layering
> issues in some other complex junctions.

Hm, having all the bridges in a layer is unfortunate.

I would have expected to see the "layer" tag unambiguously refer to  
physical z-order, at least that's how we interpreted it in the three  
Cloudmade styles:

                 SELECT ...
                         COALESCE(z_order, 0) AS coalesced_z_order,
                         (CASE WHEN highway IN ('motorway',  
'motorway_link') THEN 0
                               WHEN highway IN ('footpath', 'track',  
'footway', 'steps', 'pedestrian', 'path', 'cycleway') THEN 1
                               WHEN railway IN ('rail', 'spur',  
'subway', 'light_rail', 'tram', 'abandoned', 'disused', 'monorail')  
THEN 2
                               WHEN highway IN ('trunk', 'trunk_link',  
'primary', 'primary_link') THEN 3
                               WHEN highway = 'secondary' THEN 4
                               WHEN highway = 'tertiary' THEN 5
                               ELSE 9 END) AS priority,
                         ...
                  FROM planet_osm_line
                  ...
                  ORDER BY coalesced_z_order ASC, priority DESC

So it seems like it's flatly impossible to draw the streets in that  
particular interchange in the correct order? Any chance that the  
current keepers of osm.xml would be open to a bit of rejiggering?

-mike.

----------------------------------------------------------------
michal migurski- mike at stamen.com
                  415.558.1610







More information about the talk mailing list