【问题标题】:Get polygon from Azure Maps Search从 Azure Maps 搜索获取多边形
【发布时间】:2023-02-09 07:15:45
【问题描述】:

我正在尝试使用 Azure.Maps.Search 为结果提供一个多边形。例如,如果我搜索“伯明翰”,我想要一个包含定义边界的地理点集合的自治市的结果。

这可能吗?

            var credential = new AzureKeyCredential("............");
            var client = new MapsSearchClient(credential);
            Response<SearchAddressResult> searchResult = await client.SearchAddressAsync(
                query: "Birmingham",
                options: new SearchAddressOptions
                {
                    ExtendedPostalCodesFor=new SearchIndex[] { SearchIndex.PointAddresses },
                    CountryFilter = new string[] { "GB" },
                    Top = 1,
                    EntityType = GeographicEntity.Municipality
                });

【问题讨论】:

    标签: azure azure-maps


    【解决方案1】:

    是的,这是可能的。搜索地址 API 将在结果中包含一个 DataSources.Geometries.ID 值,该值是该结果的唯一边界的 ID。您可以获取此 ID 并将其传递到 SearchPolygon API。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2023-03-30
      • 2013-09-07
      • 2014-10-06
      • 2023-03-29
      • 1970-01-01
      • 2020-12-14
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多