0

So, take a look at the results for this:

http://maps.googleapis.com/maps/api/directions/json?origin=2160%20Barnes%20Ave,%20Bronx,%20NY&destination=2160%20Barnes%20Ave,%20Bronx,%20NY&sensor=false

In cleartext:

  • Origin: 2160 Barnes Ave, Bronx, NY
  • Destination: 2160 Barnes Ave, Bronx, NY

When I do the search, it returns:

  • 2160 Barnes Ave, Mt Vernon, NY

I'm highly suspect this is not expected behavior.

When I try the address in Google Maps, I get the correct location, so the address exists I'm not typing it wrong. https://maps.google.com/maps?q=2160+Barnes+Ave,+Bronx,+NY

Now look what happens when I search for the same street adding a "near Bronx, NY" clause:

http://maps.googleapis.com/maps/api/directions/json?origin=2160%20Barnes%20Ave,%20Bronx,%20NY%20near%20Bronx,%20NY&destination=2160%20Barnes%20Ave,%20Bronx,%20NY&sensor=true

Is there something I'm doing wrong? As of now, I feel like I would have to search for:

{Address}, {City}, {State} near {City}, {State}

If I put the zip code, it works fine, but I won't always have the zip code available.

Google's support group says that I should use StackOverflow vs official forums. So... help?

ShortFuse
  • 5,970
  • 3
  • 36
  • 36

1 Answers1

0

Change 2160 to 2162 and you're done! :-)

Working link:

http://maps.googleapis.com/maps/api/directions/json?origin=2162%20Barnes%20Ave,%20Bronx,%20NY%20near%20Bronx,%20NY&destination=2162%20Barnes%20Ave,%20Bronx,%20NY&sensor=true

This probably happens because 2160 Barnes Ave, Bronx, NY, does not exist, while 2160 Barnes Ave, Mt Vernon, NY as well as 2162 Barnes Ave, Bronx, NY do.

Marcelo
  • 9,387
  • 3
  • 35
  • 40
  • I don't have a response code from Google that says the address doesn't exist. It gives me a different address. I also don't think this is a "fix", just an observance. If it "doesn't exist", then why does it find it when I put a zip code? Here's a further observance: [Google Maps Search](https://maps.google.com/maps?saddr=2160+Barnes+Ave,+Bronx,+New+York&daddr=2160+Barnes+Avenue,+Mount+Vernon,+NY&disamb=0) Google says it exists in 3 locations. That's the bug. – ShortFuse Aug 13 '12 at 13:54
  • There is no such thing as a response saying that an address doesn't exist. The geocoder just returns a full response for whatever it considers "the nearest point" to the given address, and if you add the zip code it just puts the marker at the centroid of the zip code. Notice that in the link you posted for maps.google.com the streetview image in the left is pointed down the road while if you change to 2162 it points at an actual building. On that same link try zooming in and right click next to the marker. then select "what's here?" and notice how the reverse geocoding changes to 2162. – Marcelo Aug 13 '12 at 14:17
  • You're missing the point that it's pulling 3 other points that don't make sense. Am I to believe that is NOT a bug and Google has a list of blacklisted (or whitelisted) house numbers in addresses. If that's the case, why do the other three addresses exist that are complete bogus? (Namely, zip codes 10466 and 10467). Also, if you didn't notice 2160 Barnes Ave does not exist in Mt Vernon, NY. It's the same street name (a continuation from the Bronx) and the house numbers on that block in Mt Vernon only go from between 4800 and 4900. (2011 Census data) – ShortFuse Aug 13 '12 at 20:18
  • I found the bug. https://maps.google.com/maps/place?hl=en&ftid=0x89c2f2cc31e4be6b:0xa37a944fd7283a8 Google is listing that all numbers from 2 to 4828 exist at the street node in Mt Vernon causing messed up results. – ShortFuse Aug 13 '12 at 20:25