点打断线【GIS】【shapely】

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)

  

posted @ 2021-08-19 18:25  ddzhen  阅读(273)  评论(0编辑  收藏  举报