Great idea to add this to the docs, I was just about to code up a solution myself, so its probably a common query!
-F On 21 May 2010 19:59, Sean Gillies <[email protected]> wrote: > On Fri, May 21, 2010 at 10:31 AM, Ludovic Granjon > <[email protected]> wrote: > > Hello all > > I have to develop a script in python that it will do different things and > I > > search before starting to develop the theoretical way to do that. > > So I search if it exist a function in some library to cut a line with a > > distance, ie cut a line all 10 km. Do you know a way to do that ? I > searched > > in shapely and ogr but I didn't see something like that. > > > > Thanks > > > > Ludovic > > > > Hi Ludovic, > > No matter what software you use, the method for cutting a linestring > will be approximately the same: > > * Find the cut point on the line P(c) using a linear referencing > projection method > * Find the control points immediately before P(c-1) and immediately > after P(c+1) the cut point using a linear referencing interpolation > method > * Make two new lines from P(0)...P(c) and P(c)...P(N) where P(0) and > P(N) are the endpoints of the original line > > I just added a Shapely example to > > http://gispython.org/shapely/docs/1.2/manual.html#linear-referencing-methods > . > > Cheers, > > -- > Sean >
