【问题标题】:How to calculate perpendicular distance between a line and a point when using coordinates (latitude & longitude) [duplicate]使用坐标(纬度和经度)时如何计算线和点之间的垂直距离[重复]
【发布时间】:2018-10-24 16:45:56
【问题描述】:

我想计算直线和点之间的垂直距离。 LinePointA(纬度,经度)-(48.294483,11.568453) LinePointB(纬度,经度)-(48.283479,11.838929) PointC(纬度,经度)-(48.561846,11.733314) 这里AB是线,C是点。 根据谷歌地图的预期距离为 59.36 公里 提前致谢。

【问题讨论】:

  • 答案完全取决于您是否只考虑线和点足够接近以被认为是平坦的,或者它是否需要适用于任何有效的全局坐标集?
  • 是的。需要使用有效的全局坐标。

标签: java math geometry trigonometry


【解决方案1】:

您可以尝试barefoot -- 用于地球坐标几何运算的开源 Java 库。

这里有一个解决您问题的方法 -- https://github.com/bmwcarit/barefoot#spatial-search-and-operations

如果您想深入了解数学,请查看this

【讨论】:

  • 我尝试将赤脚添加到 maven com.bmw-caritbarefoot 0.1.1 但它显示错误“缺少工件 com.bmw-carit:barefoot:jar:0.1.1”。
  • 你是否在 pom 中添加了 nexus.onebusaway.org/nexus/content/repositories/public 存储库?
  • 我没有那样做。添加后它起作用了。谢谢@Kirill Liubun
猜你喜欢
  • 2011-09-16
  • 2016-02-03
  • 2014-12-16
  • 1970-01-01
  • 2015-11-05
  • 2016-10-11
  • 1970-01-01
  • 2021-05-10
  • 2018-04-01
相关资源
最近更新 更多