[mapserver-users] WFS GetFeature with filter for multiple layers

Arjen de Korte arjendk at gmx.net
Tue Jan 22 08:45:28 PST 2013


Hi all,

I'm having a problem with Mapserver 5.2.1 and WFS GetFeature requests:
when I do a GetFeature request with an OGC filter for more than one
layer, I only get results for the first layer. I found a description of
the issue here: https://github.com/mapserver/mapserver/issues/3584. It
says the issue can be worked around by listing a separate filter for
each layer, but I can't work out a way to do this.

My original request looks like this:

http://myserver.com/cgi-bin/mapserv.exe?map=mymapfile.map&Service=WFS&Request=GetFeature&TypeName=layer1,layer2&Version=1.0.0&Filter=<ogc:Filter
xmlns:ogc="http://www.opengis.net/ogc"><ogc:Intersects><ogc:PropertyName/><gml:Polygon
xmlns:gml="http://www.opengis.net/gml"><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates
decimal="." cs="," ts=" ">89760.045356755,436071.75388938
89762.029730683,436071.75388938 89762.029730683,436073.7382633
89760.045356755,436073.7382633
89760.045356755,436071.75388938</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></ogc:Intersects></ogc:Filter>

...returning only results for layer1.

I've tried repeating the exact same filter like:

http://myserver.com/cgi-bin/mapserv.exe?map=mymapfile.map&Service=WFS&Request=GetFeature&TypeName=layer1,
layer2&Version=1.0.0&Filter=<ogc:Filter
xmlns:ogc="http://www.opengis.net/ogc"><ogc:Intersects> ...
</ogc:Intersects><ogc:Intersects> ... </ogc:Intersects></ogc:Filter>

and

http://myserver.com/cgi-bin/mapserv.exe?map=mymapfile.map&Service=WFS&Request=GetFeature&TypeName=layer1,
layer2&Version=1.0.0&Filter=<ogc:Filter
xmlns:ogc="http://www.opengis.net/ogc"><ogc:Intersects> ...
</ogc:Intersects></ogc:Filter>,<ogc:Filter><ogc:Intersects> ...
</ogc:Intersects></ogc:Filter>

...but the first returns the same: only results for layer1, and the
second returns an error.

What is the correct way to list multiple filters, or is there another
solution to work around this limitation?

Thanks!

Kind regards,
Arjen.


More information about the mapserver-users mailing list