2

I'm creating a map with Mapnik, and I have some trouble to correctly render overlapping lines. Fot instance let's consider this piece of XML:

<Style name="ferry-routes">
    <Rule>
        &min-zoom-12;
        <LineSymbolizer stroke="#ffffff" stroke-width="1.5" />
        <LineSymbolizer stroke="#0000ff" stroke-dasharray="2, 5" stroke-width="1" />
    </Rule>
</Style>

<Layer maximum-scale-denominator="3000000" name="ferry-routes">

    <StyleName><![CDATA[ferry-routes]]></StyleName>

    <Datasource>
        &postgis-settings;
        <Parameter name="dbname">osm</Parameter>
        <Parameter name="table"><![CDATA[(
            SELECT
                osm_id,
                way
            FROM
                planet_osm_line
            WHERE
                route = 'ferry'
            ) AS ferry_routes]]></Parameter>
    </Datasource>

</Layer>

When two lines have the exact same geometry, I'd expect it to draw, in this order:

  • white background of line 1
  • blue dashes of line 1
  • white background of line 2
  • blue dashes of line 2

Resulting in only line 2 to be visible.

Instead, it does this:

  • white background of line 1
  • white background of line 2
  • blue dashes of line 1
  • blue dashes of line 2

Resulting in all the dashes to be visible, like here (buggy line on the left, correct one on the right):

enter image description here

Is there a workaround?

0

That seems to be a bug in Mapnik, I opened a ticket here: https://github.com/mapnik/mapnik/issues/4034

To workaround the issue, I selected only the ferry lines with a positive osm_id.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.