[Mapserver-users] How to query the contents of a shapefile field and return the val ue

Manuel Alonso manuel.alonso at ermapper.co.uk
Fri Jun 18 09:04:27 EDT 2004


Good afternoon:

Sorry if this question is very basic, I have just started to use MapServer,
and I have not found an answer to this in the FAQs.

I have a simple polygon shapefile with only one attribute field in its
table. That attribute is the name of the polygon (for instance, the name of
a State or Province). I need to build a small application that displays the
map (state boundaries) and then queries that shapefile and returns the
content of that field (to be used to search a database). I do not want to
create a map of the result of my query, I am only interested in getting the
value of the shapefile field.

For instance, once a map of the US has been displayed on the screen (with
the state boundaries), the user should click on any of the States displayed
and get the name of the state. That name will be stored into a variable to
be used later in the application.

I have been able to create the display of the the polygons in a browser
using MapServer, but I don't know the correct syntax to query the shapefile
table and to get the contents of a certain field.

Any help will be appreciated. 

Thanks very much in advance,

Manuel Alonso



More information about the mapserver-users mailing list