[PostGIS] #5722: Spatial exception - geometry boundary touches interior of edge 4 (XX000)
PostGIS
trac at osgeo.org
Mon May 6 01:58:41 PDT 2024
#5722: Spatial exception - geometry boundary touches interior of edge 4 (XX000)
-----------------------+---------------------------
Reporter: strk | Owner: strk
Type: defect | Status: new
Priority: medium | Milestone: PostGIS 3.5.0
Component: topology | Version: master
Resolution: | Keywords:
-----------------------+---------------------------
Comment (by strk):
[[Image(screen01.png)]]
New analisys: upon adding the vertical line GEOS correctly computes nodes
but PostGIS is unable to tell that the node falls on the edge. Logs:
{{{
[topo/lwgeom_topo.c:_lwt_AddPoint:6536] Adding point:
POINT(-0.350498072243138 0.326335974301659)
[topo/lwgeom_topo.c:_lwt_AddPoint:6612] New point is within
1.26179306007529e-15 units of 0 edges
[topo/lwgeom_topo.c:lwt_GetFaceContainingPoint:7479] Closest segment on
edge 2 is 1 (dist 8.28391e-18)
DEBUG: [topo/lwgeom_topo.c:lwt_GetFaceContainingPoint:7482] Closest
segment on edge 2 is LINESTRING(8.13909 0.334123, -11.9641 0.315684)
}}}
What the logs say is a contradiction:
1. The point is NOT within 1.24e-15 units from the edge
2. The point is at 8.28e-18 distance from the edge
Either 1 or 2 is true, cannot both be true.
- _lwt_AddPoint (1) uses ST_DWithin to find edges within distance, which
gives the wrong answer, in this case.
- lwt_GetFaceContainingPoint (2) uses the <-> operator to find the
closest edge and ptarray_closest_segment_2d to compute the distance.
--
Ticket URL: <https://trac.osgeo.org/postgis/ticket/5722#comment:6>
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