views:

37

answers:

3

I wanted to create app that will longitude, latitude by zip and name of object (for example mcdonalds). I tried to do that via google maps geocoder but my idea was wrong because geocoder returned weird results. Maybe someone know a service or strategy of getting location by zip/name please let me know.

A: 

You can test out the Google Geocoder by using the same search string in the maps.google.com search box. For example "McDonalds 2000 Australia", returns appropriate geocoding results. Are you including the country? That might clarify the search results.

Cannonade
Hello,Unfortunately, I cannot find any place by its name by google maps api. For instance request by query "Phyllis' Giant Burgers San Rafael 94901 United States" return different results from maps.google.com and geocoder. So it seems geocoder can't find places like "Phyllis' Giant Burgers" at all instead maps.google.com.Maybe you know another service or some tool to solve this?Thanks.
Yuri Perevoznikov
A: 

reverse-geocoding from your tags means geolocation with given latitude and longitude.

If you want to geocode something you should just use Google Maps Geocode API.

http://maps.google.com/maps/api/geocode/json?address=Sydney&sensor=false

In result you have:

{
  "status": "OK",
  "results": [ {
    "types": [ "locality", "political" ],
    "formatted_address": "Sydney Nowa Południowa Walia, Australia",
    "address_components": [ {
      "long_name": "Sydney",
      "short_name": "Sydney",
      "types": [ "locality", "political" ]
    }, {
      "long_name": "Nowa Południowa Walia",
      "short_name": "NSW",
      "types": [ "administrative_area_level_1", "political" ]
    }, {
      "long_name": "Australia",
      "short_name": "AU",
      "types": [ "country", "political" ]
    } ],
    "geometry": {
      "location": {
        "lat": -33.8671390,
        "lng": 151.2071140
      },
      "location_type": "APPROXIMATE",
      "viewport": {
        "southwest": {
          "lat": -33.8764033,
          "lng": 151.1911066
        },
        "northeast": {
          "lat": -33.8578737,
          "lng": 151.2231214
        }
      },
      "bounds": {
        "southwest": {
          "lat": -33.8797030,
          "lng": 151.1970330
        },
        "northeast": {
          "lat": -33.8559920,
          "lng": 151.2229770
        }
      }
    }
  } ]
}

In results array you have result objects. Coordinates are just in geometry->location. Nothing simplier.

Here is reference: http://code.google.com/intl/pl-PL/apis/maps/documentation/geocoding/#GeocodingRequests

hsz
@hsz Seems like he is already using the Google Maps Geocoder : " tried to do that via google maps geocoder". I think his problem is with the arguments he is using.
Cannonade
It will be simplier if he will show us it. ;)
hsz
I added to request zip code, country, city and place that I need, but my request to geocoder return wrong result (Actually it's just result that returns if I don't type place's name at all). Example of query string - "Phyllis' Giant Burgers San Rafael 94901 United States". Maybe you see any solve of this problem anywhere, please let me know.
Yuri Perevoznikov
It seems that Geocoder finds only streets, etc - but not firms, pubs..
hsz
A: 

www.zipcode2business.com is this something similar to your application? Hopefully it helps :)

SuperRomia