首页 > 解决方案 > Mapbox Geocoding API 中的荷兰邮政编码

问题描述

更新这是一个错误,他们修复了它!

荷兰邮政编码包含 4 位数字和 2 个字母。输入 4 位数字时,它会找到全球邮政编码位置,但是当您添加 2 个字母(对应于街道)时,响应不会返回正确的位置。

例如:1012 返回阿姆斯特丹的一般邮政编码位置。但是当您输入 1012 AW 时,它会返回完全不同的结果(甚至不同的城市)。但它应该返回 1012 邮政编码区域内的特定位置。

网址 https://api.mapbox.com/geocoding/v5/mapbox.places/ ${search}.json

参数

{
  language: 'nl',
  country: 'NL',
  limit: 1,
  access_token: config.accessToken,
  types: 'address,place,poi'
}

返回的邮政编码没有两个字母数字。如何让 Mapbox 添加两个字母?

示例响应。

是 4694 但应该是 4694EG

{  
   "type":"FeatureCollection",
   "query":[  
      "***",
      "***"
   ],
   "features":[  
      {  
         "id":"address.7144861498943104",
         "type":"Feature",
         "place_type":[  
            "address"
         ],
         "relevance":0.75,
         "properties":{  
            "accuracy":"point"
         },
         "text_nl":"Beatrixlaan",
         "place_name_nl":"Beatrixlaan 2, 4694 Scherpenisse, Nederland",
         "text":"Beatrixlaan",
         "place_name":"Beatrixlaan 2, 4694 Scherpenisse, Nederland",
         "center":[  
            4.103576,
            51.546267
         ],
         "geometry":{  
            "type":"Point",
            "coordinates":[  
               4.103576,
               51.546267
            ]
         },
         "address":"2",
         "context":[  
            {  
               "id":"postcode.10605073597498580",
               "text_nl":"4694",
               "text":"4694"
            },
            {  
               "id":"place.5585596482812836",
               "wikidata":"Q2381830",
               "text_nl":"Scherpenisse",
               "language_nl":"nl",
               "text":"Scherpenisse",
               "language":"nl"
            },
            {  
               "id":"region.13950781060383020",
               "short_code":"NL-ZE",
               "wikidata":"Q705",
               "text_nl":"Zeeland",
               "language_nl":"nl",
               "text":"Zeeland",
               "language":"nl"
            },
            {  
               "id":"country.9349515904622050",
               "short_code":"nl",
               "wikidata":"Q55",
               "text_nl":"Nederland",
               "language_nl":"nl",
               "text":"Nederland",
               "language":"nl"
            }
         ]
      }
   ],
   "attribution":"NOTICE: © 2019 Mapbox and its suppliers. All rights reserved. Use of this data is subject to the Mapbox Terms of Service (https://www.mapbox.com/about/maps/). This response and the information it contains may not be retained. POI(s) provided by Foursquare."
}

标签: mapboxgeocoding

解决方案


推荐阅读