I am having trouble using 'Intersect' filter on a WFS GetFeature query. Every query I make seems to return all features available in the queried layer (and not just the features intersecting the polygon I specify).
I used the
topp:states layer from the publicly accessible demo Geoserver.
The POST request I made to the above server was:
<wfs:GetFeature xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.opengis.net/wfs" xmlns:gml="http://www.opengis.net/gml" xmlns:wfs="http://www.opengis.net/wfs" xmlns:ogc="http://www.opengis.net/ogc" service="WFS" version="1.0.0"> <wfs:Query typeName="topp:states"> <ogc:Filter> <ogc:Intersect> <ogc:PropertyName>the_geom</ogc:PropertyName> <gml:Polygon srsName="http://www.opengis.net/gml/srs/epsg.xml#4326"><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>-106.86953585585587,42.627785135135127 -107.47663975975976,38.803030540540533 -105.29106570570572,35.342538288288281 -99.280737057057067,36.01035258258257 -98.4307915915916,41.413577327327317 -106.86953585585587,42.627785135135127</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon> </ogc:Intersect> </ogc:Filter> </wfs:Query> </wfs:GetFeature>
This is how the intersector polygon (in green) looks like in relation to the states:
As would be expected from the above diagram, I am hoping that the intersect query would return 7 states. Instead, what I get in the WFS response is all of the 50 states.
Am I doing something wrong in the WFS query?
I have already made sure that the polygon I used to intersect against is in the same SRS as the layer (EPSG 4326).