<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 14 (filtered medium)">
<base href="https://e.mail.ru/" target="_self"><style><!--
/* Font Definitions */
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:"Comic Sans MS";
        panose-1:3 15 7 2 3 3 2 2 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p
        {mso-style-priority:99;
        mso-margin-top-alt:auto;
        margin-right:0cm;
        mso-margin-bottom-alt:auto;
        margin-left:0cm;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
span.Shkpostityyli18
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
span.ni
        {mso-style-name:ni;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:70.85pt 2.0cm 70.85pt 2.0cm;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="FI" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Hi,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">With OSM and Mapnik it is a two phase process. First osm2pgsql tries to generate sensible z-index values and then Mapnik makes “order by” queries
 to the database. The queries are here <a href="https://github.com/gravitystorm/openstreetmap-carto/blob/master/project.yaml">
https://github.com/gravitystorm/openstreetmap-carto/blob/master/project.yaml</a> and as an example<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">(SELECT way,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">COALESCE((<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">'highway_' || (CASE WHEN highway IN ('residential', 'unclassified', 'pedestrian', 'service', 'footway', 'cycleway', 'track', 'path', 'platform')
 THEN highway ELSE NULL END)),<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">('railway_' || (CASE WHEN railway IN ('platform') THEN railway ELSE NULL END))<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">) AS feature<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">FROM planet_osm_polygon<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">WHERE highway IN ('residential', 'unclassified', 'pedestrian', 'service', 'footway', 'track', 'path', 'platform')<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">OR railway IN ('platform')<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">ORDER BY z_order, way_area DESC<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">) AS highway_area_casing<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">-Jukka Rahkonen-<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<div>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">Vladimir wrote:<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p><span lang="EN-US">Bobb<o:p></o:p></span></p>
<p><span lang="EN-US">Thanks you very much for detailed answer.<br>
I'll have to place the parts of lines in various layers.<br>
There is no other ele</span>gant decision as i understood, but I wonder how "web-map-giants" like GOOGLE or OSM get out of this scrape.<o:p></o:p></p>
<blockquote style="border:none;border-left:solid #0857A6 1.0pt;padding:0cm 0cm 0cm 8.0pt;margin-left:7.5pt;margin-top:7.5pt;margin-right:7.5pt;margin-bottom:7.5pt">
<p class="MsoNormal"><o:p> </o:p></p>
<div id="">
<div>
<div>
<div id="style_14237548520000000350_BODY">
<div>
<p><span style="font-size:8.0pt;font-family:"Comic Sans MS"">Vladimir,</span><o:p></o:p></p>
<p><span style="font-size:8.0pt;font-family:"Comic Sans MS""> </span><o:p></o:p></p>
<p><span style="font-size:8.0pt;font-family:"Comic Sans MS"">I’ve faked this in the past by drawing the same layer many times in one pass (inside of the same mapfile), you need at least one complete layer pass, with other partial layers for the over/under situations. 
 You can do the partial layer grouping with attributes on the segments that need to go under or over, and this is a manual process for the most part, but it’s a real pain to keep that up to date over time (I’m talking over years) .  I could probably find a
 programmer that thought of this as a challenge, but you still need a human to decide what is over something else as a last QA.</span><o:p></o:p></p>
<p><span style="font-size:8.0pt;font-family:"Comic Sans MS""> </span><o:p></o:p></p>
<p><span style="font-size:8.0pt;font-family:"Comic Sans MS"">The much harder task is defining which layers (partial segments are over/under other layers..  You need to remove some line segments form at least one of the layers in order to make things display
 correctly.  Sometimes a layer is over, sometime it’s under.  I actually have two instances in my mapping system, where I have three different bridges stacked on top of each other, two of them a roadways, with the odd one in between them.  The other has a Railway
 bridge over a roadway bridge crossing.</span><o:p></o:p></p>
<p><span style="font-size:8.0pt;font-family:"Comic Sans MS""> </span><o:p></o:p></p>
<p><span style="font-size:8.0pt;font-family:"Comic Sans MS"">The z-index stuff has always been a painful thing thing to keep updated, but it is doable.</span><o:p></o:p></p>
<p><span style="font-size:8.0pt;font-family:"Comic Sans MS""> </span><o:p></o:p></p>
<p><span style="font-size:8.0pt;font-family:"Comic Sans MS"">I’ve rencetly been looking at this myself for hardcopy pringing purposes. As well.</span><o:p></o:p></p>
<p><span style="font-size:8.0pt;font-family:"Comic Sans MS""> </span><o:p></o:p></p>
<p><span style="font-size:8.0pt;font-family:"Comic Sans MS"">Bobb </span><o:p></o:p></p>
</div>
</div>
</div>
</div>
</div>
</blockquote>
</div>
</body>
</html>