[Mapserver-users] Using the shapefile FID in a query

Steve Lime steve.lime at dnr.state.mn.us
Mon Jun 28 13:43:21 EDT 2004


Can you share a shapefile? Did you create the FID field or is some other piece of software reporting its existance? ArcView will show a sequential number but that's not part of the shapefile. You might also share your script, or at least a bit of it. Queries do return an index number and that can be used to retrieve features individually. I assume the INDEXQUERY mode of the CGI program is also present in MapScript using something queryByIndex method...

Steve

>>> "Mark Adams" <markadams at cuestasys.com> 06/28/04 11:52 AM >>>
I'm puzzled over the behaviour of mapserver in returning query results
from shapefiles. It appears the FID field which is present in all of the
shape files I'm using does not get returned by mapserver when we use any
of the mapscript query functions. There is no error, the field simply
isn't present in the return value. Is this by design, and is there a way
around this?
 
This is causing me trouble as I need to have a generic way of
identifying a specific (unique) feature. For example, if I query a layer
and get back a list of 8 results from that query, I want to present
these to the user and give them the option of separately clicking on and
zooming to each of those items. To zoom and highlight a specific item I
need to use the FID * it's the only unique key I can count on. 
 
Thanks in advance.
 
------------------------------
Mark Adams
Business & Systems Analyst
Cuesta Systems Inc.
5230 South Service Road
Burlington, ON L7L 5K2
Phone: 905-333-4544 x14
Fax: 905-333-0455
Email: markadams at cuestasys.com
 





More information about the mapserver-users mailing list