GetFeature and Filters

Description

I've tried this:
>
> http://localhost:8080/geoserver/wfs?SERVICE=WFS&VERSION=1.0.0&REQUEST=GetFeature&OUTPUTFORMAT=GML2&TYPENAME=fire:fire&FILTER= - http://localhost:8080/geoserver/wfs?SERVICE=WFS&VERSION=1.0.0&REQUEST=GetFeature&OUTPUTFORMAT=GML2&TYPENAME=fire:fire&FILTER=<ogc:Filter%20xmlns:wfs="http://www.opengis.net/wfs"%20xmlns:ogc="http://www.opengis.net/ogc"%20xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"%20xsi:schemaLocation="http://www.opengis.net/wfs%20../wfs/1.0.0/WFS-basic.xsd"><ogcropertyIsBetween><ogcropertyName>fire:COUNTY</ogcropertyName><ogc:LowerBoundary><ogc:Literal>Tulsa</ogc:Literal></ogc:LowerBoundary><ogc:UpperBoundary><ogc:Literal>Tulsa</ogc:Literal></ogc:UpperBoundary></ogcropertyIsBetween></ogc:Filter>
>
> but I've got an exception response.
>
> <?xml version="1.0" ?>
&gt; - &lt;#&gt; &lt;ServiceExceptionReport version="<b>1.2.0</b>"
&gt; xmlns="http://www.opengis.net/ogc* - http://www.opengis.net/ogc"
&gt; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance* - http://www.w3.org/2001/XMLSchema-instance"
&gt; xsi:schemaLocation="*http://www.opengis.net/ogc - http://www.opengis.net/ogc
&gt; http://localhost:8080/geoserver/data/capabilities/wfs/1.0.0/OGC-exception.xsd* - http://localhost:8080/geoserver/data/capabilities/wfs/1.0.0/OGC-exception.xsd*"&gt;
&gt; &lt;ServiceException&gt;UNCAUGHT EXCEPTION: java.lang.ClassCastException at
&gt; org.geotools.filter.BetweenFilterImpl.contains(BetweenFilterImpl.java:83)
&gt; at
&gt; org.geotools.data.FilteringFeatureReader.hasNext(FilteringFeatureReader.java:119)
&gt; at
&gt; org.geotools.data.ReTypeFeatureReader.hasNext(ReTypeFeatureReader.java:127)
&gt; at
&gt; org.geotools.data.DefaultFeatureResults.getCount(DefaultFeatureResults.java:207)
&gt; at
&gt; org.vfny.geoserver.responses.wfs.FeatureResponse.execute(FeatureResponse.java:299)
&gt; at
&gt; org.vfny.geoserver.responses.wfs.FeatureResponse.execute(FeatureResponse.java:193)
&gt; at
&gt; org.vfny.geoserver.servlets.AbstractService.doService(AbstractService.java:280)
&gt; at
&gt; org.vfny.geoserver.servlets.AbstractService.doGet(AbstractService.java:195)
&gt; at javax.servlet.http.HttpServlet.service(HttpServlet.java:743) at
&gt; javax.servlet.http.HttpServlet.service(HttpServlet.java:856) at
&gt; org.vfny.geoserver.servlets.wfs.WfsDispatcher.doResponse(WfsDispatcher.java:159)
&gt; at
&gt; org.vfny.geoserver.servlets.wfs.WfsDispatcher.doGet(WfsDispatcher.java:112)
&gt; at javax.servlet.http.HttpServlet.service(HttpServlet.java:743) at
&gt; javax.servlet.http.HttpServlet.service(HttpServlet.java:856) at
&gt; org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:284)
&gt; at
&gt; org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:204)
&gt; at
&gt; org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:257)
&gt; at
&gt; org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:151)
&gt; at
&gt; org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:567)
&gt; at
&gt; org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:245)
&gt; at
&gt; org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:199)
&gt; at
&gt; org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:151)
&gt; at
&gt; org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:567)
&gt; at
&gt; org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:184)
&gt; at
&gt; org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:151)
&gt; at
&gt; org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:164)
&gt; at
&gt; org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:149)
&gt; at
&gt; org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:567)
&gt; at
&gt; org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:156)
&gt; at
&gt; org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:151)
&gt; at
&gt; org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:567)
&gt; at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:972)
&gt; at
&gt; org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:206)
&gt; at
&gt; org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:833)
&gt; at
&gt; org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:732)
&gt; at
&gt; org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:619)
&gt; at
&gt; org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:688)
&gt; at java.lang.Thread.run(Unknown Source)&lt;/ServiceException&gt;
&gt; &lt;/ServiceExceptionReport&gt;
&gt;
&gt;
&gt; Then I've tried the same but using a post:
&gt;
&gt; &lt;wfs:GetFeature
&gt; version="1.0.0" service="WFS" outputFormat="GML2"
&gt; xmlns:wfs="http://www.opengis.net/wfs"
&gt; xmlns:ogc="http://www.opengis.net/ogc"
&gt; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
&gt; xsi:schemaLocation="http://www.opengis.net/wfs ../wfs/1.0.0/WFS-basic.xsd"&gt;
&gt; &lt;wfs:Query typeName="fire:fire"&gt;
&gt; &lt;ogcropertyIsBetween&gt;
&gt; &lt;ogcropertyName&gt;fire:COUNTY&lt;/ogcropertyName&gt;
&gt; &lt;ogc:LowerBoundary&gt;&lt;ogc:Literal&gt;Tulsa&lt;/ogc:Literal&gt;&lt;/ogc:LowerBoundary&gt;
&gt; &lt;ogc:UpperBoundary&gt;&lt;ogc:Literal&gt;Tulsa&lt;/ogc:Literal&gt;&lt;/ogc:UpperBoundary&gt;
&gt; &lt;/ogcropertyIsBetween&gt;
&gt; &lt;/wfs:Query&gt;
&gt; &lt;/wfs:GetFeature&gt;
&gt;
&gt; and I've got this:
&gt;
&gt; &lt;?xml version="1.0" encoding="UTF-8"?&gt;
&gt; &lt;wfs:FeatureCollection xmlns:wfs="http://www.opengis.net/wfs"
&gt; xmlns:fire="http://picasso.dlsi.uji.es/schemas/oklahoma/fire"
&gt; xmlns:gml="http://www.opengis.net/gml"
&gt; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
&gt; xsi:schemaLocation="http://picasso.dlsi.uji.es/schemas/oklahoma/fire
&gt; http://localhost:8080/geoserver/wfs/DescribeFeatureType?typeName=fire:fire - http://localhost:8080/geoserver/wfs/DescribeFeatureType?typeName=fire:fire
&gt; http://www.opengis.net/wfs - http://www.opengis.net/wfs
&gt; http://localhost:8080/geoserver/data/capabilities/wfs/1.0.0/WFS-basic.xsd - http://localhost:8080/geoserver/data/capabilities/wfs/1.0.0/WFS-basic.xsd"&gt;
&gt; &lt;gml:boundedBy&gt; &lt;gml:Box
&gt; srsName="http://www.opengis.net/gml/srs/epsg.xml#13869"&gt;
&gt; &lt;gml:coordinates decimal="." cs="," ts=" "&gt;0,0 0,-1 -1,-1
&gt; -1,0&lt;/gml:coordinates&gt; &lt;/gml:Box&gt; &lt;/gml:boundedBy&gt;
&gt; &lt;gml:featureMember&gt; &lt;fire:fire fid="fire.1"&gt;
&gt; &lt;fire:COUNTY&gt;Logan&lt;/fire:COUNTY&gt; &lt;/fire:fire&gt; &lt;/gml:featureMember&gt;
&gt; &lt;gml:featureMember&gt; &lt;fire:fire fid="fire.2"&gt;
&gt; &lt;fire:COUNTY&gt;Oklahoma&lt;/fire:COUNTY&gt; &lt;/fire:fire&gt;
&gt; &lt;/gml:featureMember&gt; &lt;gml:featureMember&gt; &lt;fire:fire
&gt; fid="fire.3"&gt; &lt;fire:COUNTY&gt;Grady&lt;/fire:COUNTY&gt; &lt;/fire:fire&gt;
&gt; &lt;/gml:featureMember&gt; &lt;gml:featureMember&gt; &lt;fire:fire
&gt; fid="fire.4"&gt; &lt;fire:COUNTY&gt;Cleveland&lt;/fire:COUNTY&gt; &lt;/fire:fire&gt;
&gt; &lt;/gml:featureMember&gt; &lt;gml:featureMember&gt; &lt;fire:fire
&gt; fid="fire.5"&gt; &lt;fire:COUNTY&gt;Oklahoma&lt;/fire:COUNTY&gt; &lt;/fire:fire&gt;
&gt; &lt;/gml:featureMember&gt; &lt;gml:featureMember&gt; &lt;fire:fire
&gt; fid="fire.6"&gt; &lt;fire:COUNTY&gt;Lincoln&lt;/fire:COUNTY&gt; &lt;/fire:fire&gt;
&gt; &lt;/gml:featureMember&gt; &lt;gml:featureMember&gt; &lt;fire:fire
&gt; fid="fire.7"&gt; &lt;fire:COUNTY&gt;Lincoln&lt;/fire:COUNTY&gt; &lt;/fire:fire&gt;
&gt; &lt;/gml:featureMember&gt; &lt;gml:featureMember&gt; &lt;fire:fire
&gt; fid="fire.8"&gt; &lt;fire:COUNTY&gt;Hughes&lt;/fire:COUNTY&gt; &lt;/fire:fire&gt;
&gt; &lt;/gml:featureMember&gt; &lt;gml:featureMember&gt; &lt;fire:fire
&gt; fid="fire.9"&gt; &lt;fire:COUNTY&gt;Tulsa&lt;/fire:COUNTY&gt; &lt;/fire:fire&gt;
&gt; &lt;/gml:featureMember&gt; &lt;gml:featureMember&gt; &lt;fire:fire
&gt; fid="fire.10"&gt; &lt;fire:COUNTY&gt;Wagoner&lt;/fire:COUNTY&gt; &lt;/fire:fire&gt;
&gt; &lt;/gml:featureMember&gt; &lt;gml:featureMember&gt; &lt;fire:fire
&gt; fid="fire.11"&gt; &lt;fire:COUNTY&gt;Wagoner&lt;/fire:COUNTY&gt; &lt;/fire:fire&gt;
&gt; &lt;/gml:featureMember&gt; &lt;gml:featureMember&gt; &lt;fire:fire
&gt; fid="fire.12"&gt; &lt;fire:COUNTY&gt;Muskogee&lt;/fire:COUNTY&gt; &lt;/fire:fire&gt;
&gt; &lt;/gml:featureMember&gt; &lt;gml:featureMember&gt; &lt;fire:fire
&gt; fid="fire.13"&gt; &lt;fire:COUNTY&gt;Sequoyah&lt;/fire:COUNTY&gt; &lt;/fire:fire&gt;
&gt; &lt;/gml:featureMember&gt; &lt;gml:featureMember&gt; &lt;fire:fire
&gt; fid="fire.14"&gt; &lt;fire:COUNTY&gt;Tulsa&lt;/fire:COUNTY&gt; &lt;/fire:fire&gt;
&gt; &lt;/gml:featureMember&gt; &lt;gml:featureMember&gt; &lt;fire:fire
&gt; fid="fire.15"&gt; &lt;fire:COUNTY&gt;Rogers&lt;/fire:COUNTY&gt; &lt;/fire:fire&gt;
&gt; &lt;/gml:featureMember&gt; &lt;gml:featureMember&gt; &lt;fire:fire
&gt; fid="fire.16"&gt; &lt;fire:COUNTY&gt;Rogers&lt;/fire:COUNTY&gt; &lt;/fire:fire&gt;
&gt; &lt;/gml:featureMember&gt; &lt;gml:featureMember&gt; &lt;fire:fire
&gt; fid="fire.17"&gt; &lt;fire:COUNTY&gt;Rogers&lt;/fire:COUNTY&gt; &lt;/fire:fire&gt;
&gt; &lt;/gml:featureMember&gt; &lt;gml:featureMember&gt; &lt;fire:fire
&gt; fid="fire.18"&gt; &lt;fire:COUNTY&gt;Rogers&lt;/fire:COUNTY&gt; &lt;/fire:fire&gt;
&gt; &lt;/gml:featureMember&gt; &lt;gml:featureMember&gt; &lt;fire:fire
&gt; fid="fire.19"&gt; &lt;fire:COUNTY&gt;Rogers&lt;/fire:COUNTY&gt; &lt;/fire:fire&gt;
&gt; &lt;/gml:featureMember&gt; &lt;gml:featureMember&gt; &lt;fire:fire
&gt; fid="fire.20"&gt; &lt;fire:COUNTY&gt;Canadian&lt;/fire:COUNTY&gt; &lt;/fire:fire&gt;
&gt; &lt;/gml:featureMember&gt; &lt;gml:featureMember&gt; &lt;fire:fire
&gt; fid="fire.21"&gt; &lt;fire:COUNTY&gt;Lincoln&lt;/fire:COUNTY&gt; &lt;/fire:fire&gt;
&gt; &lt;/gml:featureMember&gt; &lt;gml:featureMember&gt; &lt;fire:fire
&gt; fid="fire.22"&gt; &lt;fire:COUNTY&gt;Lincoln&lt;/fire:COUNTY&gt; &lt;/fire:fire&gt;
&gt; &lt;/gml:featureMember&gt;&lt;/wfs:FeatureCollection&gt;
&gt;
&gt; which I think it is wrong because I've made a request to get all
&gt; features that match with &lt;fire:COUNTY&gt;Tulsa&lt;/fire:COUNTY&gt; and I get all
&gt; the features from the database.

