使用 J2ME 进行反向地理编码

发布于 2024-08-21 16:27:35 字数 151 浏览 8 评论 0原文

我的项目在 J2ME 上运行,需要我获取用户当前的街道地址。我能够使用基于位置的用户坐标。但我该如何获取街道地址?

我知道谷歌地图可以进行反向地理编码。但我如何将其链接到我的应用程序?还会有法律问题吗?

任何指导将不胜感激。谢谢!!!

凯文

My project runs on J2ME and requires me to get the user current street address. I am able to get the user coordinates using location based. But how do i go about getting the street address??

I know google map does the reverse geocoding. But how can i link that to my application?? And will there be any legal issues too??

Any guidance will be greatly appreciated. Thanks!!!

Kevin

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

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

发布评论

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

评论(3

半山落雨半山空 2024-08-28 16:27:35

Java ME 实际上将本机反向地理编码标准化为 JSR 293 Location API 2.0 的一部分:
http://www.j2megame.org /j2meapi/JSR_293_Location_API_2_0/index.html?javax/microedition/location/services/GeocodingServiceProvider.html

下面的文章中的“4.2.2.地理编码”部分描述了在 Java ME 中使用 Location API 2.0 进行反向地理定位:
http ://www.locationaware.usf.edu/wp-content/uploads/2011/09/Barbeau-Location-API-2.0-for-J2ME-COMCOM3573.pdf

然而,目前 JSR 293 尚未广泛实施商用 Java ME 移动电话,至少是在美国销售的移动电话。 相反,大多数电话仍然实现 JSR179 Location API 1.0。

Java ME does actually standardize native reverse geocoding as part of JSR 293 Location API 2.0:
http://www.j2megame.org/j2meapi/JSR_293_Location_API_2_0/index.html?javax/microedition/location/services/GeocodingServiceProvider.html

Section "4.2.2. Geocoding" in the below paper describes reverse geoding using Location API 2.0 in Java ME:
http://www.locationaware.usf.edu/wp-content/uploads/2011/09/Barbeau-Location-API-2.0-for-J2ME-COMCOM3573.pdf

However, currently JSR 293 is not widely implemented in commercially-available Java ME mobile phones, at least those available in the U.S. Instead, most phones still implement JSR179 Location API 1.0.

久光 2024-08-28 16:27:35

在 J2ME 应用程序中使用 Google 地图存在法律问题。 Google Maps API 只能在浏览器中使用。

请参阅本页第 10.8 节:http://code.google.com/apis/maps/ terms.html

Google 地图还对每个 IP 地址可以下载的唯一地图数量有限制。通常它对于任何基于 PC 的应用程序来说都足够了。然而,在移动设备上,许多设备将通过代理 Web 服务,以便许多设备具有相同的 IP 地址。因此,很快就达到了极限。

雅虎地图的条款和条件中没有此类限制,并且每个 IP 地址的限制要高得多。他们还将某些 IP 地址标记为代理服务器,因此它们不计入限制。我们已经将其用于商业用途。

至于反向地理编码,有 GeoNames webservice,尽管我个人没有使用过它。

There are legal issues with using Google Maps within J2ME apps. The Google Maps API can only be used from within a browser.

See 10.8 on this page: http://code.google.com/apis/maps/terms.html

Google Maps also has a limit on the number of unique maps you can download per ip address. Usually it would be good enough for any PC-based app. However, on mobile devices many devices will go via a proxy web service such that many devices have the same IP address. Because of that the limit is reached very quickly.

Yahoo Maps has no such restrictions in it's T&Cs and a much higher limit per ip address. They also flag certain ip address as proxy servers so they don't count towards the limits. We've used this commercially.

As for reverse GeoCoding, there is the GeoNames webservice, though I've not personally used it.

硪扪都還晓 2024-08-28 16:27:35

这是一个迟到的回复,但我实际上一直在寻找同样的东西,现在我终于做到了。

您需要做什么:

  • 通过在 J2ME 上打开 HTTP 连接向 Google 服务器发送请求,然后您将根据您请求的 HTTP 链接从 Google 获得 XML 或 JSON 形式的响应。
  • 解析此响应以便从 XML 或 JSON 文档中检索位置。
    • 对于 XML,我建议使用 kXML 1.2 解析器
    • 使用 json.org 解析器进行 JSON 解析。

如果你仍然坚持不下去,你可以给我发邮件,因为我已经经历了这个阶段:)。
给我发邮件[电子邮件受保护]

This is a late reply, but I was actually looking for the same thing and now I have finally done it.

What you need to do:

  • Send a request to the Google server by opening a HTTP connection on J2ME and then you will get response from Google either in XML or JSON based on the HTTP link you request.
  • Parse this response in order to retrieve the location from the XML or JSON document.
    • For XML, I would suggest using kXML 1.2 Parser
    • For JSON parsing using the json.org parser.

You can send me a mail if you are still stuck with it since I am through that phase already :).
Mail me at [email protected]

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