how to convert between degrees, minutes, seconds to Decimal coordinates(如何在度、分、秒之间转换为十进制坐标)
问题描述
寻找 java 实用程序.如果你能告诉我如何使用geotools库来做就更好了.
Looking for a java utility. It is even better if you can tell me how to do it using geotools library.
推荐答案
你所说的十进制坐标"是指经纬度(也称为十进制度)吗?如果是这样,那么您要做的事情就很简单了:
By "Decimal coordinates" do you mean latitude and longitude (also known as the decimal degree)? If so, what you're trying to do is pretty easy:
给定一个 DMS(度、分、秒)坐标,例如 W87°43′41″,使用以下方法:计算总秒数,43′41″ = (43*60 + 41) = 2621
秒.小数部分是总秒数乘以 3600.2621/3600 = ~0.728056 将分数度数加到整数上产生最终结果的度数:87 + 0.728056 = 87.728056
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
因为是西经坐标,所以否定结果.最终结果是-87.728056.
Since it is a West longitude coordinate, negate the result. The final result is -87.728056.
来自 维基百科.这是一个 Javascript 小部件,它做同样的事情.
From Wikipedia. Here's a Javascript widget that does the same thing.
这篇关于如何在度、分、秒之间转换为十进制坐标的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:如何在度、分、秒之间转换为十进制坐标


基础教程推荐
- 降序排序:Java Map 2022-01-01
- Java:带有char数组的println给出乱码 2022-01-01
- 减少 JVM 暂停时间 >1 秒使用 UseConcMarkSweepGC 2022-01-01
- 在 Libgdx 中处理屏幕的正确方法 2022-01-01
- “未找到匹配项"使用 matcher 的 group 方法时 2022-01-01
- 如何使用 Java 创建 X509 证书? 2022-01-01
- Java Keytool 导入证书后出错,"keytool error: java.io.FileNotFoundException &拒绝访问" 2022-01-01
- 无法使用修饰符“public final"访问 java.util.Ha 2022-01-01
- 设置 bean 时出现 Nullpointerexception 2022-01-01
- FirebaseListAdapter 不推送聊天应用程序的单个项目 - Firebase-Ui 3.1 2022-01-01