[PostGIS] #5885: ST_Intersection with gridSize argument does not internally use ReducePrecision ?
PostGIS
trac at osgeo.org
Thu Apr 24 03:25:12 PDT 2025
#5885: ST_Intersection with gridSize argument does not internally use
ReducePrecision ?
---------------------+----------------------------
Reporter: strk | Owner: pramsey
Type: defect | Status: new
Priority: medium | Milestone: PostGIS 3.1.13
Component: postgis | Version: 3.1.x
Keywords: |
---------------------+----------------------------
I would expect the following queries to give the same result, instead they
don't:
{{{
=# 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)
=# select ST_AsText( ST_Intersection(ST_SnapToGrid(e1, 1e-14),
ST_SnapToGrid(e2, 1e-14), 1e-14) ) from t5862_inputs;
LINESTRING(22.78003855687162 70.7049816061492,22.77996926687162
70.70480392614921)
}}}
According to the documentation (and my intentions when I wrote that code)
those geometries should be made of the requested precision before passing
them to the intersection code so we should have the same results:
https://postgis.net/docs/ST_Intersection.html
The gridSize parameter was added in PostGIS-3.1
--
Ticket URL: <https://trac.osgeo.org/postgis/ticket/5885>
PostGIS <http://trac.osgeo.org/postgis/>
The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project.
More information about the postgis-tickets
mailing list