简介:
我正在寻找一种沿直线采样但沿几何形状统一的方式采样的方法最佳情况下,我提供一个值 n,即点的数量,它们将沿线分布。
这里主要的问题就是我们需要获取线段指定线段的点,这里就是获取整个线段的长度,然后根据线段的长度进行等距离分割,并且设定指定的步长,然后进行分割,分割后转化为指定矢量,获取每个点,然后放入到指定的矢量集合中,从而可以进行下一步的操作,进行这些点的提取。
函数:
length(maxError, proj)
Returns the length of the linear parts of the geometry. Polygonal parts are ignored. The length of multi geometries is the sum of the lengths of their components.
返回几何体线性部分的长度。多边形部分将被忽略。多重几何体的长度是其各部分长度的总和。
Arguments:
this:geometry (Geometry):
The input geometry.
maxError (ErrorMargin, default: null):
The maximum amount of error tolerated when performing any necessary reprojection.
proj (Projection, default: null):
If specified, the result will be in the units of the coordinate system of this projection. Otherwise it will be in meters.