Thank you Nyall, that makes sense. 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.
Regards, Germán 2017-11-29 17:56 GMT-05:00 Nyall Dawson <[email protected]>: > On 29 November 2017 at 02:22, Germán Carrillo <[email protected]> > wrote: > > > > Hi devs, > > > > > > do you know why this polyline > > > > >>> my_line = QgsGeometry().fromWkt('0 0, 963461.42999999970197678 > 1077875.79199999943375587, 1 1') > > > > and this point > > > > >>> my_point = QgsGeometry().fromWkt("Point (963461.430 1077875.792)") > > > > don't intersect? > > > > >>> my_line.intersects(my_point) # returns False > > > > Because we use the GEOS library to test intersects, and it performs an > exact intersection test. So 963461.42999999970197678 > 1077875.79199999943375587 is not the same as 963461.430 1077875.792. > > This is the same behaviour in 2.x, and all other GEOS based projects > (e.g. PostGIS gives the same result). > > Nyall > -- ----------- |\__ (:>__)( |/ Soluciones Geoinformáticas Libres http://geotux.tuxfamily.org/ http://twitter.com/GeoTux2 http://about.me/germancarrillo <http://gis.stackexchange.com/users/4972/germ%c3%a1n-carrillo>
_______________________________________________ QGIS-Developer mailing list [email protected] List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer
