-1

Geocode returns postal_code value null for certain addresses and I am not able to do reverse address lookup to retrieve the zip at that level. An example address is "Peachtree Dunwoody Road, Atlanta, GA, United States" There is no street number; Dunwoody is also a city name in vicinity. It is not happening for all two words street names, but happening only if one of the word(second one in the street name) is also a city name.

It works for most of the cases but just a few certain types ie "Peachtree Street Northwest, Atlanta, GA, United States" The search is for "address". geoLocationScript: "https://maps.googleapis.com/maps/api/js?", geoLocationSensor: "sensor=false",

Is it a google glitch? and Is there any work around?

amitola
  • 16
  • 2
  • How are you getting the postal_code from the address? Please provide a [mcve] that demonstrates the issue. Note that some location entries returned by the geocoder won't have postal_codes (as you have discovered), the response for "Peachtree Dunwoody Road, Atlanta, GA, United States" is of type "GEOMETRIC_CENTER". A "road" doesn't have a postal code. – geocodezip Aug 14 '16 at 14:14

2 Answers2

2

Zip codes actually only correspond to mailing routes. "Peachtree Dunwoody Road, Atlanta, GA, United States" isn't a mailing address and as such Google is trying to give you the best results it can, balancing exactness with usefulness. It's likely that "Peachtree Dunwoody Road" traverses multiple zip codes, and Google returns a pin at a geometric center for the road (try the search in Maps) but doesn't try to guess a zip code. Zip codes can be complicated and it's probably best not to make a guess unless the entire street is contained in one zip code. For instance, sometimes, the east side of a road has one zip code but the west side has a different zip code.

As for whether there is a workaround or not, I believe the answer is no. To illustrate, you might look at the SmartyStreets demo site and fill in the address components as much as possible. I just tried "Peachtree Dunwoody Road, Atlanta, GA, United States." While I was typing, SmartyStreets suggested the following three results:

  • Peachtree Dunwoody Rd, Atlanta GA
  • W Peachtree Dunwoody Rd, Atlanta GA
  • Peachtree Dunwoody Rd NE, Atlanta GA

Full disclosure: I worked for SmartyStreets, an address validation company.

Joseph Hansen
  • 12,665
  • 8
  • 50
  • 68
0

Some location entries returned by the geocoder won't have postal_codes. The response for "Peachtree Dunwoody Road, Atlanta, GA, United States" is of type "GEOMETRIC_CENTER".

A "road" doesn't necessarily have a postal code (it isn't a postal address).

geocodezip
  • 158,664
  • 13
  • 220
  • 245
  • If I call same geocode function with "Lawrenceville Suwanee Rd, Suwanee, GA, United States" which is still road, then postal code returns. In fact, it has city name In it. – amitola Aug 14 '16 at 17:01
  • Perhaps that road is entirely contained in the postal_code, an example of a road that has a postal_code doesn't mean all roads have them. – geocodezip Aug 14 '16 at 17:26