Intersection tests with curved polygons

Andrea Aime <[email protected]>
Newsgroups gmane.comp.gis.postgis
Message-ID <CALHQADU1S_S+JBgs8xGpXMyG3yihruNd1CB7MYdhQQZwapirZg@mail.gmail.com>
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
image.png (image/png, 15.1 KB) - not displayed
image.png (image/png, 3.1 KB) - not displayed
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.