正在寻找 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.728056Since 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/