如何将这些坐标转换为Google Maps可读的坐标? [英] How do I convert these coordinates to coordinates readable by Google Maps?
问题描述
查看此页面上的地图坐标。这是从维基百科链接和坐标传递查询字符串。我不确定这个实际的术语,但是如何转换坐标?他们看起来像这样:
37°14'6N,115°48'40W
我希望他们看起来像这样:
37.235,-115.811111
,这是Google地图可读的格式,如这个例子。
我如何在PHP中执行此操作,什么是两种不同类型的坐标?
原始格式为小时,分钟,秒格式。要转换成十进制,请执行: 你的例子37,14,6变成了 如果纬度是N,那么结果是正数,如果S是负数。 Take a look at the map coordinates on this page. This is linked in from Wikipedia and the coordinates are passed the query string. I'm not sure of the actual terms for this but How do I convert the coordinates? They look like this: 37° 14′ 6″ N, 115° 48′ 40″ W I would like them to look like this: 37.235, -115.811111 , which is a format readable by Google maps, as seen in this example. How do I do this in PHP, and what are the two different types of coordinates called? The original format is in hours, minutes, seconds format. To convert to decimal, do: D = H + M/60 + s/3600 So in your example, 37,14,6 becomes 37 + 14/60 + 6/3600 = 37.235, as stated. If the latitude is N the result is positive, if S, negative.
If the longitude is E the result is positive. If west the result is negative. 这篇关于如何将这些坐标转换为Google Maps可读的坐标?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
37 + 14/60 + 6/3600 = 37.235,如上所述。
如果经度是E,结果是肯定的。如果西部的结果是负面的。