I am using the Geometry Function Filter for the styles used for rendering FeatureTypes of type Geometry because I want polygons to be rendered as polygons and lines as lines and so on.

The problem I'm encountering is that when streaming renderer is making the request to the Datastore it sends those filters as well... In the case of WFS the WFS encodes the filters as xml (See request attachment). At a glance the request looks ok but geoserver throws an exception, I assume it can't handle the functional expression.

{\rtf1\mac\ansicpg10000\cocoartf824\cocoasubrtf350
{\fonttbl\f0\fswiss\fcharset77 Helvetica;}
{\colortbl;\red255\green255\blue255;}
\margl1440\margr1440\vieww9000\viewh8400\viewkind0
\pard\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\ql\qnatural\pardirnatural

\f0\fs24 \cf0 \
------------XML POST END-----------\
115549 [INFO] org.vfny.geoserver.servlets.AbstractService - Had an undefined error: null\
115551 [FINE] org.vfny.geoserver.ServiceException - java.lang.NullPointerException\
115554 [WARNING] org.vfny.geoserver.ServiceException - encountered error: java.lang.NullPointerException\
StackTrace: java.lang.NullPointerException\
        at org.geotools.filter.ExpressionSAXParser.end(ExpressionSAXParser.java:205)\
        at org.geotools.filter.ExpressionSAXParser.end(ExpressionSAXParser.java:162)\
        at org.geotools.filter.FilterFilter.endElement(FilterFilter.java:314)\
        at org.geotools.gml.GMLFilterGeometry.endElement(GMLFilterGeometry.java:203)\
        at org.geotools.gml.GMLFilterDocument.endElement(GMLFilterDocument.java:286)\
        at org.xml.sax.helpers.ParserAdapter.endElement(ParserAdapter.java:626)\
        at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source)\
        at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanEndElement(Unknown Source)\
        at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)\
        at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)\
        at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)\
        at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown Source)\
        at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)\
        at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)\
        at org.xml.sax.helpers.ParserAdapter.parse(ParserAdapter.java:405)\
        at org.vfny.geoserver.wfs.requests.readers.GetFeatureXmlReader.read(GetFeatureXmlReader.java:72)\
        at org.vfny.geoserver.servlets.AbstractService.doPost(AbstractService.java:375)\
        at org.vfny.geoserver.wfs.servlets.WfsDispatcher.doResponse(WfsDispatcher.java:286)\
        at org.vfny.geoserver.wfs.servlets.WfsDispatcher.doPost(WfsDispatcher.java:175)\
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)\
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)\
        at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:358)\
        at org.mortbay.jetty.servlet.WebApplicationHandler$Chain.doFilter(WebApplicationHandler.java:342)\
        at org.vfny.geoserver.filters.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:122)\
        at org.mortbay.jetty.servlet.WebApplicationHandler$Chain.doFilter(WebApplicationHandler.java:334)\
        at org.mortbay.jetty.servlet.WebApplicationHandler.dispatch(WebApplicationHandler.java:286)\
        at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:567)\
        at org.mortbay.http.HttpContext.handle(HttpContext.java:1807)\
        at org.mortbay.jetty.servlet.WebApplicationContext.handle(WebApplicationContext.java:525)\
        at org.mortbay.http.HttpContext.handle(HttpContext.java:1757)\
        at org.mortbay.http.HttpServer.service(HttpServer.java:879)\
        at org.mortbay.http.HttpConnection.service(HttpConnection.java:790)\
        at org.mortbay.http.HttpConnection.handleNext(HttpConnection.java:961)\
        at org.mortbay.http.HttpConnection.handle(HttpConnection.java:807)\
        at org.mortbay.http.SocketListener.handleConnection(SocketListener.java:197)\
        at org.mortbay.util.ThreadedServer.handle(ThreadedServer.java:276)\
        at org.mortbay.util.ThreadPool$PoolThread.run(ThreadPool.java:511)\
