from shapely.geometry import LineString, Point from shapely.ops import snap, split if __name__ == ‘__main__‘: arr = [[0, 0], [10, 0]] brr = [5, 0.01] ls = LineString(arr) pt = Point(brr) geom = snap(ls, pt, 0.5) part1, part2 = split(geom, pt)
2023-12-03 19:22:52
from shapely.geometry import LineString, Point from shapely.ops import snap, split if __name__ == ‘__main__‘: arr = [[0, 0], [10, 0]] brr = [5, 0.01] ls = LineString(arr) pt = Point(brr) geom = snap(ls, pt, 0.5) part1, part2 = split(geom, pt)