What are the distance units in com.vividsolutions.jts.geom.Geometry class?(com.vividsolutions.jts.geom.Geometry 类中的距离单位是什么?)
问题描述
我们的 VB.NET 项目使用来自 Vivid Solutoins (com.vividsolutions.jts.geom.Geometry) 的 Java 库来进行几何计算.帮助在这里:http://tsusiatsoftware.net/jts/javadoc/com/vividsolutions/jts/geom/Geometry.html
Our VB.NET project is using a Java library from Vivid Solutoins (com.vividsolutions.jts.geom.Geometry) to do Geometry calculations. The help is here: http://tsusiatsoftware.net/jts/javadoc/com/vividsolutions/jts/geom/Geometry.html
我想不通的是专门用于 Buffer 属性的单位,或者与此相关的任何其他距离.我的程序正在处理海里,文档没有说明单位是度、英里、海里、公里、英寸等.
What I can't figure out are the units specifically for the Buffer property, or any other distance for that matter. My program is dealing with Nautical Miles, and the documentation gives no indication if the units are degrees, miles, Nautical Miles, Kilometers, inches, etc.
有没有人用过这个知道答案的库?提前致谢.
Has anyone used this library who knows the answer? Thanks in advance.
推荐答案
这是一篇旧帖子,但对于其他正在寻找的人来说,这里是答案,因为令人难以置信的是 java 文档没有说明方法返回的单位.返回的距离以中心角为单位.然后,您可以使用任意数量的公式转换为所需的计量单位.最简单的是转换为弧度.1 弧度 = 180 度除以 pi (rad=180deg/pi).从那里,您可以用您选择的单位(例如 6371 公里)将弧度乘以地球的平均半径,以获得两点之间的距离.也有更准确的方法,但您可以在网上查找.
This is an old post, but here is the answer for anyone else who is looking, since incredibly the java docs do not state the units returned by the method. The distance returned is in central angle degrees. You can then use any number of formulas to convert to your required unit of measure. The simplest is to convert to radians. 1 radian = 180 degrees divided by pi (rad=180deg/pi). From there, you can multiply radians by the average radius of the earth in your choice of units (6371 km for instance) to get distance between two points. More accurate methods are also available, but you can look them up on the net.
这篇关于com.vividsolutions.jts.geom.Geometry 类中的距离单位是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:com.vividsolutions.jts.geom.Geometry 类中的距离单位是什么?


- 将log4j 1.2配置转换为log4j 2配置 2022-01-01
- Safepoint+stats 日志,输出 JDK12 中没有 vmop 操作 2022-01-01
- Spring Boot连接到使用仲裁器运行的MongoDB副本集 2022-01-01
- Eclipse 插件更新错误日志在哪里? 2022-01-01
- C++ 和 Java 进程之间的共享内存 2022-01-01
- Java包名称中单词分隔符的约定是什么? 2022-01-01
- Jersey REST 客户端:发布多部分数据 2022-01-01
- 如何使用WebFilter实现授权头检查 2022-01-01
- 从 finally 块返回时 Java 的奇怪行为 2022-01-01
- value & 是什么意思?0xff 在 Java 中做什么? 2022-01-01