\
115558 [FINE] org.vfny.geoserver.ServiceException - return wfs exception is <?xml version="1.0" ?>\
<ServiceExceptionReport\
   version="1.2.0"\
   xmlns="http://www.opengis.net/ogc"\
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"\
   xsi:schemaLocation="http://www.opengis.net/ogc http://localhost:8080/geoserver/schemas//wfs/1.0.0/OGC-exception.xsd";>\
   <ServiceException>\
      java.lang.NullPointerException   </ServiceException>\
</ServiceExceptionReport>\
org.vfny.geoserver.wfs.WfsException: java.lang.NullPointerException\
        at org.vfny.geoserver.wfs.WfsExceptionHandler.newServiceException(WfsExceptionHandler.java:65)\
        at org.vfny.geoserver.servlets.AbstractService.sendError(AbstractService.java:749)\
        at org.vfny.geoserver.servlets.AbstractService.doPost(AbstractService.java:382)\
        at org.vfny.geoserver.wfs.servlets.WfsDispatcher.doResponse(WfsDispatcher.java:286)\
        at org.vfny.geoserver.wfs.servlets.WfsDispatcher.doPost(WfsDispatcher.java:175)\
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)\
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)\
        at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:358)\
        at org.mortbay.jetty.servlet.WebApplicationHandler$Chain.doFilter(WebApplicationHandler.java:342)\
        at org.vfny.geoserver.filters.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:122)\
        at org.mortbay.jetty.servlet.WebApplicationHandler$Chain.doFilter(WebApplicationHandler.java:334)\
        at org.mortbay.jetty.servlet.WebApplicationHandler.dispatch(WebApplicationHandler.java:286)\
        at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:567)\
        at org.mortbay.http.HttpContext.handle(HttpContext.java:1807)\
        at org.mortbay.jetty.servlet.WebApplicationContext.handle(WebApplicationContext.java:525)\
        at org.mortbay.http.HttpContext.handle(HttpContext.java:1757)\
        at org.mortbay.http.HttpServer.service(HttpServer.java:879)\
        at org.mortbay.http.HttpConnection.service(HttpConnection.java:790)\
        at org.mortbay.http.HttpConnection.handleNext(HttpConnection.java:961)\
        at org.mortbay.http.HttpConnection.handle(HttpConnection.java:807)\
        at org.mortbay.http.SocketListener.handleConnection(SocketListener.java:197)\
        at org.mortbay.util.ThreadedServer.handle(ThreadedServer.java:276)\
        at org.mortbay.util.ThreadPool$PoolThread.run(ThreadPool.java:511)\
