Looking at if (!(filter.getExpression1() instanceof PropertyName)) { throw new IllegalArgumentException( "Binary geometry filter, but first expression " + "is not a property name? (it's a " +* filter.getExpression1().getClass()* + ")"); }
The null pointer exception is from filter.getExpression1() return null. - The check should be changed to check for null - and indicate the first expression is missing So the error message is not helpful, but you did say you are missing a filter option 🙂 If you are comfortable making the change I encourage you to make a pull-request (it seems straightforward to provide a better error message). -- Jody Garnett On May 29, 2024 at 6:52:35 AM, i...@geonovation.nl wrote: > Hello , > > We noticed a problem with an ogc:filter getMap request. ( *GeoServer * > *2.24.2* ) > > It is only if you have a Within Filter without another extra filter option. > > So what is wrong: > > FILTER= > > <ogc:Filter xmlns:gml=http://www.opengis.net/gml xmlns:ogc= > http://www.opengis.net/ogc><ogc:Within><ogc:PropertyName>geom</ogc:PropertyName><gml:Polygon > srsName=http://www.opengis.net/def/crs/EPSG/0/28992><gml:exterior><gml:LinearRing><gml:posList>154852 > 464024 155048 463679 155303 463736 155082 464086 154852 > 464024</gml:posList></gml:LinearRing></gml:exterior></gml:Polygon></ogc:Within></ogc:Filter> > > > > > https://workshop.kaartviewer.nl/geoserver/wms?REQUEST=GetMap&SERVICE=WMS&VERSION=1.3.0&FORMAT=image%2Fpng&STYLES=&TRANSPARENT=true&LAYERS=geonovation%3Aenergielabels_amersfoort&&WIDTH=2133&HEIGHT=1103&CRS=EPSG%3A28992&BBOX=154103.54602300984%2C463421.92378041224%2C156015.80503340586%2C464410.9202373514&FILTER=%3Cogc:Filter%20xmlns:gml=%22http://www.opengis.net/gml%22%20xmlns:ogc=%22http://www.opengis.net/ogc%22%3E%3Cogc:Within%3E%3Cogc:PropertyName%3Egeom%3C/ogc:PropertyName%3E%3Cgml:Polygon%20srsName=%22http://www.opengis.net/def/crs/EPSG/0/28992%22%3E%3Cgml:exterior%3E%3Cgml:LinearRing%3E%3Cgml:posList%3E154852%20464024%20155048%20463679%20155303%20463736%20155082%20464086%20154852%20464024%3C/gml:posList%3E%3C/gml:LinearRing%3E%3C/gml:exterior%3E%3C/gml:Polygon%3E%3C/ogc:Within%3E%3C/ogc:Filter%3E > > > > *This url gives an error in geoserver ( Rendering process failed. Layers: > geonovation:energielabels_amersfoort -> Caused by: > java.lang.NullPointerException at > org.geotools.filter.spatial.ReprojectingFilterVisitor$GeometryFilterTransformer.transform(ReprojectingFilterVisitor.java:437)* > > > > > > *But when I have the following URL, with added on ogc:And and a random > extra filter ( in this case 0>=0), then it is working OK!* > > > > *Filter=* > > *<ogc:Filter xmlns:gml=http://www.opengis.net/gml > <http://www.opengis.net/gml> xmlns:ogc=http://www.opengis.net/ogc > <http://www.opengis.net/ogc>><ogc:And><ogc:Within><ogc:PropertyName>geom</ogc:PropertyName><gml:Polygon><gml:exterior><gml:LinearRing><gml:posList>154852.87672948933 > 464024.4568953283 155048.54203767146 463679.5184417369 155303.4218767874 > 463736.1500901585 155082.0111295965 464086.23693005764 154852.87672948933 > 464024.4568953283</gml:posList></gml:LinearRing></gml:exterior></gml:Polygon></ogc:Within><ogc:PropertyIsGreaterThanOrEqualTo><ogc:Literal>0</ogc:Literal><ogc:Literal>0</ogc:Literal></ogc:PropertyIsGreaterThanOrEqualTo></ogc:And></ogc:Filter>* > > > > > https://workshop.kaartviewer.nl/geoserver/wms?REQUEST=GetMap&SERVICE=WMS&VERSION=1.3.0&FORMAT=image%2Fpng&STYLES=&TRANSPARENT=true&LAYERS=geonovation%3Aenergielabels_amersfoort&&WIDTH=2133&HEIGHT=1103&CRS=EPSG%3A28992&BBOX=154103.54602300984%2C463421.92378041224%2C156015.80503340586%2C464410.9202373514&FILTER=%3Cogc:Filter%20xmlns:gml=%22http://www.opengis.net/gml%22%20xmlns:ogc=%22http://www.opengis.net/ogc%22%3E%3Cogc:And%3E%3Cogc:Within%3E%3Cogc:PropertyName%3Egeom%3C/ogc:PropertyName%3E%3Cgml:Polygon%3E%3Cgml:exterior%3E%3Cgml:LinearRing%3E%3Cgml:posList%3E154852.87672948933%20464024.4568953283%20155048.54203767146%20463679.5184417369%20155303.4218767874%20463736.1500901585%20155082.0111295965%20464086.23693005764%20154852.87672948933%20464024.4568953283%3C/gml:posList%3E%3C/gml:LinearRing%3E%3C/gml:exterior%3E%3C/gml:Polygon%3E%3C/ogc:Within%3E%3Cogc:PropertyIsGreaterThanOrEqualTo%3E%3Cogc:Literal%3E0%3C/ogc:Literal%3E%3Cogc:Literal%3E0%3C/ogc:Literal%3E%3C/ogc:PropertyIsGreaterThanOrEqualTo%3E%3C/ogc:And%3E%3C/ogc:Filter%3E > > > > What could be the problem here? > > > > Peter-Paul Koonings > > *GeoNovation B.V. * > > > > > _______________________________________________ > Geoserver-users mailing list > > Please make sure you read the following two resources before posting to > this list: > - Earning your support instead of buying it, but Ian Turton: > http://www.ianturton.com/talks/foss4g.html#/ > - The GeoServer user list posting guidelines: > http://geoserver.org/comm/userlist-guidelines.html > > If you want to request a feature or an improvement, also see this: > https://github.com/geoserver/geoserver/wiki/Successfully-requesting-and-integrating-new-features-and-improvements-in-GeoServer > > > Geoserver-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/geoserver-users >
_______________________________________________ Geoserver-users mailing list Please make sure you read the following two resources before posting to this list: - Earning your support instead of buying it, but Ian Turton: http://www.ianturton.com/talks/foss4g.html#/ - The GeoServer user list posting guidelines: http://geoserver.org/comm/userlist-guidelines.html If you want to request a feature or an improvement, also see this: https://github.com/geoserver/geoserver/wiki/Successfully-requesting-and-integrating-new-features-and-improvements-in-GeoServer Geoserver-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geoserver-users