Geocoding is OK, but how to do Reverse Geocoding ??

Put problem concerning MapActivities, MapViews, Overlays and GPS in this forum.

Geocoding is OK, but how to do Reverse Geocoding ??

Postby nithin.warier » Fri May 09, 2008 10:22 am

Hi plusminus,

please tell how to do reverse geocoding,
I have the latitude and longitude, from that i want the location name or address

Thanks
Nithin
nithin.warier
Experienced Developer
Experienced Developer
 
Posts: 87
Joined: Thu Feb 28, 2008 12:05 pm
Location: Malappuram Kerala India

Top

Postby nithin.warier » Fri May 09, 2008 2:22 pm

plusminus,

myLocationManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE);
loc = myLocationManager.getCurrentLocation("mobeegal");
lat = loc.getLatitude() * 1E6;
GmmGeocoder geocoder = new GmmGeocoder(Locale.getDefault());
Address[] addresses = geocoder.query("chennai", GmmGeocoder.QUERY_TYPE_REVERSE_GEOCODE, lat, lng, 0, 0);

but i am getting null pointer exception.. igave proper permission and all.. but still showing error, null pointer exception

the error is in the line
Address[] addresses = geocoder.query("chennai", GmmGeocoder.QUERY_TYPE_REVERSE_GEOCODE, lat, lng, 0, 0);

please send the solution....i need it urgently... thsi prob is killing my time..
nithin.warier
Experienced Developer
Experienced Developer
 
Posts: 87
Joined: Thu Feb 28, 2008 12:05 pm
Location: Malappuram Kerala India

Postby coding_android » Fri May 09, 2008 2:28 pm

You could use the following webservice:

http://www.geonames.org/export/ws-overview.html

Here is an example URL: http://ws.geonames.org/findNearbyPlaceN ... 47.3&lng=9

You get back a xml file with the country in it. It looks quite good.

Regards!
User avatar
coding_android
Moderator
Moderator
 
Posts: 76
Joined: Mon May 05, 2008 10:22 am
Location: Germany

Postby nithin.warier » Fri May 09, 2008 2:55 pm

hi coding_android,

thanks for your reply.. but that not i neede... i searched those sites, but didnt get anything useful for me...
nithin.warier
Experienced Developer
Experienced Developer
 
Posts: 87
Joined: Thu Feb 28, 2008 12:05 pm
Location: Malappuram Kerala India

Postby nithin.warier » Fri May 09, 2008 4:13 pm

I am not looking for mock reverse geocoding..

import com.google.android.location.GmmGeocoder;

using this, we can do real geocoding, so is there any way to do reverse geocoding

waiting for some reply............
nithin.warier
Experienced Developer
Experienced Developer
 
Posts: 87
Joined: Thu Feb 28, 2008 12:05 pm
Location: Malappuram Kerala India

Postby coding_android » Fri May 09, 2008 9:31 pm

Hmm could you explain me the difference between real and not real geo coding.

I can only find that class for mock geocoding and reverse geocoding:

http://code.google.com/android/referenc ... coder.html

I don't know where you find the class you mentioned above.
User avatar
coding_android
Moderator
Moderator
 
Posts: 76
Joined: Mon May 05, 2008 10:22 am
Location: Germany

Top

Postby nithin.warier » Sat May 10, 2008 4:51 am

http://www.androidjavadoc.com/m5-rc15/c ... frame.html

in this GmmGeocoder is there and its not mock....

GmmGeocoder geocoder = new GmmGeocoder(Locale.getDefault());
Address[] addresses = geocoder.query("chennai", GmmGeocoder.QUERY_TYPE_LOCATION, 0, 0,180,360);

if you give like this , you can get the address of any location in google map.......

thanks
Nithin
nithin.warier
Experienced Developer
Experienced Developer
 
Posts: 87
Joined: Thu Feb 28, 2008 12:05 pm
Location: Malappuram Kerala India

Top

Return to Map Problems

Who is online

Users browsing this forum: No registered users and 3 guests