Re: Intersection tests with curved polygons
Paul Ramsey <[email protected]>
| Newsgroups | gmane.comp.gis.postgis |
|---|---|
| Message-ID | <[email protected]> |
These are literally CurvePolygon type? It’s probably getting caught in our lack of full curve support. I would be interested in the ST_Distance between the point and those two CurvePolygons. (Because, for distance, we have a postgis-native implementation that supports curves). Whereas for intersection, the calculation is delegated to GEOS *after linearizing the inputs*. In that linearization, could sit the logically problem you’re seeing. P > On Dec 20, 2024, at 5:05 AM, Andrea Aime <[email protected]> wrote: > > Hi, > I'm having an issue testing the intersection between a point and two curved polygons. > Here is the situation visually, from QGIS: > > <image.png> > > and zooming in (a lot): > > <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