qgis / QGIS

QGIS is a free, open source, cross platform (lin/win/mac) geographical information system (GIS)
https://qgis.org
GNU General Public License v2.0
10.38k stars 2.98k forks source link

Allow tolerance in intersects tests #25482

Open qgib opened 6 years ago

qgib commented 6 years ago

Author Name: gcarrillo - (gcarrillo -) Original Redmine Issue: 17585

Redmine category:geometry


>>> my_line = QgsGeometry().fromWkt('0 0, 963461.42999999970197678 1077875.79199999943375587, 1 1')
>>> my_point = QgsGeometry().fromWkt("Point (963461.430 1077875.792)")
>>> my_line.intersects(my_point)
False

Any way to set a tolerance or something so that such intersection is found? The line was created digitizing it in QGIS using snapping (vertex mode, 9 pixels of tolerance).

qgib commented 6 years ago

Author Name: Nyall Dawson (@nyalldawson)


Same behavior in 2.x. I'm changing this from a bug to a feature request, because the current behaviour is correct - those two geometries don't intersect.


qgib commented 6 years ago

Author Name: gcarrillo - (gcarrillo -)


It would be nice to have a tolerance parameter so that this very little discrepancies can also be found, but I guess one could snap one geometry to the other (with such little distance as tolerance) and then run intersects.


qgib commented 6 years ago

Author Name: Giovanni Manghi (@gioman)