[mapserver-users] [EXTERNAL] Re: the lines one above other

Vladimir fl_v at inbox.ru
Fri Feb 13 04:52:51 PST 2015


I would draw your attention to the source of this discussion.
http://osgeo-org.1560.x6.nabble.com/the-lines-one-above-other-td5187093.html
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.
Please see the code and the illustrations below:

--------------------------------------------------
$highwayLayer->set('status', MS_ON);
$highwayLayer->set('name', 'highway');
$highwayLayer->set('labelitem', 'name');
$highwayLayer->setConnectionType(MS_POSTGIS);
$highwayLayer->set('connection', 'user=my_user password=my_pass dbname=my_db host=localhost');
$highwayLayer->set("data","geom from (select id, 'id = '||id as name, geom from my_table
where ST_Intersects(geom, !BOX!) order by id desc) as subquery using unique id using srid=3857");
$highwayLayer->setprocessing("close_connection=defer");
$highwayLayer->set("type",MS_LAYER_LINE);
$highwayClass = new ClassObj($highwayLayer);
$highwayClass->set('name', 'highway');
$highwayStyle1 = new styleObj($highwayClass); 
$highwayStyle1->color->setRGB(254,173,0);
$highwayStyle1->set('linecap','square'); 
$highwayStyle1->set('width',4);
$respdorStyle1->outlinecolor->setRGB(255,0,0); 
$respdorStyle1->set('outlinewidth',2);
$highwayStyle2 = new styleObj($highwayClass); 
$highwayStyle2->color->setRGB(254,173,0);
$highwayStyle2->set('linecap','square'); 
$highwayStyle2->set('width',4);
$respdorStyle2->outlinecolor->setRGB(255,0,0); 
$respdorStyle2->set('outlinewidth',2);

-------------------------

Result when "order by id asc":
http://s22.postimg.org/esbobf18x/order_by_id_asc.jpg

Result when "order by id desc":
http://s10.postimg.org/qeokp2jrd/order_by_id_desc.jpg

-------------------------
That's the goods for me but there is the impression of using some undocumented singularity.
Thanx for any comments.




-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20150213/0109d28c/attachment.htm>


More information about the MapServer-users mailing list