[PostGIS] #5782: TopoGeo_addLinestring corrups topology: adjacent edges 33 and -32 bind different face (1 and 0)
PostGIS
trac at osgeo.org
Wed Sep 25 03:29:06 PDT 2024
#5782: TopoGeo_addLinestring corrups topology: adjacent edges 33 and -32 bind
different face (1 and 0)
--------------------------------+---------------------------
Reporter: Lars Aksel Opsahl | Owner: strk
Type: defect | Status: new
Priority: high | Milestone: PostGIS 3.4.4
Component: topology | Version:
Resolution: | Keywords:
--------------------------------+---------------------------
Comment (by strk):
What I can tell is that GEOS finds the correct edge being closer.
Here's a simple test:
{{{
A='LINESTRING(18.00678831099686 69.0404811833497,18.006784630996860
69.04045431334970,18.00677727099686 69.0404005833497)'
B='LINESTRING(18.00677727099686 69.0404005833497,18.006780950996863
69.04042744334969,18.00678831099686 69.0404811833497)'
Q='POINT(18.006691126034692 69.04048768506776)'
AQ_geos=$(geosop -a "$A" -b "$Q" distance)
AQ_pgis=$(psql -XtAc "SELECT ST_Distance('$A', '$Q')")
BQ_geos=$(geosop -a "$B" -b "$Q" distance)
BQ_pgis=$(psql -XtAc "SELECT ST_Distance('$B', '$Q')")
echo "PostGIS:"
echo " A-Q: $AQ_pgis"
echo " B-Q: $BQ_pgis"
echo "GEOS:"
echo " A-Q: $AQ_geos"
echo " B-Q: $BQ_geos"
}}}
The results I get:
{{{
PostGIS:
A-Q: 9.716835623285099e-05
B-Q: 9.716835623092273e-05
GEOS:
A-Q: 9.7168356230588148e-05
B-Q: 9.7168356230827946e-05
}}}
Basically PostGIS finds B being closer to Q while GEOS finds A being
closer to Q.
In our case the GEOS answer would be more appropriate.
What we are using to find the closest edge is the `<->` operator.
--
Ticket URL: <https://trac.osgeo.org/postgis/ticket/5782#comment:18>
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