计算线段的中心坐标(midpoint)
js
npm install @turf/midpoint
接收两个点,并返回它们之间的中间点。中间点是通过测地线方式计算的,也就是考虑到地球曲率的影响
Takes two points and returns a point midway between them. The midpoint is calculated geodesically, meaning the curvature of the earth is taken into account.
参数
参数 | 类型 | 描述 |
---|---|---|
point1 | Coord | 第一个点 |
point2 | Coord | 第二个点 |
返回(Returns)
Feature <Point>
- pt1和pt2之间的中心点
示例