如何将这些坐标转换为Google Maps可读的坐标? [英] How do I convert these coordinates to coordinates readable by Google Maps?

查看:293
本文介绍了如何将这些坐标转换为Google Maps可读的坐标?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

查看此页面上的地图坐标。这是从维基百科链接和坐标传递查询字符串。我不确定这个实际的术语,但是如何转换坐标?他们看起来像这样:



37°14'6N,115°48'40W



我希望他们看起来像这样:

37.235,-115.811111

,这是Google地图可读的格式,如这个例子



我如何在PHP中执行此操作,什么是两种不同类型的坐标?

解决方案

原始格式为小时,分钟,秒格式。要转换成十进制,请执行:

H = M + 60 + s / 3600

你的例子37,14,6变成了

37 + 14/60 + 6/3600 = 37.235,如上所述。

如果纬度是N,那么结果是正数,如果S是负数。
如果经度是E,结果是肯定的。如果西部的结果是负面的。


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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