[mapserver-users] Re: Mapscript
Stephen Lime
steve.lime at dnr.state.mn.us
Tue Jan 15 15:14:31 PST 2002
Check with Rodrigo, and the PostGIS folks to be sure but most databases would have to maintain some type of an rowid for efficiency. None of the developers balked at the notion of an integral index, but I'll have to check the code to see how they implemented it. SDE maintains a virtual record counter and has a function in it's C API that maps almost directly to the getShape method. This allows for fast access to a record set after a complex query has been done (no need to redo it). If that's not the case with SDO and PostGIS then I think we could work around it by requiring an integral key of a predefined name and hide access using it within the vendor specific code. When a shape is fetched from any data source the index structure member is *supposed* to contain that unique id. It's that id that is also stored in the query cache.
I checked the source and all connection types implement a msXXXLayerGetShape function. SDO support for that function isn't complete but it is for all other data sources.
Steve
Stephen Lime
Data & Applications Manager
Minnesota DNR
500 Lafayette Road
St. Paul, MN 55155
651-297-2937
>>> Daniel Morissette <morissette at dmsolutions.ca> 01/11/02 04:14PM >>>
Jim Burnett wrote:
>
> I've been looking into using getShap(), but doesnt it require the index of
> the shape? Not all databases will have this Index. I think you can get the
> shap via a class, but the shapeObj doesnt seem to work correctly. Do you
> have any sample code for drawing a shape, getting the shape by class, not by
> the shape index?
>
I think I see what you mean: reocrds obtained from a RDBMS won't carry a
unique shape_id the same way as shapefiles and other file-based formats
will. So you don't have any shape_id to pass to getShape() after a
query. I don't know about SDE and PostGIS, but I have used SDO before
(outside of the MapServer world) and I believe that there is nothing in
OracleSpatial that can easily be mapped to a shape_id.
I guess the best ones to answer this question are the developers of the
SDO, SDE, and/or PostGIS connections: Do the database-based connections
in MapServer have any equivalent of a shape_id? If not then what should
one do to retrieve the shapes returned by a queryByPoint() in MapScript
for instance?
--
------------------------------------------------------------
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