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

Mark Adams markadams at cuestasys.com
Mon Jun 28 11:47:27 PDT 2004


Steve, 

Thanks for your reply. Along with Huey Brantley's reply it has cleared
up the problem. The first thing was that I'd assumed that the FID field
that I am seeing in ArcCatalog and other ESRI desktop products was a
physical field in the .dbf - your answer indicates this isn't so, which
would certainly explain why I can't see it. 

The second thing was that I hadn't picked up on indexquery - I'd been
looking at the methods available on the layer object.... Indexquery does
indeed to the trick.

Again thanks for the fantastic support on this list!

------------------------------
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
 

-----Original Message-----
From: mapserver-users-admin at lists.gis.umn.edu
[mailto:mapserver-users-admin at lists.gis.umn.edu] On Behalf Of Steve Lime
Sent: Monday, June 28, 2004 1:43 PM
To: markadams at cuestasys.com; Mapserver-users at lists.gis.umn.edu
Subject: Re: [Mapserver-users] Using the shapefile FID in a query

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
 


_______________________________________________
Mapserver-users mailing list
Mapserver-users at lists.gis.umn.edu
http://lists.gis.umn.edu/mailman/listinfo/mapserver-users




More information about the MapServer-users mailing list