[Qgis-developer] calculate distance from two points along line in pyqgis

G. Allegri giohappy at gmail.com
Tue Jan 13 10:04:45 PST 2015


Hi Pierluigi,
I don't know of such a function available from Python. I've translated a
function from GEOS (C++) to Python some time ago. If you wish I can share
it.

giovanni

2015-01-13 18:16 GMT+01:00 Ing. Pierluigi De Rosa <
pierluigi.derosa at gfosservices.it>:

> Hi all,
>
> I have a line geometry (ALine) and a point(Apoint) belonging to the
> ALine.
> Apoint have been evaluated from a second line geometry Bline that cross
> the Aline using the QgsGeometry intersection function as:
> Apoint =Bline.intersection(Aline)
>
> I need to calculate distance along Aline from the starting point of
> Aline up to Apoint.
>
> In a certain way this problem could be seen as the opposite of function
> interpolate of QgsGeometry
> point = geom.interpolate(currentdistance)
> where it is known the distance from the beginning and it provide the
> point at specific distance.
> In my case I have the point but I need the distance.
>
> Thanks
> Pierluigi
> --
>
>
> ________________________________________________________________________
> Ing. Pierluigi De Rosa (PhD)
> Studio Associato GFOSSERVICES
>
>
> _______________________________________________
> Qgis-developer mailing list
> Qgis-developer at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/qgis-developer
>



-- 
Giovanni Allegri
http://about.me/giovanniallegri
Twitter: https://twitter.com/_giohappy_
blog: http://blog.spaziogis.it
GEO+ geomatica in Italia http://bit.ly/GEOplus
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20150113/610a4836/attachment.html>


More information about the Qgis-developer mailing list