Mapbox API:如何获取给定邮政编码下的地址列表?
Mapbox API: How do I get a list of addresses under a given postal code?
如问题所示 - 我有给定的邮政编码,我需要使用 Mapbox API
获取地址列表
请求以下端点后:
`https://api.mapbox.com/geocoding/v5/mapbox.places/${postcode}.json?types=postcode&access_token=${mapboxToken}`
我收到以下回复:
[
{
"id":"postcode.17660822408923720",
"type":"Feature",
"place_type":[
"postcode"
],
"relevance":1,
"properties":{
},
"text":"HP1 3EN",
"place_name":"HP1 3EN, Hemel Hempstead, Hertfordshire, England, United Kingdom",
"matching_text":"HP13EN",
"matching_place_name":"HP13EN, Hemel Hempstead, Hertfordshire, England, United Kingdom",
"bbox":[
-0.489006,
51.760773,
-0.487601,
51.761635
],
"center":[
-0.488395,
51.7610944
],
"geometry":{
"type":"Point",
"coordinates":[
-0.488395,
51.7610944
]
},
"context":[
{
"id":"place.15727584894798730",
"wikidata":"Q3532",
"text":"Hemel Hempstead"
},
{
"id":"district.8002140812776250",
"wikidata":"Q3410",
"text":"Hertfordshire"
},
{
"id":"region.13483278848453920",
"wikidata":"Q21",
"short_code":"GB-ENG",
"text":"England"
},
{
"id":"country.12405201072814600",
"wikidata":"Q145",
"short_code":"gb",
"text":"United Kingdom"
}
]
}
]
在此回复中,没有关于给定邮政编码下地址的任何信息。
当我在 URL 查询中指定 'address' 类型时,它得到一个空数组作为响应。
`https://api.mapbox.com/geocoding/v5/mapbox.places/${postcode}.json?types=address&access_token=${mapboxToken}`
我在 Mapbox documentation 中找不到帮助,有人可以帮我解决这个问题吗?
听起来您正在尝试获取给定邮政编码内每个地址的列表?你不能用 Mapbox 做到这一点。
我怀疑您会找到允许您执行此操作的任何地理编码服务。
如问题所示 - 我有给定的邮政编码,我需要使用 Mapbox API
获取地址列表请求以下端点后:
`https://api.mapbox.com/geocoding/v5/mapbox.places/${postcode}.json?types=postcode&access_token=${mapboxToken}`
我收到以下回复:
[
{
"id":"postcode.17660822408923720",
"type":"Feature",
"place_type":[
"postcode"
],
"relevance":1,
"properties":{
},
"text":"HP1 3EN",
"place_name":"HP1 3EN, Hemel Hempstead, Hertfordshire, England, United Kingdom",
"matching_text":"HP13EN",
"matching_place_name":"HP13EN, Hemel Hempstead, Hertfordshire, England, United Kingdom",
"bbox":[
-0.489006,
51.760773,
-0.487601,
51.761635
],
"center":[
-0.488395,
51.7610944
],
"geometry":{
"type":"Point",
"coordinates":[
-0.488395,
51.7610944
]
},
"context":[
{
"id":"place.15727584894798730",
"wikidata":"Q3532",
"text":"Hemel Hempstead"
},
{
"id":"district.8002140812776250",
"wikidata":"Q3410",
"text":"Hertfordshire"
},
{
"id":"region.13483278848453920",
"wikidata":"Q21",
"short_code":"GB-ENG",
"text":"England"
},
{
"id":"country.12405201072814600",
"wikidata":"Q145",
"short_code":"gb",
"text":"United Kingdom"
}
]
}
]
在此回复中,没有关于给定邮政编码下地址的任何信息。
当我在 URL 查询中指定 'address' 类型时,它得到一个空数组作为响应。
`https://api.mapbox.com/geocoding/v5/mapbox.places/${postcode}.json?types=address&access_token=${mapboxToken}`
我在 Mapbox documentation 中找不到帮助,有人可以帮我解决这个问题吗?
听起来您正在尝试获取给定邮政编码内每个地址的列表?你不能用 Mapbox 做到这一点。
我怀疑您会找到允许您执行此操作的任何地理编码服务。