In my script I need to check, whether a point I created stored in a memory layer lies on a polyline, which is in another memory layer. I am certain, that the point does overlap/intersect the line, because I can see it on my canvas and have coordinates (CRS do match) printed by the script. I tried point.intersects(line) but to no great success - sometimes it works, sometimes it doesn't. What function/method would you recommend to check for overlap of point and line, which would return a boolean and not result in any output layers?
-
1You can adapt this script Determine if shapely point is within a linestring/multilinestring– geneCommented Apr 5, 2016 at 20:08
-
Works like 24-carat gold. Could you post it as an answer, so I can credit it properly? I have combed almost whole of the internet looking for an answer, that would relate to QGIS and didn't found this link, I think it would be helpful for others doing such intersections in qgis.– Julian_PCommented Apr 5, 2016 at 21:15
-
I was thinking that QGIS must have a "Distance within" function like postgis.net/docs/ST_DWithin.html but perhaps it does not.– user30184Commented Apr 5, 2016 at 21:55
Add a comment
|