Hi, I’m having problems using spatial filter with a polygon. Example request below:
I’ve tried with various layers with different geometry type but getting the same error. Is this spatial filter type known to work?
The layers are in a PostGIS store (newest version of postgresql/postgis installed).
<wfs:GetFeature xmlns:xsi=“http://www.w3.org/2001/XMLSchema-instance”
xmlns:wfs=“http://www.opengis.net/wfs”
xmlns:ogc=“http://www.opengis.net/ogc”
service=“WFS”
version=“1.1.0”
xsi:schemaLocation=“http://www.opengis.net/wfs http://schemas.opengis.net/wfs/1.1.0/WFS-basic.xsd”>
<wfs:Query typeName=“sydvedbs:FAST_PKT_PDA”>
ogc:Filter
<ogc:Within xmlns:gml=“http://www.opengis.net/gml”>
gml:Polygon
gml:outerBoundaryIs
gml:LinearRing
gml:coordinates1250010,6399990 1399990,6399990 1399990,6250010 1250010,6250010 1250010,6399990 </gml:coordinates>
</gml:LinearRing>
</gml:outerBoundaryIs>
</gml:Polygon>
</ogc:Within>
</ogc:Filter>
</wfs:Query>
</wfs:GetFeature>
This causes a java.lang.NullPointerException
With trace:
at org.geotools.filter.visitor.DuplicatingFilterVisitor.visit(DuplicatingFilterVisitor.java:280)
at org.geotools.filter.spatial.WithinImpl.accept(WithinImpl.java:54)
at org.geoserver.wfs.WFSReprojectionUtil.applyDefaultCRS(WFSReprojectionUtil.java:78)
at org.geoserver.wfs.WFSReprojectionUtil.normalizeFilterCRS(WFSReprojectionUtil.java:105)
at org.geoserver.wfs.GetFeature.toDataQuery(GetFeature.java:400)
at org.geoserver.wfs.GetFeature.run(GetFeature.java:254)
at org.geoserver.wfs.DefaultWebFeatureService.getFeature(DefaultWebFeatureService.java:108)
at sun.reflect.GeneratedMethodAccessor126.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
The log report just above the exception is:
2008-05-16 18:07:58,582 TRACE [geotools.xml] - startElement(http://www.opengis.net/wfs,GetFeature,wfs:GetFeature
2008-05-16 18:07:58,582 DEBUG [geotools.xml] - returning cached schema for http://www.opengis.net/wfs
2008-05-16 18:07:58,582 DEBUG [geotools.xml] - schema specified by parser configuration not found, supplementing…
2008-05-16 18:07:58,582 DEBUG [geotools.xml] - returning cached schema for http://www.opengis.net/wfs
2008-05-16 18:07:58,582 TRACE [geotools.xml] - startElement(http://www.opengis.net/wfs,Query,wfs:Query
2008-05-16 18:07:58,598 TRACE [geotools.xml] - startElement(http://www.opengis.net/ogc,Filter,ogc:Filter
2008-05-16 18:07:58,598 TRACE [geotools.xml] - startElement(http://www.opengis.net/ogc,Within,ogc:Within
2008-05-16 18:07:58,598 TRACE [geotools.xml] - startElement(http://www.opengis.net/gml,Polygon,gml:Polygon
2008-05-16 18:07:58,598 TRACE [geotools.xml] - startElement(http://www.opengis.net/gml,outerBoundaryIs,gml:outerBoundaryIs
2008-05-16 18:07:58,598 TRACE [geotools.xml] - startElement(http://www.opengis.net/gml,LinearRing,gml:LinearRing
2008-05-16 18:07:58,598 TRACE [geotools.xml] - startElement(http://www.opengis.net/gml,coordinates,gml:coordinates
2008-05-16 18:07:58,598 DEBUG [data.postgis] - get Feature source called on FAST_PKT_PDA
2008-05-16 18:07:58,598 DEBUG [data.postgis] - returning pg feature locking
2008-05-16 18:07:58,598 WARN [geoserver.ows] -