[mapserver-users] queryByLayer - is it a valid method on layerObj?
Lime, Steve D (MNIT)
Steve.Lime at state.mn.us
Tue Mar 24 10:22:30 PDT 2015
Hi Phil: Just getting back though email after being out on vacation. The queryByFilter method takes a native MapServer FILTER string and applies it against the layer. It does not process OGC filters, never has. The OGC filter handling code translates an OGC filter into MapServer filter string which is in turn processed by MapServer (and/or the associated driver). This is all much more straightforward in 7.0. I can try and whip up a quick example in Perl MapScript if that would help.
Seems like we could consider exposing an OGC filter -> MapServer filter string and then that would get handed off to queryByFilter. I think this would have to be a layer-specific method since that context is probably important in the translation.
Steve
From: mapserver-users-bounces at lists.osgeo.org [mailto:mapserver-users-bounces at lists.osgeo.org] On Behalf Of Anzel, Phil - NRCS, Fort Collins, CO
Sent: Monday, March 09, 2015 2:12 PM
To: mapserver-users at lists.osgeo.org
Cc: Anzel, Phil - NRCS, Fort Collins, CO
Subject: [mapserver-users] queryByLayer - is it a valid method on layerObj?
All,
The Mapscript SWIG interface on the layerObj defines a queryByFilter method as
public int queryByFilter(mapObj map, string arg1)
where arg1 is supposedly the filter to apply when querying the layer, analogous to
public int queryByRect(mapObj map, rectObj rect)
Where is this method documented? It is not described in either the 6.4 or 7.0 documentation. Based upon the history of the code that I'm attempting to bring back to life the method was probably documented in MapServer 4.x or 5.x. Note that is still visible through SWIG.
How should it be used? I tried it with a WFS OGC filter and the log file showed (ignore line wrapping here):
[Mon Mar 09 12:18:35 2015].727000 yyparse(): Expression parser error. syntax error
[Mon Mar 09 12:18:35 2015].727000 msEvalExpression: Expression parser error.
Failed to parse expression:
<Filter><Intersect><PropertyName>Geometry</PropertyName><gml:Polygon>
<gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>
-88.0865046533,37.5555143852 -88.0860204771,37.5600435404
-88.0782858287,37.5595392364 -88.0787704736,37.5550101113
-88.0865046533,37.5555143852
</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs>
</gml:Polygon></Intersect></Filter>
I tried with a much simpler mapfile filter and got much the same result:
[Mon Mar 09 12:53:22 2015].470000 yyparse(): Expression parser error. syntax error
[Mon Mar 09 12:53:22 2015].470000 msEvalExpression: Expression parser error.
Failed to parse expression: ([mukey] in (713970, 713898))
Do any of you have a working example of its use?
Is there a way to use the OGC filter directly within mapscript code? That is ultimately what I'm after.
Thanks.
- Phil Anzel
USDA/NRCS contractor - Team Vistronix
This electronic message contains information generated by the USDA solely for the intended recipients. Any unauthorized interception of this message or the use or disclosure of the information it contains may violate the law and subject the violator to civil or criminal penalties. If you believe you have received this message in error, please notify the sender and delete the email immediately.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20150324/25d2ca01/attachment.htm>
More information about the MapServer-users
mailing list