<p dir="ltr">Try grass tool v.splitlines.</p>
<p dir="ltr">Cheers<br>
Björn</p>
<div class="gmail_quote">On Dec 18, 2014 10:06 PM, "Richard Duivenvoorde" <<a href="mailto:rdmailings@duif.net">rdmailings@duif.net</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi List,<br>
<br>
anybody a simple (python) solution for following problem:<br>
<br>
- given a line with 5 vertices (say W-shaped) of total 100 meter<br>
- starting from point 0 on this line I want a set of 10 meter lines<br>
(following the original) and x meter in between.<br>
- the result should be y lines which follow the W<br>
<br>
On a straight part of the line it is easy, using the interpolate<br>
function of QgsGeometry: just find the start and end of each 10m part<br>
and create a line in between.<br>
<br>
BUT that fails in parts where there is a vertex in this part, the new<br>
line will be created between the start and end, taking a 'shortcut' on<br>
the parts of the original line where there is a vertex/hook in the line.<br>
<br>
How can I make the 10m lines follow the original line.<br>
I've been looking into the 'findNextVertex'-functions, but fail to<br>
create good use of these.<br>
Another idea I had was to 'grow' the 10m line in a lot of smaller steps,<br>
checking everytime if there is a vertex from the original line ON the<br>
new create one.<br>
<br>
Anybody has a better idea?<br>
The use case is a plugin creating trenches in longer line-segments:<br>
after creating the 10m line, that line is buffered, so create a 'trench'.<br>
<br>
Regards,<br>
<br>
Richard Duivenvoorde<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>
</blockquote></div>