[postgis-devel] Fixed precision for ST_Intersection, ST_Union, etc.

Sandro Santilli strk at keybit.net
Tue Mar 15 10:19:33 PDT 2016


On Tue, Mar 15, 2016 at 09:24:41AM -0400, Daniel Baston wrote:
> The relevant code is in GeometryPrecisionReducer.cpp, around line 72.  It
> can be paraphrased as:
> 
> geom_reduced = reduce_coordinate_precision(geom)
> if (!geom_reduced.isValid())
>    geom_reduced = geom_reduced.buffer(0)
> return geom_reduced

Ouch, that's really bad indeed.

> The only change I can see making to GEOS is in the C API, renaming the
> existing GEOSGeom_setPrecision to GEOSGeom_reducePrecision, and adding a
> new GEOSGeom_setPrecision that does nothing more than set the
> PrecisionModel.  The PostGIS overlays could then use the new
> GEOSGeom_setPrecision, while a PostGIS ST_ReducePrecision could use
> GEOSGeom_reducePrecision.

Sounds good to me, 3.6.0 isn't out yet so changing the signature
is still possible.

--strk;



More information about the postgis-devel mailing list