<HTML><BODY><p>I would draw your attention to the source of this discussion.<br>http://osgeo-org.1560.x6.nabble.com/the-lines-one-above-other-td5187093.html</p><p>It seems I found how to display multilevel junction of highway with "ORDER BY" in the case using a one layer. Adding "order by id desc" or "order by id asc" in subquery, also the definition $highwayStyle2 besides $highwayStyle1 works fine.<br>Please see the code and the illustrations below:<br><br>--------------------------------------------------</p><p>$highwayLayer->set('status', MS_ON);<br>$highwayLayer->set('name', 'highway');<br>$highwayLayer->set('labelitem', 'name');<br>$highwayLayer->setConnectionType(MS_POSTGIS);<br>$highwayLayer->set('connection', 'user=my_user password=my_pass dbname=my_db host=localhost');</p><p>$highwayLayer->set("data","geom from (select id, 'id = '||id as name, geom from my_table<br>where ST_Intersects(geom, !BOX!) order by id desc) as subquery using unique id using srid=3857");<br>$highwayLayer->setprocessing("close_connection=defer");<br>$highwayLayer->set("type",MS_LAYER_LINE);</p><p>$highwayClass = new ClassObj($highwayLayer);<br>$highwayClass->set('name', 'highway');</p><p>$highwayStyle1 = new styleObj($highwayClass); <br>$highwayStyle1->color->setRGB(254,173,0);<br>$highwayStyle1->set('linecap','square'); <br>$highwayStyle1->set('width',4);<br>$respdorStyle1->outlinecolor->setRGB(255,0,0); <br>$respdorStyle1->set('outlinewidth',2);</p><p>$highwayStyle2 = new styleObj($highwayClass); <br>$highwayStyle2->color->setRGB(254,173,0);<br>$highwayStyle2->set('linecap','square'); <br>$highwayStyle2->set('width',4);<br>$respdorStyle2->outlinecolor->setRGB(255,0,0); <br>$respdorStyle2->set('outlinewidth',2);<br><br>-------------------------<br><br>Result when "order by id asc":<br><a href="http://s22.postimg.org/esbobf18x/order_by_id_asc.jpg" data-mce-href="http://s22.postimg.org/esbobf18x/order_by_id_asc.jpg">http://s22.postimg.org/esbobf18x/order_by_id_asc.jpg</a><br><br>Result when "order by id desc":<br><a href="http://s10.postimg.org/qeokp2jrd/order_by_id_desc.jpg" data-mce-href="http://s10.postimg.org/qeokp2jrd/order_by_id_desc.jpg">http://s10.postimg.org/qeokp2jrd/order_by_id_desc.jpg</a><br><br>-------------------------<br></p><p>That's the goods for me but there is the impression of using some undocumented singularity.</p><p>Thanx for any comments.</p><p><br><br></p><p><br data-mce-bogus="1"></p><br><style type="text/css"></style></BODY></HTML>