[mapserver-dev] get features geomerty

cgishack drewtimmins at gmail.com
Sat Jun 28 22:50:05 EDT 2008


Hello,
Is there any way I can get a features geometry from a spatial query.
I am using PHP/MapScript but can only seem to find ways to get attributes.

I am using postGIS and tried a method like so.

       $layer->queryByRect($selectionEnvelope);
       $status = $layer->open();
       $status = $layer->whichShapes($selectionEnvelope);
       while ($shape = $layer->nextShape())
       {
                echo $shape->values["the_geom"]; //<-- postgre field name...
not
found
       }
       $layer->close();

I assume i could use plain SQL and PHP to get the data, but I wanted to make
it work with shapefiles also.

Any help would be appreciated.

Drew
-- 
View this message in context: http://www.nabble.com/get-features-geomerty-tp18176915p18176915.html
Sent from the Mapserver - Dev mailing list archive at Nabble.com.



More information about the mapserver-dev mailing list