Greetings,
I am evaluating using geotools-->geoserver to provide feature editing in a
Java client, and have installed the latest geotools, geoserver, tomcat on
Linux.
I am having a problem using filters, and was wondering if someone could get
me back on track.
I have successfully rendered maps using bbox requests on a county layer, but
when trying to make a WFS request with a geotools filter, it is throwing the
exception below.
Thanks for any assistance,
Drew.
===================== GOOD BBOX REQUEST =========================
SERVICE=WFS&VERSION=1.0.0&REQUEST=GetFeature&TYPENAME=county&BBOX=-89.90085,
30.20774,-89.742344,30.299211
===================== BAD LOGICAL FILTER REQUEST =================
SERVICE=WFS&VERSION=1.0.0&REQUEST=GetFeature&TYPENAME=county&FILTER=<Filter
xmlns="http://www.opengis.net/ogc"
xmlns:gml="http://www.opengis.net/gml"><Intersects><PropertyName>the\_geom</P
ropertyName><gml:Polygon><gml:outerBoundaryIs><gml:LinearRing><gml:coordinat
es decimal="." cs="," ts="
">-89.90085,30.20774 -89.90085,30.299211 -89.742344,30.299211 -89.742344,30.
20774 -89.90085,30.20774</gml:coordinates></gml:LinearRing></gml:outerBounda
ryIs></gml:Polygon></Intersects></Filter>
===================== CLIP FROM JAVA ==============================
FilterFactory ff = FilterFactory.createFilterFactory();
BBoxExpression bboxExpr =
ff.createBBoxExpression(new
Envelope(-89.90085,-89.742344,30.20774,30.299211));
AttributeExpression geomExpr =
ff.createAttributeExpression(ft, ft.getDefaultGeometry().getName());
GeometryFilter bbox_filter =
ff.createGeometryFilter(FilterType.GEOMETRY_BBOX);
bbox_filter.addLeftGeometry(geomExpr);
bbox_filter.addRightGeometry(bboxExpr);
GeometryFilter intersect_filter =
ff.createGeometryFilter(FilterType.GEOMETRY_INTERSECTS);
intersect_filter.addLeftGeometry(geomExpr);
intersect_filter.addRightGeometry(bboxExpr);
LogicFilter logic_filter =
ff.createLogicFilter(bbox_filter,intersect_filter,FilterType.LOGIC_AND);
// BBOX FILTER WORKS
FeatureCollection fc = source.getFeatures(bbox_filter).collection();
// LOGIC FILTER THROWS EXCEPTION ON GEOSERVER
FeatureCollection fc = source.getFeatures(logic_filter).collection();
=============== CUT FROM GEOSERVER LOG =============================
57248540 [FINE] org.vfny.geoserver.servlets.AbstractService - reading
request:
SERVICE=WFS&VERSION=1.0.0&REQUEST=GetFeature&TYPENAME=county%26FILTER%3D%3CF
ilter+xmlns%3D%22http%3A%2F%2Fwww.opengis.net%2Fogc%22+xmlns%3Agml%3D%22http
%3A%2F%2Fwww.opengis.net%2Fgml%22%3E%3CIntersects%3E%3CPropertyName%3Ethe_ge
om%3C%2FPropertyName%3E%0A%3Cgml%3APolygon%3E%3Cgml%3AouterBoundaryIs%3E%3Cg
ml%3ALinearRing%3E%3Cgml%3Acoordinates+decimal%3D%22.%22+cs%3D%22%2C%22+ts%3
D%22+%22%3E-89.90085%2C30.20774+-89.90085%2C30.299211+-89.742344%2C30.299211
+-89.742344%2C30.20774+-89.90085%2C30.20774%3C%2Fgml%3Acoordinates%3E%0A%3C%
2Fgml%3ALinearRing%3E%0A%3C%2Fgml%3AouterBoundaryIs%3E%0A%3C%2Fgml%3APolygon
%3E%0A%3C%2FIntersects%3E%0A%3C%2FFilter%3E%0A
57248541 [INFO] org.vfny.geoserver.servlets.AbstractService - handling
request:
Request: null
output format:GML2
max features:2147483647
version:1.0.0
queries:
Query
feature type: county&FILTER=<Filter xmlns="http://www.opengis.net/ogc"
xmlns:gml="http://www.opengis.net/gml"><Intersects><PropertyName>the\_geom</P
ropertyName>
<gml:Polygon><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates
decimal="." cs="
[properties: ALL ]
Query
feature type: " ts=" ">-89.90085
[properties: ALL ]
Query
feature type: 30.20774 -89.90085
[properties: ALL ]
Query
feature type: 30.299211 -89.742344
[properties: ALL ]
Query
feature type: 30.299211 -89.742344
[properties: ALL ]
Query
feature type: 30.20774 -89.90085
[properties: ALL ]
Query
feature type: 30.20774</gml:coordinates>
</gml:LinearRing>
</gml:outerBoundaryIs>
</gml:Polygon>
</Intersects>
</Filter>
[properties: ALL ]
57248541 [FINE] org.vfny.geoserver.servlets.AbstractService - strategy is:
org.vfny.geoserver.servlets.FileStrategy@anonymised.com
57248542 [FINE] org.vfny.geoserver.global.Data - getting type
county&FILTER=<Filter xmlns="http://www.opengis.net/ogc"
xmlns:gml="http://www.opengis.net/gml"><Intersects><PropertyName>the\_geom</P
ropertyName>
<gml:Polygon><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates
decimal="." cs="
57248544 [WARNING] org.vfny.geoserver.servlets.AbstractService - service
exception while executing request:
Request: null
output format:GML2
max features:2147483647
version:1.0.0
queries:
Query
feature type: county&FILTER=<Filter xmlns="http://www.opengis.net/ogc"
xmlns:gml="http://www.opengis.net/gml"><Intersects><PropertyName>the\_geom</P
ropertyName>
<gml:Polygon><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates
decimal="." cs="
[properties: ALL ]
Query
feature type: " ts=" ">-89.90085
[properties: ALL ]
Query
feature type: 30.20774 -89.90085
[properties: ALL ]
Query
feature type: 30.299211 -89.742344
[properties: ALL ]
Query
feature type: 30.299211 -89.742344
[properties: ALL ]
Query
feature type: 30.20774 -89.90085
[properties: ALL ]
Query
feature type: 30.20774</gml:coordinates>
</gml:LinearRing>
</gml:outerBoundaryIs>
</gml:Polygon>
</Intersects>
</Filter>
[properties: ALL ]
cause: java.util.NoSuchElementException: Could not locate FeatureTypeConfig
'county&FILTER=<Filter xmlns="http://www.opengis.net/ogc"
xmlns:gml="http://www.opengis.net/gml"><Intersects><PropertyName>the\_geom</P
ropertyName>
<gml:Polygon><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates
decimal="." cs="'
57248545 [WARNING] org.vfny.geoserver.ServiceException - encountered error:
java.util.NoSuchElementException: Could not locate FeatureTypeConfig
'county&FILTER=<Filter xmlns="http://www.opengis.net/ogc"
xmlns:gml="http://www.opengis.net/gml"><Intersects><PropertyName>the\_geom</P
ropertyName>
<gml:Polygon><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates
decimal="." cs="'
StackTrace: java.util.NoSuchElementException: Could not locate
FeatureTypeConfig 'county&FILTER=<Filter xmlns="http://www.opengis.net/ogc"
xmlns:gml="http://www.opengis.net/gml"><Intersects><PropertyName>the\_geom</P
ropertyName>
<gml:Polygon><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates
decimal="." cs="'
at org.vfny.geoserver.global.Data.getFeatureTypeInfo(Data.java:857)
at
org.vfny.geoserver.responses.wfs.FeatureResponse.execute(FeatureResponse.jav
a:233)
at
org.vfny.geoserver.responses.wfs.FeatureResponse.execute(FeatureResponse.jav
a:142)
at
org.vfny.geoserver.servlets.AbstractService.doService(AbstractService.java:3
62)
at
org.vfny.geoserver.servlets.AbstractService.doGet(AbstractService.java:235)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application
FilterChain.java:237)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh
ain.java:157)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja
va:214)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.ja
va:178)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126
)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105
)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java
:107)
at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:825)
at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConne
ction(Http11Protocol.java:731)
at
org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.jav
a:526)
at
org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWo
rkerThread.java:80)
at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.jav
a:684)
at java.lang.Thread.run(Thread.java:595)