如何从GPS数据计算时区? [英] How do I calculate a time zone from GPS data?

查看:878
本文介绍了如何从GPS数据计算时区?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我的问题是关于获取经度的时区,是否还有其他准确的方法,而不是将经度值除以15来获得时区?

前面提到的方法适用于某些国家/地区,但并非所有国家/地区都适用,例如,约旦经度的首都安曼(Amman)为35.9349,将度数除以15得到2.39566的值四舍五入为最接近的整数得出2,即当前时间约旦安曼的区域对于许多地方都是正确的,但以马来西亚吉隆坡为例,其经度为101.707703,将度数除以15得到6.73333,将该值四舍五入为最接近的整数得到7,现在不是吉隆坡的时区,而是+8,世界各地的许多城市也是如此.

那么还有其他准确的方法可以计算出时区吗?

更新:我不得不说该应用程序将在运行自定义WinCE图像而没有Internet连接的GPS设备上运行. :)

谢谢大家,我非常感谢您提供的任何帮助.

问候,

Ayman

Hello guys,

My question is about getting a time zone form longitude, is there any other accurate method rather than dividing the longitude degree value by 15 to get the time zone?

The previous mentioned method works for some countries but not all, for instance, Amman the capital of Jordan''s longitude is 35.9349, dividing the degrees by 15 gives 2.39566 rounding this value to the nearest integer number gives 2, which is the current time zone for Amman, Jordan, the same is correct for a number of places, but take the case of Kuala Lumpur, Malaysia, its longitude is 101.707703, dividing the degrees by 15 gives 6.73333, rounding this value to the nearest integer number gives 7, which is not the current time zone in Kuala Lumpur, it is +8, the same case goes for a number of cities around the world.

So is there any other accurate way to figure out the time zone?

Update: I had to say that the application is going to run on a GPS device that runs custom WinCE image without internet connectivity. :)

Thank you guys and I really appreciate any possible help.

Regards,

Ayman

推荐答案

您可以使用 Geonames.org [^ ]可以给出基于纬度和经度的时区.
You could use Geonames.org[^] which can give the time zone based on latitude AND longitude.


不幸的是,时区大致遵循经度.您应将{latitude,经度}对与实际时区地图进行匹配.
:)
Unfortunately time zones roughly follows the longitude. You should match the {latitude, longitude} pair with the actual time zones map.
:)


这篇关于如何从GPS数据计算时区?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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