[mapserver-users] reverse the order of shapes of a layer

Lime, Steve D (MNIT) Steve.Lime at state.mn.us
Fri Jan 23 13:00:35 PST 2015


There isn't anything in MapServer that controls feature order. We rely on the backends to do that. I'd think it would be easiest just to set up two layers with different order by clauses.

Steve

-----Original Message-----
From: mapserver-users-bounces at lists.osgeo.org [mailto:mapserver-users-bounces at lists.osgeo.org] On Behalf Of Scout
Sent: Friday, January 23, 2015 1:46 PM
To: mapserver-users at lists.osgeo.org
Subject: [mapserver-users] reverse the order of shapes of a layer

Hello,

I am using phpmapscript with mapserver 6.4.1.

I would like to be able to reverse the order of the shapes in a layer before drawing the map.

I want to draw the map both ways, actually.  I need it drawn right-side-up and up-side-down.  It is simple to reverse the order of the layers of the map, just (in phpmapscript):

##################
    // make arrays to hold the current and reversed orders
    $layerOrder = array ();
    $layerOrder = $map->getlayersdrawingorder();
    $reversed = array_reverse($layerOrder);

    // reverse the order for upside-down
    $r = $map->setlayersdrawingorder($reversed);

    // reset the order for upside-up
    $r = $map->setlayersdrawingorder($layerOrder);
##################

Is there something equivalent for the shapes within a layer?  Maybe a layer PROCESSING directive SQL call like: "select * from layer order by fid desc"?  Or define the layer with OGR CONNECTIONTYPE and CONNECTION back to itself and a SQL call like above??  Maybe I need to build a new layer adding the shapes in reversed order?

Thanks!
_______________________________________________
mapserver-users mailing list
mapserver-users at lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users



More information about the MapServer-users mailing list