TurfMeasurements should have a function for determining bearing deltas
未关闭
还没有人认领这个 Issue。
jira-sync-complete
- 主要语言
- Java
- 星标
- 438
- 派生
- 117
- PR 合并指标
- 30 天内没有已合并 PR
描述
TurfMeasurement.bearing(Point point1, Point point2
This function can return -180.0, 180.0.
In order to calculate the difference between two bearings. Downstream needs to create a normalizing function which can determine that the difference between -179.0 and 179.0, is 2 degrees.
double TurfMeasurements.shortestBearingDiff(double bearing1, double bearing2) {
...
}
This function should be proven with unit tests.
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
首先阅读 services-turf/src/main/java/com/mapbox/turf/TurfMeasurement.java,尤其是 issue 中引用的 bearing 函数。添加所请求的 bearing-difference 函数和单元测试,覆盖 -179.0 和 179.0 的情况,包括可能得到 -180.0 和 180.0 的结果;完成的标准是测试能够证明所得差值是最短差值。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- java
- 领域
- backend
- Issue 类型
- 功能
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 活跃度
- 停滞
- 描述清晰度
- 描述清楚
- 新手友好度
- 45/100