[mapserver-users] Re: Mapscript

Daniel Morissette morissette at dmsolutions.ca
Thu Jan 10 19:13:54 EST 2002


"Andries J. Algera" wrote:
> 
> On Thu, 10 Jan 2002, Daniel Morissette wrote:
> >
> > You can use the new layerObj methods open()/close() and getShape() to do
> > the equivalent of what you used to do with shapefiles to read the
> > bounding box of selected shapes.  These new methods will work with any
> > data source supported by MapServer and not just shapefiles.
> >
> How would I do this if the datasource is oraclespatial or postgis? Because
> in this case I won't have a file to open.
> 

The open()/close() calls are methods of the layerObj, and they simply
access whatever connection is defined in your layerObj in the map file. 
So it should work exactly the same way no matter which data source you
use.

   int open(string shapepath)
        Open the layer for use with getShape().  
        Returns MS_SUCCESS/MS_FAILURE.

   void close()
        Close layer previously opened with open().

   shapeObj getShape(int tileindex, int shapeindex)
        Retrieve shapeObj from a layer by index.

I believe that the shapepath and tileindex arguments are simply ignored
by oraclespatial and postgis... so you could simply pass "" and -1
respectively.

-- 
------------------------------------------------------------
 Daniel Morissette               morissette at dmsolutions.ca
 DM Solutions Group              http://www.dmsolutions.ca/
------------------------------------------------------------
  Don't put for tomorrow what you can do today, because if 
      you enjoy it today you can do it again tomorrow.




More information about the mapserver-users mailing list