我需要使用 Geocoder API 验证地址是否是邮政信箱,并且认为PostalCodeType
结果会为我提供信息,但似乎提供邮政信箱地址会返回不同的结果。
例如,以下查询是针对真实世界的邮政信箱的:
?app_id={appId}&app_code={appCode}&country=USA&state=WA&searchtext=PO%20Box%20871570%20Vancouver%20WA%2098687&locationattributes=ar,mr,mv,dt,sd,ad,ai,li,in,tz,nb,rn&additionaldata=PreserveUnitDesignators,true
我的预期输出将是这样的:
...
"Address": {
"Label": "PO Box 871570, Vancouver, WA, United States",
"Country": "USA",
"State": "WA",
"County": "Clark",
"City": "Vancouver",
"PostalCode": "98687",
"AdditionalData": [
{
"value": "United States",
"key": "CountryName"
},
{
"value": "Washington",
"key": "StateName"
},
{
"value": "Clark",
"key": "CountyName"
},
{
"value": "P",
"key": "PostalCodeType"
}
]
}
...
但是,我得到了这个结果,对于不同的邮政编码,没有邮政信箱信息,PostalCodeType
而N
不是P
...
"Address": {
"Label": "Vancouver, WA, United States",
"Country": "USA",
"State": "WA",
"County": "Clark",
"City": "Vancouver",
"PostalCode": "98660",
"AdditionalData": [
{
"value": "United States",
"key": "CountryName"
},
{
"value": "Washington",
"key": "StateName"
},
{
"value": "Clark",
"key": "CountyName"
},
{
"value": "N",
"key": "PostalCodeType"
}
]
}
...
有没有更好的方法来搜索邮政信箱?