I'm trying to use the <a href="http://code.google.com/apis/maps/documentation/geocoding/" rel="nofollow">Google maps geocode API</a> to return all parks for a given zip code. It seems that if I have a park name I have no problem returning the data. Such as <a href="http://maps.googleapis.com/maps/api/geocode/json?address=Kerry+Park+98122&sensor=false" rel="nofollow">http://maps.googleapis.com/maps/api/geocode/json?address=Kerry+Park+98122&sensor=false</a>
However, if i search for parks for a zip code <a href="http://maps.googleapis.com/maps/api/geocode/json?address=Parks+near+98122&sensor=false" rel="nofollow">http://maps.googleapis.com/maps/api/geocode/json?address=Parks+near+98122&sensor=false</a>
I get any result for the zip code with
parks in the address. I tried using
lanlng but that has the same problem. It seems that Google doesn't allow
types in query just the results which is unfortunate.
If I search for "parks near 98122" on <a href="http://maps.google.com/maps?f=q&source=s_q&hl=en&geocode=&q=Parks%20Near%2098122&aq=&sll=47.616302,-122.353482&sspn=0.014378,0.038409&ie=UTF8&hq=Parks&hnear=Seattle,%20Washington%2098122&t=h&z=14" rel="nofollow">maps.google.com</a> I get all the results but it doesn't seem to be using the same API.
I requested a <a href="http://code.google.com/apis/maps/documentation/places/" rel="nofollow">Google maps Places api</a> key which I think is what I need.
I guess my questions are:<br /> a) am I missing something here?<br /> b) I'm not stuck with Google API are their others that will output JSON results for all parks by zip. I looked briefly into Bing and Yahoo to no avail.
The Google geocoder API doesn't have a provision for specifying a "type" such as "park" in the query. It will identify the feature type in the response, but you can't put it in the the request.
You might be able to do what you want in the Google Places API, now out for developer preview. I haven't tried it. You still can't specify a type in the request, but you specify a location and radius, and it returns all places, and each place has one or more associated type codes (which might include park). You can search through the returned results to see if parks appear. See <a href="http://code.google.com/apis/maps/documentation/places/" rel="nofollow">http://code.google.com/apis/maps/documentation/places/</a>Answer2:
Use Google Places API and the text search.
Change the [zipcode] and the key [apikey]: