[Geoserver-devel] [jira] Created: (GEOS-2282) Delete with spatial filter (other than BBOX) fails with PostGIS

Delete with spatial filter (other than BBOX) fails with PostGIS
---------------------------------------------------------------

                 Key: GEOS-2282
                 URL: http://jira.codehaus.org/browse/GEOS-2282
             Project: GeoServer
          Issue Type: Task
          Components: WFS
            Reporter: Andrea Aime
            Assignee: Andrea Aime
            Priority: Critical
             Fix For: 1.7.1, 2.0-alpha1

The following wfs request:

{code:xml}
<?xml version="1.0" encoding="UTF-8"?>
<Transaction xmlns:topp="http://www.openplans.org/topp&quot; xmlns="http://www.opengis.net/wfs&quot; xmlns:gml="http://www.opengis.net/gml&quot; xmlns:ogc="http://www.opengis.net/ogc&quot; version="1.0.0" service="WFS" lockAction="ALL">
<Delete typeName="topp:comments"><ogc:Filter><ogc:Intersects><ogc:PropertyName>the_fake_geom</ogc:PropertyName>
<gml:Polygon><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates decimal="." cs="," ts=" ">-74.01701633932194,40.72971917356213 -74.01701633932194,40.73475271089661 -74.01227319837214,40.73475271089661 -74.01227319837214,40.72971917356213 -74.01701633932194,40.72971917356213</gml:coordinates>
</gml:LinearRing>
</gml:outerBoundaryIs>
</gml:Polygon>
</ogc:Intersects>
</ogc:Filter>
</Delete>
</Transaction>
{code}

causes the following exception to be thrown:

{code}
13 ott 11:37:46 ERROR [geoserver.wfs] - Transaction failed
org.geoserver.wfs.WFSTransactionException: error encoding sql from filter Filter type not supported
  at org.geoserver.wfs.DeleteElementHandler.execute(DeleteElementHandler.java:188)
  at org.geoserver.wfs.Transaction.execute(Transaction.java:333)
  at org.geoserver.wfs.Transaction.transaction(Transaction.java:108)
  at org.geoserver.wfs.DefaultWebFeatureService.transaction(DefaultWebFeatureService.java:157)
  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
  at java.lang.reflect.Method.invoke(Method.java:597)
  at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:310)
  at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
  at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
  at org.geoserver.ows.util.EMFLogger.invoke(EMFLogger.java:51)
  at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
  at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
  at $Proxy14.transaction(Unknown Source)
  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
  at java.lang.reflect.Method.invoke(Method.java:597)
  at org.geoserver.security.OperationSecurityInterceptor.invoke(OperationSecurityInterceptor.java:41)
  at org.geoserver.ows.Dispatcher.execute(Dispatcher.java:521)
  at org.geoserver.ows.Dispatcher.handleRequestInternal(Dispatcher.java:198)
  at org.springframework.web.servlet.mvc.AbstractController.handleRequest(AbstractController.java:153)
  at org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:48)
  at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:875)
  at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:809)
  at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:571)
  at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:511)
  at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
  at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
  at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:487)
  at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1093)
  at org.vfny.geoserver.filters.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:108)
  at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084)
  at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:264)
  at org.acegisecurity.intercept.web.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:107)
  at org.acegisecurity.intercept.web.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:72)
  at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274)
  at org.acegisecurity.ui.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:110)
  at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274)
  at org.acegisecurity.providers.anonymous.AnonymousProcessingFilter.doFilter(AnonymousProcessingFilter.java:125)
  at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274)
  at org.acegisecurity.ui.basicauth.BasicProcessingFilter.doFilter(BasicProcessingFilter.java:178)
  at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274)
  at org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter(HttpSessionContextIntegrationFilter.java:229)
  at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274)
  at org.acegisecurity.util.FilterChainProxy.doFilter(FilterChainProxy.java:148)
  at org.acegisecurity.util.FilterToBeanProxy.doFilter(FilterToBeanProxy.java:98)
  at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084)
  at org.geoserver.filters.LoggingFilter.doFilter(LoggingFilter.java:69)
  at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084)
  at org.geoserver.filters.ReverseProxyFilter.doFilter(ReverseProxyFilter.java:163)
  at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084)
  at org.geoserver.filters.GZIPFilter.doFilter(GZIPFilter.java:47)
  at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084)
  at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:360)
  at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
  at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)
  at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:726)
  at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:405)
  at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
  at org.mortbay.jetty.Server.handle(Server.java:324)
  at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:505)
  at org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:842)
  at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:648)
  at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:211)
  at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:380)
  at org.mortbay.jetty.bio.SocketConnector$Connection.run(SocketConnector.java:228)
  at org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedThreadPool.java:450)
Caused by: org.geotools.data.DataSourceException: error encoding sql from filter Filter type not supported
  at org.geotools.data.postgis.PostgisFeatureStore.modifyFeatures(PostgisFeatureStore.java:337)
  at org.geotools.data.postgis.PostgisFeatureStore.modifyFeatures(PostgisFeatureStore.java:407)
  at org.geotools.data.postgis.VersionedPostgisFeatureStore.removeFeatures(VersionedPostgisFeatureStore.java:155)
  at org.vfny.geoserver.global.GeoServerFeatureStore.removeFeatures(GeoServerFeatureStore.java:94)
  at org.geoserver.wfs.DeleteElementHandler.execute(DeleteElementHandler.java:176)
  ... 68 more
Caused by: org.geotools.filter.SQLEncoderException: Filter type not supported
  at org.geotools.filter.SQLEncoder.encode(SQLEncoder.java:241)
  at org.geotools.filter.SQLEncoder.encode(SQLEncoder.java:257)
  at org.geotools.data.postgis.PostgisFeatureStore.modifyFeatures(PostgisFeatureStore.java:303)
  ... 72 more
{code}

Note that versioning is not involved at all, debuggin shows that the PostgisFeatureStore
uses a custom sql encoder that does not enable GEOS support, and as such it does not
support Intersects filters (but does support BBOX ones).
This is very surprising... I guess CITE is not using DELETE with spatial filters other
than bbox?

--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira