来自 NE 坐标的 Android 地理点

发布于 2024-11-16 21:05:28 字数 521 浏览 5 评论 0原文

在 Android 应用程序中,我想按照以下格式 50 27.858N,004 57.146E 的坐标设置地理点。我阅读了以下主题如何将坐标转换为geoPoint格式? 我只需要使用:

    new GeoPoint((int)(27.858*1E6),(int)(57.146*1E6)); 

除了这将我发送到伊朗并且请求的地点在比利时,正如您在这里看到的:http://maps.google.com/maps? geocode=&q=50+27.858N,004+57.146E

非常欢迎任何帮助,提前致谢!

In an android app, i would like to set geopoint from coordinates in the following format 50 27.858N,004 57.146E. I read on the the following thread how to convert coordinates to geoPoint format? that I just have to use:

    new GeoPoint((int)(27.858*1E6),(int)(57.146*1E6)); 

except that this is sending me to Iran and the requested point is in belgium as you can see here: http://maps.google.com/maps?geocode=&q=50+27.858N,004+57.146E

Any help would be trully welcome, thanks in advance!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

魔法唧唧 2024-11-23 21:05:28

您使用的数字是度分,即 50 度 + 27.858 分钟,地理点需要以度为单位,该位置的纬度为 50.464300,经度为 4.952433。
您可以将它们转换为整数,以节省浮点计算,即:

new GeoPoint(5046430,4952433);

每个度数分为 60 个部分,每个部分为度数的 1/60。这些部分称为分钟,因此要转换 50 度 27.858 分钟,您将得到 50 度 + 27.857 * 1/60 度,(27.857 * 1/60 = 0.4643),因此您的纬度为 50.46430。

The figures you are using are Degrees minutes ie, 50 degrees + 27.858 mins, geopoint needs it in degrees which for that location are lat 50.464300, lng 4.952433.
You can just convert these to integers to save doing a floating point calculation which would be :

new GeoPoint(5046430,4952433);

Each degree is split up into 60 parts, each part being 1/60 of a degree. These parts are called minutes so to convert 50 degrees 27.858mins, you would have 50 full degrees + 27.857 * 1/60 of a degree, (27.857 * 1/60 = 0.4643) so your lat is 50.46430.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文