I would like to calculate line sinuosity for line segments.
The sinuosity is defined as a ratio of the distance between start and end point along a line (line length) and the euclidean distance between both points. A large sinuosity signifies a large detour between start and end point and is shown as the red line in the next image:
Caculating this measure is straightforward in GRASS GIS with:
v.to.db map=lines option=sinuous columns=sinuosity
However, v.to.db
is not part of QGIS processing and cannot be called from within the QGIS Python shell.
Is there another option to calculate line sinuosity in PyQGIS?
Here some links to related questions: