com.vividsolutions.jts.geom.Geometry类中的距离单位是多少? [英] What are the distance units in com.vividsolutions.jts.geom.Geometry class?

查看:2347
本文介绍了com.vividsolutions.jts.geom.Geometry类中的距离单位是多少?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们的VB.NET项目使用Vivid Solutoins的一个Java库(com.vividsolutions.jts.geom.Geometry)来做几何计算。帮助是在这里: http://tsusiatsoftware.net/jts/ javadoc / com / vividsolutions / jts / geom / Geometry.html



我无法弄清的是专门用于Buffer属性的单位,或者任何其他距离。我的程序正在处理航海里程,如果单位是度数,英里数,里程数,公里数,英寸等,文档中没有提供任何指示。有没有人使用过谁知道答案的图书馆?

解决方案

这是一篇旧文章,但这是任何正在寻找的人的答案,因为令人难以置信的是java文档没有声明该方法返回的单位。返回的距离为中心角度。然后,您可以使用任意数量的公式转换为您所需的测量单位。最简单的是转换为弧度。 1弧度= 180度除以pi(rad = 180deg / pi)。从那里,你可以乘以你选择的单位(例如6371公里)的地球平均半径来获得两点之间的距离。更准确的方法也是可用的,但你可以在网上查找它们。


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

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.

解决方案

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类中的距离单位是多少?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