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.

Environment

None

Activity

Fixed

Details

Assignee

Reporter

Fix versions

Components

Priority

Created January 16, 2024 at 11:33 AM
Updated February 12, 2024 at 9:46 AM
Resolved February 12, 2024 at 9:46 AM