本文介绍了转换纬度/经度值(DMS +罗盘方向格式)到Android中相应的小数点值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我工作的一个Java的Andr​​oid项目,并具有以下问题。搜索我这么多,但我仍然有转换在DMS格式是纬度/经度值的问题(例如:38°2'56''N,122°9'28''W)为其对应的十进制度格式。

I am working on an Java android project and have the following issue. I Searched so much but still I have the problem of converting the Latitude/Longitude values that are in DMS format (Eg: 38°2'56''N, 122°9'28''W) for their corresponding Decimal Degrees format.

需要将其转换为它们对应的十进制度格式示例值。

Example values that need to be converted for their corresponding decimal degrees format.

38°49'59''N,2​​6°56'59''E

38°49'59''N, 26°56'59''E

38°2'56''N,122°9'28''W

38°2'56''N, 122°9'28''W

34°52'58''S,56°10'58''W

34°52'58''S, 56°10'58''W

感谢您

推荐答案

所有当你DMS转换为十进制度,你正在做的是用60除以小号除以60,将其添加到M,除以60的结果,然后将其添加到D

All you're doing when you convert DMS to decimal degrees is dividing by 60. Divide S by 60, add it to M, divide that result by 60, then add it to D.

第二部分涉及的方向的坐标点。想象一对轴带指南针的方向在正确的地点(即上升为N,右边是E,下来是S,左边的是W)。这意味着,对应于一个DMS值指出既无S或W的任何小数度值将是负的。

The second part deals with the direction that the coordinates point. Picture a pair of axes with compass directions in their correct locations (i.e., up is N, right is E, down is S, left is W). This means that any decimal degree value corresponding to a DMS value that pointed either S or W is going to be negative.

38°2'56''N,122°9'28''是W - > 38.048889, -122.157778

38°2'56''N, 122°9'28''W -> 38.048889, -122.157778

这篇关于转换纬度/经度值(DMS +罗盘方向格式)到Android中相应的小数点值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-12 19:23