Try grass tool v.splitlines. Cheers Björn On Dec 18, 2014 10:06 PM, "Richard Duivenvoorde" <rdmaili...@duif.net> wrote:
> Hi List, > > anybody a simple (python) solution for following problem: > > - given a line with 5 vertices (say W-shaped) of total 100 meter > - starting from point 0 on this line I want a set of 10 meter lines > (following the original) and x meter in between. > - the result should be y lines which follow the W > > On a straight part of the line it is easy, using the interpolate > function of QgsGeometry: just find the start and end of each 10m part > and create a line in between. > > BUT that fails in parts where there is a vertex in this part, the new > line will be created between the start and end, taking a 'shortcut' on > the parts of the original line where there is a vertex/hook in the line. > > How can I make the 10m lines follow the original line. > I've been looking into the 'findNextVertex'-functions, but fail to > create good use of these. > Another idea I had was to 'grow' the 10m line in a lot of smaller steps, > checking everytime if there is a vertex from the original line ON the > new create one. > > Anybody has a better idea? > The use case is a plugin creating trenches in longer line-segments: > after creating the 10m line, that line is buffered, so create a 'trench'. > > Regards, > > Richard Duivenvoorde > _______________________________________________ > Qgis-developer mailing list > Qgis-developer@lists.osgeo.org > http://lists.osgeo.org/mailman/listinfo/qgis-developer >
_______________________________________________ Qgis-developer mailing list Qgis-developer@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/qgis-developer