def split_line_string(points, max_section_length):
    
    #Split each line segment in the linestring into segment smaller than max_section_length
    split_segs = []
    for (lng1, lat1), (lng2,lat2) in cons(points):
        split_seg = list(split_line_segment(lng1, lat1, lng2, lat2, max_section_length))
        split_segs.append( split_seg )
    
    #String together the sub linestrings into a single linestring
    ret = []
    segstart_s = 0
    for i, split_seg in enumerate(split_segs):
        for x, y, s in split_seg[:-1]:
            ret.append( (x, y, s+segstart_s) )
        
        if i==len(split_segs)-1:
            x, y, s = split_seg[-1]
            ret.append( (x, y, s+segstart_s) )
        
        segstart_s += split_seg[-1][2]
            
    return ret
dataset/ETHPy150Open bmander/graphserver/pygs/graphserver/ext/ned/elevation/elevation.py/split_line_string/original