java - 如何将度、分、秒转换为十进制坐标

标签 java geolocation geospatial geotools

正在寻找 Java 实用程序。如果你能告诉我如何使用 geotools 库来做就更好了。

最佳答案

“小数坐标”是指纬度和经度(也称为十进制度)吗?如果是这样,那么您要做的事情就很简单了:

Given a DMS (Degrees, Minutes, Seconds) coordinate such as W87°43′41″, it's trivial to convert it to a number of decimal degrees using the following method: Calculate the total number of seconds, 43′41″ = (43*60 + 41) = 2621 seconds. The fractional part is total number of seconds divided by 3600. 2621 / 3600 = ~0.728056 Add fractional degrees to whole degrees to produce the final result: 87 + 0.728056 = 87.728056

Since it is a West longitude coordinate, negate the result. The final result is -87.728056.

来自 Wikipedia .这是一个 Javascript widget做同样的事情。

关于java - 如何将度、分、秒转换为十进制坐标,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8263959/

相关文章:

javascript - 谷歌地图 API V3 Over_Query_Limit

r - 使用 lat long gstat R 的通用克里金法

java - Cordova插件错误

java - 列表迭代 - 通用逻辑

iphone - CLLocationManager didEnterRegion 错误通知

$near 和 $within 之间的 MongoDB 地理空间差异

algorithm - 存储距离敏感空间数据的最佳数据结构是什么?

Java错误 "Exception in thread "主要“java.lang.NullPointerException”

java - JHipster 如何在文件系统中保存文件?

android - 如何在 Android 手机上捕捉高度?