Intersection tests with curved polygons

Andrea Aime andrea.aime at geosolutionsgroup.com
Fri Dec 20 05:05:35 PST 2024


Hi,
I'm having an issue testing the intersection between a point and two curved
polygons.
Here is the situation visually, from QGIS:

[image: image.png]

and zooming in (a lot):

[image: image.png]

In particular, the point is (barely) inside the polygon at the top, whose
identifier is 12875.
Now if I run an intersection test, I get both polygons as a result:

> SELECT ogc_fid FROM testdata WHERE ST_Intersects(geom,
ST_GeomFromText('POINT (25492818 6677399.98)', 3879));
 ogc_fid
---------
    1258
   12875
(2 rows)

As you can see... both polygons tested positive for intersection. Visually
that does not make sense, the point is in a hole inside polygon 1258, but
maybe there is tolerance/linearization in play, or it's just a
visualization fluke (how the curved polygons are rendered)... but I've also
visualized the same data in GeoServer, and the visual result is the same.

I have verified the behavior in the following two version:

   - postgis 3.2 and postgresql 14.15
   - postgis 3.5 and postgresql 17.2 (latest postgis docker image)

Test data can be found in this Github GIST
<https://gist.github.com/aaime/dcf55b635c5bd09c2b9ebb31a2ab083a>.

Can anyone shed some light on the behavior I'm seeing?

Best regards
Andrea
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20241220/9122fd79/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image.png
Type: image/png
Size: 15500 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20241220/9122fd79/attachment.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image.png
Type: image/png
Size: 3147 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20241220/9122fd79/attachment-0001.png>


More information about the postgis-users mailing list