Converting Latitude/Longitude values(DMS+Compass Direction format) to corresponding Decimal Point values in Android

北慕城南 提交于 2019-12-18 12:39:12

问题


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, 26°56'59''E

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

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

Thank you


回答1:


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.

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




回答2:


D°M'S''

  1. Divide S by 60 and get X
  2. Find Y by adding X to M
  3. Divide Y by 60 to get F
  4. Answer = D + F

SUMMARY

TO CONVERT FROM DMS TO DEGREE

Degrees = D + ((S/60)+M)/60

Where D and M and S are the values that compose the DMS format : D°M'S''




回答3:


And you can always check your work with Sherif's formula here: http://transition.fcc.gov/mb/audio/bickel/DDDMMSS-decimal.html



来源:https://stackoverflow.com/questions/6945008/converting-latitude-longitude-valuesdmscompass-direction-format-to-correspond

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!