Environment

None

Activity

Show:
codehaus
April 10, 2015, 4:19 PM

CodeHaus Comment From: cholmes - Time: Sat, 6 Mar 2004 00:10:09 -0600
---------------------
<p>This fix needs to be done in geotools (shouldn't be too hard).</p>

codehaus
April 10, 2015, 4:19 PM

CodeHaus Comment From: cholmes - Time: Sat, 6 Mar 2004 00:10:50 -0600
---------------------
<p>This is for the post part, it's getting handled wrong.</p>

codehaus
April 10, 2015, 4:19 PM

CodeHaus Comment From: jmacgill - Time: Mon, 8 Mar 2004 12:30:00 -0600
---------------------
<p>Can you try using &lt;PropertyIsEqualTo&gt; instead as you are only after a single match.</p>

codehaus
April 10, 2015, 4:19 PM

CodeHaus Comment From: cholmes - Time: Sat, 13 Mar 2004 01:54:15 -0600
---------------------
<p>See the issues that this depends on. Basically the first part if fixed in geotools should roll in soon to geoserver. The second is a bad request, there is no Filter tags in it, so geoserver was just reading the propertyname element, and returning that propertyName.</p>

Assignee

Unassigned

Reporter

codehaus

Triage

None

Fix versions

Affects versions

Priority

Medium
Configure