Caused by: java.lang.NullPointerException\
        at org.geotools.filter.ExpressionSAXParser.end(ExpressionSAXParser.java:205)\
        at org.geotools.filter.ExpressionSAXParser.end(ExpressionSAXParser.java:162)\
        at org.geotools.filter.FilterFilter.endElement(FilterFilter.java:314)\
        at org.geotools.gml.GMLFilterGeometry.endElement(GMLFilterGeometry.java:203)\
        at org.geotools.gml.GMLFilterDocument.endElement(GMLFilterDocument.java:286)\
        at org.xml.sax.helpers.ParserAdapter.endElement(ParserAdapter.java:626)\
        at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source)\
        at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanEndElement(Unknown Source)\
        at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)\
        at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)\
        at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)\
        at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown Source)\
        at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)\
        at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)\
        at org.xml.sax.helpers.ParserAdapter.parse(ParserAdapter.java:405)\
        at org.vfny.geoserver.wfs.requests.readers.GetFeatureXmlReader.read(GetFeatureXmlReader.java:72)\
        at org.vfny.geoserver.servlets.AbstractService.doPost(AbstractService.java:375)\
        ... 20 more\
}
{\rtf1\mac\ansicpg10000\cocoartf824\cocoasubrtf350
{\fonttbl\f0\fswiss\fcharset77 Helvetica;}
{\colortbl;\red255\green255\blue255;}
\margl1440\margr1440\vieww9000\viewh8400\viewkind0
\pard\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\ql\qnatural\pardirnatural

\f0\fs24 \cf0 <?xml version="1.0" encoding="UTF-8"?>\
<GetFeature xmlns="http://www.opengis.net/wfs"; xmlns:gml="http://www.opengis.net/gml"; xmlns:ogc="http://www.opengis.net/ogc"; version="1.0.0" service="WFS" outputFormat="GML2"><Query handle="liteRenderer" typeName="topp:bc_2m_border"><ogc:PropertyName>the_geom</ogc:PropertyName>\
<ogc:Filter><ogc:And><ogc:Intersects><ogc:PropertyName>the_geom</ogc:PropertyName>\
<gml:Polygon><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates decimal="." cs="," ts=" ">-131.2635599006688,54.32918719859952 -131.2635599006688,54.68727779419495 -130.67376362557044,54.68727779419495 -130.67376362557044,54.32918719859952 -131.2635599006688,54.32918719859952</gml:coordinates>\
</gml:LinearRing>\
</gml:outerBoundaryIs>\
</gml:Polygon>\
</ogc:Intersects>\
<ogc:And><ogc:BBOX><ogc:PropertyName>the_geom</ogc:PropertyName>\
<gml:Box><gml:coordinates decimal="." cs="," ts=" ">-139.05729639304,48.2975677529953 -114.054147159406,60.0027160486083</gml:coordinates>\
</gml:Box>\
</ogc:BBOX>\
<ogc:Or><ogc:Or><ogc:Or><ogc:Or><ogc:Or><ogc:Or><ogc:Or><ogc:PropertyIsEqualTo><ogc:Function name="geometryType"><ogc:PropertyName>the_geom</ogc:PropertyName>\
</ogc:Function>\
<ogc:Literal>Point</ogc:Literal>\
</ogc:PropertyIsEqualTo>\
<ogc:PropertyIsEqualTo><ogc:Function name="geometryType"><ogc:PropertyName>the_geom</ogc:PropertyName>\
</ogc:Function>\
<ogc:Literal>Point</ogc:Literal>\
</ogc:PropertyIsEqualTo>\
</ogc:Or>\
<ogc:PropertyIsEqualTo><ogc:Function name="geometryType"><ogc:PropertyName>the_geom</ogc:PropertyName>\
</ogc:Function>\
<ogc:Literal>MultiPoint</ogc:Literal>\
</ogc:PropertyIsEqualTo>\
</ogc:Or>\
<ogc:PropertyIsEqualTo><ogc:Function name="geometryType"><ogc:PropertyName>the_geom</ogc:PropertyName>\
</ogc:Function>\
<ogc:Literal>LineString</ogc:Literal>\
</ogc:PropertyIsEqualTo>\
</ogc:Or>\
<ogc:PropertyIsEqualTo><ogc:Function name="geometryType"><ogc:PropertyName>the_geom</ogc:PropertyName>\
</ogc:Function>\
<ogc:Literal>LinearRing</ogc:Literal>\
</ogc:PropertyIsEqualTo>\
</ogc:Or>\
<ogc:PropertyIsEqualTo><ogc:Function name="geometryType"><ogc:PropertyName>the_geom</ogc:PropertyName>\
</ogc:Function>\
<ogc:Literal>MultiLineString</ogc:Literal>\
</ogc:PropertyIsEqualTo>\
</ogc:Or>\
<ogc:PropertyIsEqualTo><ogc:Function name="geometryType"><ogc:PropertyName>the_geom</ogc:PropertyName>\
</ogc:Function>\
<ogc:Literal>Polygon</ogc:Literal>\
</ogc:PropertyIsEqualTo>\
</ogc:Or>\
<ogc:PropertyIsEqualTo><ogc:Function name="geometryType"><ogc:PropertyName>the_geom</ogc:PropertyName>\
</ogc:Function>\
<ogc:Literal>MultiPolygon</ogc:Literal>\
</ogc:PropertyIsEqualTo>\
</ogc:Or>\
</ogc:And>\
</ogc:And>\
</ogc:Filter>\
</Query>\
</GetFeature>\
}


Also Postgis throws exceptions. So basically the Functional filters are made useless by because all the datastores blow up when they are passed one of them.

What should be done?
1. We could make Streaming renderer not pass functional filters on to the datastore. (this would be a stop gap so things will start working again) 2. We could visit each datastore and make sure that each one will either ignore the filters and process them on the client side.

Jesse

Reply via email to