根据给定的位置、距离和方向计算新的位置,使用椭球模型。
该函数利用 @turf/rhumb-destination 库来计算沿着等方位线(恒向线)的目标位置。 输入的位置由经度、纬度和高度组成,函数将保持高度不变,仅根据距离和方向更新经度和纬度。
@turf/rhumb-destination
起始位置,格式为 [经度, 纬度, 高度],单位为度和米。
从起始位置到目标位置的距离,单位为米。
方向,以度为单位,从正北方向开始顺时针测量。
可选
可选参数,用于存储计算结果的数组。如果未提供,则会创建一个新数组。
如果计算成功,返回目标位置,格式为 [经度, 纬度, 高度];如果计算失败,则返回 undefined。
const startPosition = [116.4074, 39.9042, 0];const distance = 1000; // 1000 米const heading = 90; // 正东方向const newPosition = geoRhumbDestination(startPosition, distance, heading);console.log(newPosition); // 输出新的位置 复制
const startPosition = [116.4074, 39.9042, 0];const distance = 1000; // 1000 米const heading = 90; // 正东方向const newPosition = geoRhumbDestination(startPosition, distance, heading);console.log(newPosition); // 输出新的位置
根据给定的位置、距离和方向计算新的位置,使用椭球模型。
该函数利用
@turf/rhumb-destination库来计算沿着等方位线(恒向线)的目标位置。 输入的位置由经度、纬度和高度组成,函数将保持高度不变,仅根据距离和方向更新经度和纬度。