Mapscript query
David Hober
dhober at GEOGRAPHIT.COM
Mon Jul 23 13:47:58 PDT 2007
Greetings,
In part of developing an application, I am trying to get it to perform a
query on a region, given certain constraints. I've spent some time
searching the MapServer forums and Google, and I still have not found an
answer...
I'm working with the C# mapscript library.
It works as follows:
A user sets up a filter for what they want returned in a search. Then
they determine the region over which to search (currently I have it only
searching over a point and a tolerance level defined). I pass the field
to be filtered to the layer's filteritem property, and call the layer's
setFilter method, and pass in the what it is the user wants to see. As
an example,
layerObj ms_layer = map.getLayerByName("county");
ms_layer.filteritem = "countyid"
ms_layer.setFilter("[countyid] = 67");
I then perform a queryByPoint query on the layer, which returns a
MS_FAILURE value. If I remove the call to ms_layer.filterItem, the
query succeeds, but the results are not filtered. I've tried a variety
of string combinations in the setFilter(...) method, including the
following:
[countyid] = 67
"[countyid] = 67"
[countyid] = "67"
( [countyid] = 67 )
[countyid] == 67
"[countyid] == 67"
... and so on and so forth.
Just as a reference point, here's my call to the query...
Ms_layer.queryByPoint(map, queryPoint, mapscript.MS_MULTIPLE,
tolerance);
I'll welcome any insights or theories on this matter.
Thanks!
-- Dave H
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20070723/61ad4d81/attachment.htm>
More information about the MapServer-users
mailing list