用于将UTM坐标转换为纬度和经度的开源PHP函数吗? [英] Open source PHP function for converting UTM coordinates to latitude and longitude?

查看:88
本文介绍了用于将UTM坐标转换为纬度和经度的开源PHP函数吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在制作一个涉及Google Maps的PHP应用程序.地图仅接受 lat& lng 对,而我要显示的数据仅带有UTM样式坐标.是否有开放源代码的PHP函数可以将一个函数转换为另一个函数?

I'm making a PHP application involving Google Maps. Maps only accepts lat&lng pairs, and the data I want to display comes only with UTM style coordinates. Is there an open-source PHP function to convert from one to the other?

这样的事情会很棒:

$UTM_ZONE = '32';
$UTMX = '60329834,34';
$UTMY = '67382984,9';

$latlng = convert($UTM_ZONE, $UTMX, $UTMY);

// $latlng = now looks like
// array('lat' => '59.4472917501', 'lng' => '5.3928572425')

推荐答案

我发现某种肮脏的类可以完成这项工作.肮脏的意思是,函数名称很奇怪,代码的格式不是很简洁,但是确实可以完成工作.

I've found sort of a dirty class that does the job. By dirty I mean that the function names are wonky and the code isn't very prettily formatted, but it does indeed do the job.

如果我找到更好的课程,我将确保更新此答案

I'll be sure to update this answer if I find any better classes

这篇关于用于将UTM坐标转换为纬度和经度的开源PHP函数吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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