I have a list of LineString coords:
list = [(90, 170), (99.0, 159.0), (321.0, 159.0), (300, 146), (296, 23)]
How to interpolate a point at every X distance along the line using Shapely?
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It only takes a minute to sign up.Sign up to join this community
This is actually pretty easy.
distance = 0 ## starting at length 0 add_distance = 10 ## eg interpoalte every 10 meter while distance < line.length: new_point = line.interpolate(distance) distance += add_distance ## add more
You will have to convert that list of tuples into actual LineString:
list_of_points = [Point(tuple) for tuple in list] line = LineString(list_of_points)