1
votes

This is a followup question to another I recently had about the Google Maps API.

The following request returns zero results...

http://maps.googleapis.com/maps/api/geocode/json?address=801+BALTIMORE+STREET%2c+Hanover%2c+PA%2c+17331&sensor=false

However, from http://maps.google.com the following address locates correctly...

801 Baltimore Street, Hanover, PA

From the previous question the answer was because the result returned from maps is a "place" and not an "address".

My new question is how can you tell maps is returning a "place" vs and "address"? Is there something in the URL or the response that gives this away?

2

2 Answers

1
votes

If you look at the response on Google Maps, notice the "3 reviews", that is a places entry. The way the entry reads also indicates it to me:

Giant
801 Baltimore St, Hanover, PA ‎
(717) 632-6673 ‎ · giantfoodstores.com
3 reviews 

It seems that the link above doesn't work the first time, but if you click on the "search" it finds it.

0
votes

geocodezip:

thanks for the response.

assuming that the google maps web utilizes the places API, I tried to get the same result from places API.

for this address: 526+Kawailoa+Road,Kailua,Oahu,HI+96734 google maps does find the correct location. but geocoding API fails, so I try the places API:

curl -v 'https://maps.googleapis.com/maps/api/place/textsearch/json?query=526+Kawailoa+Road,Kailua,Oahu,HI+96734&key=MY_API_KEY'

it returns a empty list. so why does the maps web page finds it but neither places API nor geocoding API finds it?

Thanks Yang