Opened 5 years ago

Closed 5 years ago

#4274 closed defect (fixed)

ST_PointOnSurface generated point produces ST_Intersects = false

Reported by: andehhh Owned by: pramsey
Priority: medium Milestone: PostGIS GEOS
Component: postgis Version: 2.4.x
Keywords: Cc:

Description

Given is this query which returns 'false':

SELECT ST_Intersects(ST_PointOnSurface(poly), poly) FROM (SELECT 'SRID=4326; POLYGON ((2.0875049999999997 49.038467, 2.087497642793396 49.0384427212182, 2.087475 49.038368, 2.0875049999999997 49.038467))'::geometry AS poly) AS foo;

Looking at the documentation ("Returns a POINT guaranteed to intersect a surface.") this case should be handled internally to avoid confusion.

Can it be explained with rounding issues as the polygon in question is a very narrow sliver polygon?

When transforming to a metric system this issue disappears.

Change History (4)

comment:2 by andehhh, 5 years ago

upstream labeled as WONT FIX by dr-jts ("finite-precision" issue)

comment:3 by pramsey, 5 years ago

Milestone: PostGIS 2.5.2PostGIS GEOS

comment:4 by Algunenano, 5 years ago

Resolution: fixed
Status: newclosed

This was addressed both in jts and GEOS:

template_postgis=# SELECT ST_Intersects(ST_PointOnSurface(poly), poly) FROM (SELECT 'SRID=4326; POLYGON ((2.0875049999999997 49.038467, 2.087497642793396 49.0384427212182, 2.087475 49.038368, 2.0875049999999997 49.038467))'::geometry AS poly) AS foo;
 st_intersects 
---------------
 t
(1 row)


# Select postgis_full_version();
                                                                                                                                                                                      postgis_full_version                                                                                
                                                                                                      
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------
 POSTGIS="3.0.0alpha4dev r17580" [EXTENSION] PGSQL="110" GEOS="3.8.0dev-CAPI-1.11.0 " PROJ="6.1.0" GDAL="GDAL 3.0.0, released 2019/05/05" LIBXML="2.9.9" LIBJSON="0.13.1" LIBPROTOBUF="1.3.1" WAGYU="0.4.3 (Internal)" (core procs from "3.0.0dev r17376" need upgrade) TOPOLOGY (topology
 procs from "3.0.0dev r17376" need upgrade) RASTER (raster procs from "3.0.0dev r17376" need upgrade)
(1 row)
Note: See TracTickets for help on using tickets.