[mapserver-users] Combined spatial and attribute query

Bistrais, Bob Bob.Bistrais at maine.gov
Tue Feb 12 12:16:02 PST 2013


One other thing I should have mentioned was that I needed to work within MapScript and also couldn't readily do CGI requests.  I was able to work out a solution- I first set a filter on my selection layer, effectively performing the attribute query.  With that, I can then do the spatial query and get the result I'm looking for.

Many thanks to everyone for their input,
BB


From: Lime, Steve D (MNIT) [mailto:Steve.Lime at state.mn.us]
Sent: Friday, February 08, 2013 12:00 PM
To: Bistrais, Bob; mapserver-users at lists.osgeo.org
Subject: RE: Combined spatial and attribute query

Look at mode=itemfeaturequery (I think that's it) and related modes. The stock CGI app supports 2-stage queries like this. So, for instance you can select a county by name or id and then use that geometry to select all hospitals.

Steve
________________________________
From: Bistrais, Bob [Bob.Bistrais at maine.gov]
Sent: Friday, February 08, 2013 10:09 AM
To: Lime, Steve D (MNIT); mapserver-users at lists.osgeo.org<mailto:mapserver-users at lists.osgeo.org>
Subject: RE: Combined spatial and attribute query
Interesting thought.  Bbox won't quite do it- the spatial select would be based on, for instance, a selected county or town, or a user-defined polygon.

From: Lime, Steve D (MNIT) [mailto:Steve.Lime at state.mn.us]
Sent: Friday, February 08, 2013 11:05 AM
To: Bistrais, Bob; mapserver-users at lists.osgeo.org<mailto:mapserver-users at lists.osgeo.org>
Subject: RE: Combined spatial and attribute query

Is your spatial query just a bbox? If so then just set that as your map extent as part of doing your attribute query (attributes always do both). There are other options too, let us know more what your spatial query is.

Steve
________________________________
From: mapserver-users-bounces at lists.osgeo.org<mailto:mapserver-users-bounces at lists.osgeo.org> [mapserver-users-bounces at lists.osgeo.org] on behalf of Bistrais, Bob [Bob.Bistrais at maine.gov]
Sent: Friday, February 08, 2013 10:01 AM
To: mapserver-users at lists.osgeo.org<mailto:mapserver-users at lists.osgeo.org>
Subject: [mapserver-users] Combined spatial and attribute query
Does anyone have advice on the best or most efficient way to query data, involving both a spatial and an attribute query.  I need to query several layers, selecting based on an area, then select from that selection based on an attribute value.  It would be OK to query by the attribute first, then spatial.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20130212/28fb8e4b/attachment.htm>


More information about the MapServer-users mailing list