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 类中的距离单位是什么?
基础教程推荐
- 设置 bean 时出现 Nullpointerexception 2022-01-01
- 减少 JVM 暂停时间 >1 秒使用 UseConcMarkSweepGC 2022-01-01
- 如何使用 Java 创建 X509 证书? 2022-01-01
- 在 Libgdx 中处理屏幕的正确方法 2022-01-01
- FirebaseListAdapter 不推送聊天应用程序的单个项目 - Firebase-Ui 3.1 2022-01-01
- 无法使用修饰符“public final"访问 java.util.Ha 2022-01-01
- Java:带有char数组的println给出乱码 2022-01-01
- Java Keytool 导入证书后出错,"keytool error: java.io.FileNotFoundException &拒绝访问" 2022-01-01
- 降序排序:Java Map 2022-01-01
- “未找到匹配项"使用 matcher 的 group 方法时 2022-01-01