Closed albertwgchu closed 5 years ago
Thank you for reporting this issue and taking the time to track down the cause. Definitely a bug.
It looks like "max number of decimals" refers to precision in GML output? Here it's the precision of the serialized geometry that's used when making queries, so it's a little different. How about instead we use the JTS PecisionModel for floats (e.g. 16)? It's what JTS uses when serializing to WKT so it seems reasonable here.
final PrecisionModel precisionModel = new PrecisionModel(PrecisionModel.FLOATING);
final int decimalPlaces = precisionModel.getMaximumSignificantDigits();
final String geoJson = new GeometryJSON(decimalPlaces).toString(currentGeometry);
That sounds great to me. We noticed this bug when making wfs requests at low zooms. Will it be included in the next release?
Yes we'll make sure to get this fixed in the next release. Thanks again for reporting.
This fix is included in the new release candidate 2.14.2-RC1.
Found an issue where geojson being sent to ElasticSearch is being rounded to 4 digits.
After taking a look at the code the issue is that GeometryJSON defaults to 4 decimal places if there's no value passed to the constructor.
This line is the issue:
FilterToElastic.java final String geoJson = new GeometryJSON().toString(currentGeometry);
// this will give 8 decimal places FilterToElastic.java final String geoJson = new GeometryJSON(8).toString(currentGeometry);
Geoserver has a setting for "Maximum number of decimals", does it make sense to use this value?