什么是通过谷歌在Java中获得一个地址经度和纬度的最佳途径 [英] What is the best way to get longitude and latitude for an address via Google in java
问题描述
我试着写一些Java codeS正从地址位置。 (不是在Android的环境。)
I'm trying to write some java codes getting locations from address. (not in android environment.)
如果可能的话,我想这是永久的方式,只要谷歌在某种程度上提供地理位置服务。
If possible, I want it to be permanent way as long as Google provides geo-location services in somehow.
我想我不能说谷歌的JavaScript地理位置API使用永久网址要做到这一点,因为API的对象是来自在运行时谷歌服务器。
I think I cannot say Google javascript geolocation apis uses permanent URL to do that, since the api's Object is to come from Google server at runtime.
不过,我觉得这似乎是可能的Android可能会使用永久网址要做到这一点,因为谷歌是无法更改的每个设备的网址,通过该设备获得地理定位服务。
However I think it seems to be possible that Android might use a permanent URL to do that since Google is not able to change every device's URLs through which devices get the geolocation services.
难道我错了吗?
有没有解决谷歌的政策有关呢?
Am I wrong? Is there any addressed Google policy concerning it?
先谢谢了。
推荐答案
您可以尝试使用谷歌API的HTTP获取地理编码和反向地理编码。
You may try to use the Google HTTP APIs for getting geocoding and reverse-geocoding.
地址解析请求
一个地址解析API请求必须是以下形式:
A Geocoding API request must be of the following form:
http://maps.googleapis.com/maps/ API /地理code /输出?参数
在这里输出可以是以下值:
where output may be either of the following values:
JSON(推荐)表示以JavaScript对象符号输出(JSON)
xml表示以XML输出
json (recommended) indicates output in JavaScript Object Notation (JSON) xml indicates output as XML
按照此链接了解更多: https://developers.google.com/maps/documentation /地理编码/
Follow this link for more:https://developers.google.com/maps/documentation/geocoding/
这篇关于什么是通过谷歌在Java中获得一个地址经度和纬度的最佳途径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!