我们在很多时候需要把一条直线或者折线打断成多段线,为了不重新定义每一条线,我们可以用.cutLines()去进行打断!函数如下:
cutLines(distances, maxError, proj)
Converts LineStrings into a MultiLineString by cutting it in two at each distance along the length of the LineString.
Arguments:
this:geometry (Geometry):
将 LineStrings 转换为 MultiLineString,方法是在沿 LineString 长度的每个距离处将其一分为二。 参数: 这:几何(几何): 剪切此几何图形的线条。 距离(列表): 沿每个 LineString 将线切割成单独部分的距离,以给定项目的单位测量,如果项目未指定,则以米为单位。 maxError(ErrorMargin,默认值:null): 执行任何必要的重新投影时允许的最大错误量。 项目(投影,默认值:空): 结果和距离测量值的投影,如果未指定,则为 WGS84。
Cuts the lines of this geometry.
distances (List):
Distances along each LineString to cut the line into separate pieces, measure