Cannot retrieve LegendGraphic from a PostGIS datastore with 'hideEmptyRules' and 'Support on the fly geometry simplification' enabled
Description
If I create a GetLegendGraphic request with 'hideEmptyRules', org.geoserver.wms.legendgraphic.FeatureCountProcessor.FeatureRenderSpyFormat is used and 'generalizationDistance' is set to 0. Also, if I enable 'Support on the fly geometry simplification' on a PostGIS datastore, org.geotools.data.postgis.GeometryColumnEncoder.getTWKBDigits will be invoked with 0 as distance parameter. This function currently returns -7 instead of +7 due to the fact that -Integer.MIN_VALUE == Integer.MIN_VALUE in Java. This is a bug in GeoTools and results in moving all points in all features to (0,0), effectively excluding them from the BBOX.
I would like to contribute with a PR as it appears to be an easy fix.
If I create a GetLegendGraphic request with 'hideEmptyRules',
org.geoserver.wms.legendgraphic.FeatureCountProcessor.FeatureRenderSpyFormat
is used and 'generalizationDistance' is set to0
.Also, if I enable 'Support on the fly geometry simplification' on a PostGIS datastore,
org.geotools.data.postgis.GeometryColumnEncoder.getTWKBDigits
will be invoked with0
as distance parameter. This function currently returns-7
instead of+7
due to the fact that-Integer.MIN_VALUE == Integer.MIN_VALUE
in Java. This is a bug in GeoTools and results in moving all points in all features to(0,0)
, effectively excluding them from the BBOX.I would like to contribute with a PR as it appears to be an easy fix.