地址解析API和地理codeR [英] Geocoding API vs Geocoder

查看:250
本文介绍了地址解析API和地理codeR的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我为我的英语道歉,但与谷歌的翻译。在我的应用程序需要使用地理编码,但我不太清楚使用哪种方法。直到昨天我加在参数到网址 maps.googleapis.com/maps/api/geo$c$c/json?address=myparameter&sensor=false ,但谷歌的阻止我一天的请求,使得应用程序崩溃,因为它没有从地理编码请求返回任何结果。

I apologize for my English but translated with google. In my application I need to use the geocoding, but I have not quite clear which method to use. Until yesterday I added the parameters to the url maps.googleapis.com/maps/api/geocode/json?address=myparameter&sensor=false, but Google blocked me requests for a day, making crash the application because it did not return any results from the request for geocoding.

现在我使用的是地理codeR类,做同样的事情,我也看到了,你可以创建并使用对地理编码API密钥,哪种方法你的建议即可使用?正是这两种方法之间的区别,除了请求的限制?在此先感谢那些谁就会回应我。

Now I am using the Geocoder class that does the same thing and also I have seen that you can create and use an API key for Geocoding, which method do you recommend to use? what is the difference between the two methods, apart from the limitations of the requests? Thanks in advance to those who will respond to me.

推荐答案

如果您需要在您的应用程序使用地图,你应该使用称为API:谷歌地图Android版API V2

If you need to use a map in your app, you should use the API called: Google Maps Android API v2.

如果你需要管理地理codeD数据(地址为纬度/经度或反之亦然),然后启用地理编码的API,并开始使用类地理codeR。

If you need to manage geocoded data (address to lat/lng or viceversa) then enable Geocoding API and start using the class Geocoder.

例如(纬度/经度来解决):

For example (lat/lng to address):

Geocoder geocoder = new Geocoder(this, Locale.getDefault());
addresses = geocoder.getFromLocation(gps.getLatitude(),  gps.getLongitude(), 1); 

这篇关于地址解析API和地理codeR的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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