gpt4 book ai didi

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

转载 作者:太空狗 更新时间:2023-10-29 22:36:33 26 4
gpt4 key购买 nike

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

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com