Grid based intersection, what to expect ?

Sandro Santilli strk at kbt.io
Thu Apr 24 03:25:47 PDT 2025


On Mon, Apr 14, 2025 at 10:12:47AM -0700, Martin Davis wrote:
> Also, the input values have not been rounded to the requested precision.
> In general this should be done to use the overlay precision ops correctly.
> (The data will be rounded internally, but the results may not match what
> might be expected from the original inputs).

Ouch, it looks like we have a bug in PostGIS, as I'm pretty sure the
grid-size taking intersection functions should have done this
internally, instead:;

  =# select ST_AsText( ST_Intersection(e1, e2, 1e-14) ) from t5862_inputs;
   POINT(22.77996926687162 70.70480392614921)

  =# select ST_AsText( ST_Intersection(ST_ReducePrecision(e1, 1e-14), ST_ReducePrecision(e2, 1e-14), 1e-14) ) from t5862_inputs;
   LINESTRING(22.78003855687162 70.7049816061492,22.77996926687162 70.70480392614921)

I've filed this downstream: https://trac.osgeo.org/postgis/ticket/5885

--strk;

  Libre GIS consultant/developer 🎺
  https://strk.kbt.io/services.html
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/geos-devel/attachments/20250424/0b30702d/attachment.sig>


More information about the geos-devel mailing list