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-11-01 23:39:22
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)
下一篇:shp的基本操作