使用地理codeR android系统中获取地址 [英] Get address using Geocoder in android

查看:142
本文介绍了使用地理codeR android系统中获取地址的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图通过给静态geocordinates得到的特定位置的地址。我无法获取地址。是否有人可以帮忙。我只需要检查是否这个功能对我的作品。

I tried to get the address of a particular location by giving static geocordinates. I was not able to fetch the address. Can someone please help. I just need to check whether this function works for me.

下面是我的代码段。

Geocoder geocoder = new Geocoder(AddressSimulator.this, Locale.getDefault());
        List<Address> addresses = geocoder.getFromLocation(1.352566007, 103.78921587, 1);
        System.out.println("Addresses size"+addresses.size());

地址长度是获得零。我试着用一些其他geocordinates还可以,但地址的大小总是返回为0的专家,请帮我解决这个问题。

Address size is obtained as zero. I tried with few other geocordinates also, but address size is always returned as 0. Experts, kindly help me resolve this.

期待您的宝贵帮助/建议,

Looking forward for your valuable help/suggestions,

最好的问候, 罗尼

推荐答案

尝试从谷歌或RPC地理codeR之一。谷歌地图,你必须得到谷歌的关键。

Try the one from google or from rpc geocoder. For google maps you have to get a key from google.

有关地理codeR他们在每15秒只有一个请求来自同一个IP回应。

for geocoder they respond for only one request in every 15 sec from the same ip.

string geocoderUri = String.Format("http://maps.google.com/maps/geo?q={0},{1},{2}&output=csv"
                + "&key= < Your Key > ", street, city, state);

string geocoderUri = string.Format("http://rpc.geocoder.us/service/rest?address={0},{1},{2}", street, city, state);

这篇关于使用地理codeR android系统中获取地址的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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