問題描述
我們的 VB.NET 項目使用來自 Vivid Solutoins (com.vividsolutions.jts.geom.Geometry) 的 Java 庫來進(jìn)行幾何計算.幫助在這里: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 屬性的單位,或者與此相關(guān)的任何其他距離.我的程序正在處理海里,文檔沒有說明單位是度、英里、海里、公里、英寸等.
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 文檔沒有說明方法返回的單位.返回的距離以中心角為單位.然后,您可以使用任意數(shù)量的公式轉(zhuǎn)換為所需的計量單位.最簡單的是轉(zhuǎn)換為弧度.1 弧度 = 180 度除以 pi (rad=180deg/pi).從那里,您可以用您選擇的單位(例如 6371 公里)將弧度乘以地球的平均半徑,以獲得兩點之間的距離.也有更準(zhǔn)確的方法,但您可以在網(wǎng)上查找.
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.
這篇關(guān)于com.vividsolutions.jts.geom.Geometry 類中的距離單位是什么?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!