Security News
Weekly Downloads Now Available in npm Package Search Results
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
route-correction
Advanced tools
| 字段 | 类型 | 描述 | |-----|------|-----| | lng | Number | 经度 | | lat | Number | 纬度 |
字段 | 类型 | 描述 |
---|---|---|
lng | Number | 经度 |
lat | Number | 纬度 |
字段 | 类型 | 描述 |
---|---|---|
p0 | Point | 起始点 |
p1 | Point | 结束点 |
length | Number | 路径线段长度(米) |
distance | Number | p0点距离路径起始点的距离 |
direction | Number | 路径朝向(弧度) |
directionInDegree | Number | 路径朝向(角度) |
字段 | 类型 | 描述 |
---|---|---|
points | [Point] | 折线点 |
segments | [Segment] | 路径线段 |
totalDistance | Number | 总长度(米) |
maxLng / minLng | Number | 最大最小经度 |
maxLat / minLat | Number | 最大最小纬度 |
centerLng / centerLat | Number | 包围盒中心经纬度 |
RADIUS | Number | 地球半径(包围盒做梯形正畸后近似) |
const res = correct(point);
将输入点位纠偏到路线的最近点位,并返回纠偏后点位相关信息
字段 | 类型 | 描述 |
---|---|---|
point | Point | 计算 point 点到当前路径的最近点位 |
返回值 res 为一个对象,其中各属性如下
字段 | 类型 | 描述 |
---|---|---|
point | Point | 最近点 |
point.r | Number | 最近点在线段上的位置,范围 0~1。0 代表最近点位于 p0,1 代表最近点位于 p1, 0.5 代表位于线段中点 |
point.lng / point.lat | Number | 最近点的经纬度 |
point.distance | Number | 最近点距离线段 p0 点的距离(米) |
segment | Segment | 最近点所在线段 |
index | Number | 最近点所在线段在 segments 数组中的下标 |
distance | Number | 最近点距离路径起始点的距离(米) |
const point = pointAt(distance)
查询沿路线行进指定距离后的所在点位,并返回点位相关信息
字段 | 类型 | 描述 |
---|---|---|
distance | Number | 距离路径起始点的距离(米) |
字段 | 类型 | 描述 |
---|---|---|
point | Point | 查询结果所在点位 |
point.lng / point.lat | Number | 所在点的经纬度 |
point.distance | Number | 实际距离(限定 0~路径总长) |
direction | Number | 所在点路径朝向(弧度) |
directionInDegree | Number | 所在点路径朝向(角度) |
FAQs
| 字段 | 类型 | 描述 | |-----|------|-----| | lng | Number | 经度 | | lat | Number | 纬度 |
The npm package route-correction receives a total of 0 weekly downloads. As such, route-correction popularity was classified as not popular.
We found that route-correction demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
Security News
A Stanford study reveals 9.5% of engineers contribute almost nothing, costing tech $90B annually, with remote work fueling the rise of "ghost engineers."
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.