<div dir="ltr"><a href="https://gist.github.com/giohappy/f2abde1549aa2775b5aa">https://gist.github.com/giohappy/f2abde1549aa2775b5aa</a><br></div><div class="gmail_extra"><br><div class="gmail_quote">2015-01-14 10:40 GMT+01:00 gene <span dir="ltr"><<a href="mailto:martin.laloux@gmail.com" target="_blank">martin.laloux@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I don't have the code posted by Giovanni but this is very easy to do with<br>
Shapely <<a href="http://toblerity.org/shapely/manual.html" target="_blank">http://toblerity.org/shapely/manual.html</a>>   (a Python wrapper of<br>
GEOS).<br>
<br>
With PyQGIS, I do it in this way:<br>
<br>
1) by definition a polyline is composed of  straight  segments between<br>
points (nodes)<br>
2) after computing the intersection between the polylines , the intersecting<br>
point lies on a particular segment, easy to determine.<br>
3) Then a simple loop through the segments (length) allows to compute the<br>
distance between the first point of the line and the intersection point (=<br>
sum of segments length + the length of the segment between the first point<br>
of the segment where the intersecting point lies and the intersection<br>
point).<br>
<br>
<br>
<br>
--<br>
View this message in context: <a href="http://osgeo-org.1560.x6.nabble.com/calculate-distance-from-two-points-along-line-in-pyqgis-tp5181313p5181413.html" target="_blank">http://osgeo-org.1560.x6.nabble.com/calculate-distance-from-two-points-along-line-in-pyqgis-tp5181313p5181413.html</a><br>
<div class="HOEnZb"><div class="h5">Sent from the Quantum GIS - Developer mailing list archive at Nabble.com.<br>
_______________________________________________<br>
Qgis-developer mailing list<br>
<a href="mailto:Qgis-developer@lists.osgeo.org">Qgis-developer@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/qgis-developer" target="_blank">http://lists.osgeo.org/mailman/listinfo/qgis-developer</a><br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr">Giovanni Allegri<br><a href="http://about.me/giovanniallegri" target="_blank">http://about.me/giovanniallegri</a><div>Twitter: <a href="https://twitter.com/_giohappy_" target="_blank">https://twitter.com/_giohappy_</a></div><div>blog: <a href="http://blog.spaziogis.it" target="_blank">http://blog.spaziogis.it</a><br>GEO+ geomatica in Italia <a href="http://bit.ly/GEOplus" target="_blank">http://bit.ly/GEOplus</a></div></div></div>
</div>