Skip to content
Prev 22497 / 29559 Next

dividing a line by points lying on it

Hello,

it would have been been easier if you included the link to the related 
thread from 2013, instead of letting me figure out myself ;-)

http://r-sig-geo.2731867.n2.nabble.com/split-divide-SpatialLines-sp-into-n-segments-td7583234.html

So far, my first idea is the following iterative solution:

 1. For the first, figure out on which line segment, i.e. straight line
    it is located (iterate pairwise over all coordinates of the linestring)
      * If you find the intersection, split the SpatialLine at this point
      * Finding a point on a straight line might be implemented in some
        R-function, but actually is elementary mathematics. Mind
        rounding errors during floating point operations.

     2 ...n Repeat for the remaining points, but test against the 
previously splitted SpatialLines, i.e. the     outcome of the preceding step

Regards,
Matthias Hinz

Am 26.03.2015 um 12:24 schrieb Wolfgang Biener: