使用谷歌地图查找给定邮政编码的所有公园 [英] Find all parks for a given zipcode with google maps

查看:219
本文介绍了使用谷歌地图查找给定邮政编码的所有公园的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用 Google maps geocode API 返回所有公园为一个给定的邮政编码。看来如果我有一个公园名称,我没有问题返回数据。例如
http:/ /maps.googleapis.com/maps/api/geocode/json?address=Kerry+Park+98122&sensor=false

I'm trying to use the Google maps geocode API 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 http://maps.googleapis.com/maps/api/geocode/json?address=Kerry+Park+98122&sensor=false

但是,如果我搜索用于邮政编码的公园
http://maps.googleapis.com/maps/api/geocode/json?address=Parks+near+98122&sensor=false

However, if i search for parks for a zip code http://maps.googleapis.com/maps/api/geocode/json?address=Parks+near+98122&sensor=false

我在地址中使用 parks 的邮政编码获取任何结果。我尝试使用 lanlng 但是有同样的问题。似乎谷歌不允许类型[] 查询结果是不幸的。

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.

如果我在 maps.google.com 我得到所有的结果,但似乎没有使用相同的API。

If I search for "parks near 98122" on maps.google.com I get all the results but it doesn't seem to be using the same API.

我要求 Google maps Places api key我认为这是我需要的。

I requested a Google maps Places api key which I think is what I need.

我想我的问题是:

a)我在这里缺少什么?

b)我没有停留在Google API是他们的其他人,将通过zip输出所有公园的JSON结果。我简短地看了一下Bing和Yahoo,没有用。

I guess my questions are:
a) am I missing something here?
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.

谢谢。

推荐答案

Google地址解析器API没有在查询中指定类型(如park)的条款。它将在响应中识别功能类型,但不能将其放在请求中。

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.

您可以在Google地方中执行所需操作API,现在开发者预览。我还没试过您仍然无法在请求中指定类型,但是您指定了位置和半径,并返回所有位置,并且每个位置都有一个或多个关联的类型代码(可能包括驻留)。您可以搜索返回的结果,看看是否出现公园。请参阅 http://code.google.com/apis/maps/documentation/places/

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 http://code.google.com/apis/maps/documentation/places/

这篇关于使用谷歌地图查找给定邮政编码的所有公园的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