How to convert GPS coordinates into Google map Coordinates [duplicate]

江枫思渺然 提交于 2019-12-14 00:13:08

问题


I want to convert GPS coordinates into Google map coordinates so I can use them in Google map in my website.

GPS coordinates are lat : 4113.53948N (ddmm.mmmm) long : 00131.89855E (dddmm.mmmm)

If there is any formula exist then please I need it so I can use in php.


回答1:


Just to show the flexibility of an oft-forgotten PHP function that's actually extremely powerful for parsing strings:

$value = '4113.52318N';

sscanf($value, '%2d%f%s', $degrees, $minutes, $hemisphere);

var_dump($degrees, $minutes, $hemisphere);

and

$value = '00131.89855E';

sscanf($value, '%3d%f%s', $degrees, $minutes, $hemisphere);

var_dump($degrees, $minutes, $hemisphere);

PHP Docs for the sscanf() function



来源:https://stackoverflow.com/questions/36948904/how-to-convert-gps-coordinates-into-google-map-coordinates

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