Sorry to bump, but it seems that the GmmGeocoder service only uses a
couple of actual addresses. "White" yields a couple of cities in the
States, whereas "New York" does nothing. Can anyonne confirm that?

On Feb 22, 12:55 am, "Dan U." <[EMAIL PROTECTED]> wrote:
> Megha is correct in that it's not supported, but if you are looking
> for *actual* functionality in order to impress challenge judges,
> Geocoder falls flat on its face. It's sort of a tradeoff on what you
> want. Personally, I'd like to impress the judges now and change my
> code later to use the supported api when it performs acceptably. I can
> only hope either Geocoder works well in the next sdk or thatGmmGeocoderis 
> still there. If not, I might not upgrade prior to
> challenge submission.
>
> On Feb 21, 3:43 pm, "Megha Joshi" <[EMAIL PROTECTED]> wrote:
>
> > Hi,
>
> > TheGmmGeocoderAPI should not be used. It is not supported in the current
> > release of the SDK.
>
> > Please see the code below for an example of using GeoCoder APIs:
>
> > public class MyGeocoder implements Runnable {
>
> >     public void run() {
> >         Locale locale = new Locale("en", "us");
> >         Geocoder g = new Geocoder(locale);
> >         try {
> >             Address[] addresses1 =
> >                 g.getFromBusinessName("Zachary's Chicago Pizza",
> >                                       0.0, 0.0, 180.0, 360.0);
> >             if (addresses1 == null) {
> >                 throw new RuntimeException();
> >             }
> >             HashSet<String> addrSet = new HashSet<String>();
> >             for (Address a : addresses1) {
> >                 addrSet.add(a.getAddressLine(0));
> >             }
>
> >             if (addrSet.size() != 3) {
> >                 throw new RuntimeException();
> >             }
> >             if (!addrSet.contains("5801 College Ave")) {
> >                 throw new RuntimeException();
> >             }
> >             if (!addrSet.contains("1853 Solano Ave")) {
> >                 throw new RuntimeException();
> >             }
> >             if (!addrSet.contains("3110 Crow Canyon Road")) {
> >                 throw new RuntimeException();
> >             }
> >         } catch (IOException ioe1) {
> >             Log.e("GeocoderTest", "ioe1 = " + ioe1);
> >             throw new RuntimeException();
> >         }
>
> >         try {
> >             Address[] addresses2 =
> >                 g.getFromLocationName("1600 Pennsylvania Ave, Washington D.C
> > .",
> >                                       0.0, 0.0, 180.0, 360.0);
> >             if (addresses2 == null) {
> >                 throw new RuntimeException();
> >             }
> >             if (addresses2.length != 1) {
> >                 throw new RuntimeException();
> >             }
>
> >             Address addr = addresses2[0];
> >             if (!addr.getAddressLine(0).
> >                 equals("1600 Pennsylvania Ave NW")) {
> >                 throw new RuntimeException();
> >             }
> >             if (!addr.getAddressLine(1).
> >                 equals("Washington, DC 20006")) {
> >                 throw new RuntimeException();
> >             }
> >             if (!addr.getLocality().equals("Washington")) {
> >                 throw new RuntimeException();
> >             }
> >             if (!addr.getRegion().equals("DC")) {
> >                 throw new RuntimeException();
> >             }
> >             if (!addr.getPostalCode().equals("20006")) {
> >                 throw new RuntimeException();
> >             }
> >             if (Math.abs(addr.getLatitude() - 38.898763) > 0.1) {
> >                 throw new RuntimeException();
> >             }
> >             if (Math.abs(addr.getLongitude() - (-77.036655)) > 0.1) {
> >                 throw new RuntimeException();
> >             }
> >         } catch (IOException ioe2) {
> >             Log.e("GeocoderTest", "ioe2 = " + ioe2);
> >             throw new RuntimeException();
> >         }
> >     }
>
> > }
>
> > Let us know if you face any issues..
> > Also, you can use a *BUMP* to highlight posts where you don't find a
> > solution after lots of discussions and we will try to address them :)
>
> > Thanks,
> > Megha
>
> > On Thu, Feb 21, 2008 at 11:41 AM, Dan U. <[EMAIL PROTECTED]> wrote:
>
> > > I attempted to useGmmGeocoderfor this. What I saw was that
> > > apparently the query type integer that got passed in and sent to
> > > googles glm server (http://www.google.com/glm/mmap) for reverse
> > > lookups was incorrect. I don't know what the correct one is, or if
> > > there is one. I instead tried QUERY_TYPE_LOCATION as the type and got
> > > a response. It was smart enough to parse the lat/long into degrees/
> > > minutes/seconds, but not enough to tell me any address information. It
> > > looks to me like reverse geocoding is not working yet, but I might be
> > > wrong.
>
> > > On Feb 21, 12:45 am, rezar <[EMAIL PROTECTED]> wrote:
> > > > Hi
>
> > > > Does anybody make any success using geoCoder to convert location to
> > > > address ?
> > > > Few days ago there are lots of discussion, but nobody was successful.
>
> > > > Thank you
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to