Azure Maps API-基于ID搜索位置



我正在使用Azure Maps API,它返回";模糊的";以这种格式匹配:

{
type: 'Geography',
id: 'US/GEO/p0/52503',
score: 2.7559998035,
entityType: 'PostalCodeArea',
address: {
municipalitySubdivision: 'Brentwood',
municipality: 'Washington',
countrySecondarySubdivision: 'District of Columbia',
countrySubdivision: 'DC',
countrySubdivisionName: 'District of Columbia',
postalCode: '56967',
postalName: 'Parcel Return Service',
countryCode: 'US',
country: 'United States',
countryCodeISO3: 'USA',
freeformAddress: 'Parcel Return Service, DC 56967'
},
position: { lat: 38.91752, lon: -76.99356 },
viewport: { topLeftPoint: [Object], btmRightPoint: [Object] }
}

我希望能够将id属性存储在数据库中(在本例中为US/GEO/p0/52503(,然后能够从Azure获取所有信息,而无需基本上复制Azure数据。我在Azure Maps API文档中找不到任何关于如何根据此ID查找位置的信息-这可能吗?

在Azure Maps中无法通过ID检索结果。此外,不能保证ID将来不会更改(V2地理编码服务没有ID(。我相信它主要用于调试目的。

在数据库中存储Address和可选的lat/lon值可能是最好的选择。请注意,只要你有Azure订阅,并且你的数据库在Azure中,你就可以将lat/lon结果数据存储在你的数据库中(即使你不再使用Azure地图(。

最新更新