I do have two vector layer, of which
one is a point layer based on "events" by remote sensing
and the second one is a line layer from local research.
In my case these are earthquakes and tectonic faults, but
I guess one could simply choose "car-accidents and roads"
as a general example.
So what I'd like to do is move/copy the points onto
the closest point of the lines, as long as its within a
tolerance distance (say 1-2km or 0.0xx°), with the new
point layer (+attr moved y/n).
Any ideas ?
Linux, QGIS 1.8
Best Answer
Posted a code snippet(tested in python console) that doest the below
Edit: Just now found that @radouxju method using closestSegmentWithContext gives the same results in less lines of code. I wonder why they came up with this weird method name? should have been something like closestPointOnGeometry.
So we can avoid shapely and do like,