在 Google 地图中查找最近的公交站/中途停留地(公共汽车、火车等)

发布于 2024-09-06 12:26:26 字数 99 浏览 3 评论 0原文

是否可以找到最近的公共汽车、火车或其他公共交通工具?

“最近的”是一个单独的案例,但是否有可能找到它们?

它们已被标记,但我想知道如何访问/找到它们。

Is it possible to find the nearest bus, train, or other public transit?

The 'nearest' is a separate case, but is it just possible to find them?

They are tagged, but I want to know how to access/find them.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

↙温凉少女 2024-09-13 12:26:26

我认为 Google 地图尚不支持此功能,可以查找某个地点附近的公共交通位置。

我能想到的唯一解决方法是使用您想要获得最近公共交通的位置作为方向计算的起点。
作为目的地,您可以选择任何距离较远但足够远的随机位置,因此该路线需要公共交通(而不仅仅是步行)。
然后您可以从结果数据中获取第一条公共交通。

例如:
如果您计算了这样的路线:

http://maps.google.com/maps?f=d&source=s_d&saddr=15+Vanderbilt+Avenue,+New+York,+NY+10017+(Grand+Central+终端)&daddr=central+park&hl=en&geocode=CUdYBSaiyFjNFWbXbQIdIDOX-yFZWQrti_yyniknhhaRAVnCiTHFY7RT82_HCg%3BFT0ebgIdVT6X-yn1xwsBmljCiTG2GSD9L5ZZwQ&mra=pe&mrcr=0& dirflg=r&ttype=dep&日期=06%2F22%2F10&时间= 10:34am&noexp=0&noal=0&sort=&sll=40.764379,-73.974187&sspn=0.093872,0.154324&ie=UTF8&z=15&start=0

您只需添加参数 &output=json 到 url 中,可以获取 json 格式的数据。

http://maps.google.com/maps?f=d&source=s_d&saddr=15+Vanderbilt+Avenue,+New+York,+NY+10017+(Grand+Central+Terminal)&daddr =central+park&hl=en&geocode=CUdYBSaiyFjNFWbXbQIdIDOX-yFZWQrti_yyniknhhaRAVnCiTHFY7RT82_HCg%3BFT0ebgIdVT6X-yn1xwsBmljCiTG2GSD9L5ZZwQ&mra=pe&mrcr=0&dirflg=r& ttype=dep&日期=06%2F22%2F10&时间=10:34am&noexp =0&noal=0&sort=&sll=40.764379,-73.974187&sspn=0.093872,0.154324&ie=UTF8&z=15&start=0&output=json

在此示例中,您将乘坐“巴士M02”作为第一条公共交通。

但这确实是一个非常糟糕的解决方法。我认为必须等到谷歌为此开放 API。

I don't think that this is supported in Google Maps yet, finding the nearby public transport locations of a spot.

The only workaround I could think of is to use the location you want to get the nearest public transportation as a starting point of a directions calculation.
As the destination, you choose any random location that's a little away but far enough so the route would require a public transportation (not just walking).
Then you could fetch the first public transportation from the resulting data.

For example:
if you have calculated a route like this:

http://maps.google.com/maps?f=d&source=s_d&saddr=15+Vanderbilt+Avenue,+New+York,+NY+10017+(Grand+Central+Terminal)&daddr=central+park&hl=en&geocode=CUdYBSaiyFjNFWbXbQIdIDOX-yFZWQrti_yyniknhhaRAVnCiTHFY7RT82_HCg%3BFT0ebgIdVT6X-yn1xwsBmljCiTG2GSD9L5ZZwQ&mra=pe&mrcr=0&dirflg=r&ttype=dep&date=06%2F22%2F10&time=10:34am&noexp=0&noal=0&sort=&sll=40.764379,-73.974187&sspn=0.093872,0.154324&ie=UTF8&z=15&start=0

you would just add the parameter &output=json to the url and could fetch the data as json format.

http://maps.google.com/maps?f=d&source=s_d&saddr=15+Vanderbilt+Avenue,+New+York,+NY+10017+(Grand+Central+Terminal)&daddr=central+park&hl=en&geocode=CUdYBSaiyFjNFWbXbQIdIDOX-yFZWQrti_yyniknhhaRAVnCiTHFY7RT82_HCg%3BFT0ebgIdVT6X-yn1xwsBmljCiTG2GSD9L5ZZwQ&mra=pe&mrcr=0&dirflg=r&ttype=dep&date=06%2F22%2F10&time=10:34am&noexp=0&noal=0&sort=&sll=40.764379,-73.974187&sspn=0.093872,0.154324&ie=UTF8&z=15&start=0&output=json

In this sample you would get "Bus M02" as the first public transportation.

But this is really a very bad workaround. I think gotta wait until Google opens the API for that.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文