【问题标题】:Order of address component in google places apigoogle places api中地址组件的顺序
【发布时间】:2018-06-18 09:21:07
【问题描述】:

我想知道 google places api 返回的 address_component 的顺序,哪个类型在顶部是 route 或 street_address 还是我可能在 Places 服务返回的其他类型中缺少提到的类型的任何其他类型 https://developers.google.com/places/supported_types

【问题讨论】:

    标签: geocoding google-geocoder google-geocoding-api


    【解决方案1】:

    地址组件的顺序随结果而变化。

    一般来说,顺序是从多到少的具体。第一个组件识别建筑物/号码,然后是地址的街道/街区部分,然后是邮政和政治特征。该顺序“主要”按大小排列,但地址格式的特殊性可能会引入变化;例如postal_code 在日本出现在 country 之后。

    这适用于 Places API 中的 Table 2: Additional types returned by the Places service 和 Geocoding API 中的 Address Types and Address Component Types

    场所类型没有特定的顺序 (Table 1: Types supported in place search and addition)。

    【讨论】:

    • @Subject:请正确使用cmets。对于后代,这是您的:“这远远不足以从列表中获取特定数据,如果我只想获取城市或国家该怎么办?!?!?!?!?!“ ─ 我会尽快回答。
    • @Subject:国家很简单,只要找到types数组中带有“country”的地址组件即可。城市可能容易与否,取决于国家(甚至更小的地区),请参阅developers.google.com/maps/documentation/javascript/examples/…中的解释
    猜你喜欢
    • 1970-01-01
    • 2013-01-17
    • 2015-12-30
    • 2017-08-28
    • 1970-01-01
    • 1970-01-01
    • 2015-09-18
    • 2015-03-24
    • 1970-01-01
    相关资源
    最近更新 更多