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

前端 未结 3 1639
暗喜
暗喜 2020-12-30 17:16

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

3条回答
  •  时光说笑
    2020-12-30 17:28

    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

提交回复
热议问题