gpt4 book ai didi

google-places-api - Google Places API 类型机场

转载 作者:行者123 更新时间:2023-12-04 05:39:37 26 4
gpt4 key购买 nike

我正在为运输行业的客户构建一个网站,我正在使用 Google Places API 获取上车地点和目的地。如果接机地点是机场,则一项要求是显示“航类号”字段。

为了确定机场是否从 Google Maps API 返回,我们查看位置的“类型”属性。

这适用于大多数情况,例如“Brisbane International Airport, Brisbane Airport, Queensland, Australia”,但不适用于其他一些情况,例如“Brisbane Airport, Queensland, Australia”。

Object {address_components: Array[3], adr_address: "<span class="locality">Brisbane Airport</span> <sp…pan>, <span class="country-name">Australia</span>", formatted_address: "Brisbane Airport QLD, Australia", geometry: Object, icon: "http://maps.gstatic.com/mapfiles/place_api/icons/geocode-71.png"…}
address_components: Array[3]
adr_address: "<span class="locality">Brisbane Airport</span> <span class="region">QLD</span>, <span class="country-name">Australia</span>"
formatted_address: "Brisbane Airport QLD, Australia"
geometry: Object
html_attributions: Array[0]
icon: "http://maps.gstatic.com/mapfiles/place_api/icons/geocode-71.png"
id: "80dd327e4dbee8d2ca0dcf65ebfb3c46cb3790ae"
name: "Brisbane Airport"
place_id: "ChIJo9DK_AHik2sR4IHe81qjAgU"
reference: "CpQBggAAACdy4sxtQDDCxp500sBAWHFCjZMLrRvG4X1Qc91zQdupccCLhTDteb5tTtxpPvQM9xVlXlF-mqmr27blvXYxx14w7fZFpi69pq63rk4OKCtnKMzpHXxPeT1j5xmqLEanQi4q09hhJZlwr6sk34PAphv4gxsOWQHB6RE_Zyoipxf43185HF3Sv3t4sw3K2p_9chIQMTmNyjRSLoL02xwqxx_YfRoUzAuVlz_nBa7LHYz1dflI1OZclcM"
scope: "GOOGLE"
types: Array[2]
0: "locality"
1: "political"
length: 2
__proto__: Array[0]
url: "https://maps.google.com/maps/place?q=Brisbane+Airport+QLD,+Australia&ftid=0x6b93e201fccad0a3:0x502a35af3de81e0"
vicinity: "Brisbane Airport"
__proto__: Object

我希望“airport”出现在“Brisbane International Airport, Brisbane Airport, Queensland, Australia”和“Brisbane Airport, Queensland, Australia”的“types”数组中。

谁能告诉我为什么不是这样?这是否需要向 Google 报告并让他们修复?如果是,我该怎么做,考虑到 Google Places API ( https://groups.google.com/forum/?hl=en#!forum/google-places-api) 说我需要在这里提出技术问题?

ps:它与this post有关, 但我一直没能在这个中找到答案。

最佳答案

这是因为您要查找名为“布里斯类机场”的郊区,而不是布里斯类机场。

https://en.wikipedia.org/wiki/Brisbane_Airport_%28suburb%29

如果您过滤机场,您可以 99% 确定只会得到机场。

关于google-places-api - Google Places API 类型机场,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24567752/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com