Web Feature Service를 사용하여 데이터 세트 쿼리

이 문서에서는 WFS(Web Feature Service)를 사용하여 Azure Maps Creator 데이터 세트를 쿼리하는 방법을 설명합니다. WFS API를 사용하여 데이터 세트 내의 모든 기능 컬렉션 또는 특정 컬렉션을 쿼리할 수 있습니다. 예를 들어 WFS를 사용하여 특정 시설 및 층 수준의 모든 중간 규모 회의실을 찾을 수 있습니다.

필수 조건

이 문서에서는 자습서: Creator를 사용하여 실내 맵 만들기에 사용된 것과 동일한 샘플 실내 맵을 사용합니다.

Important

  • 이 문서에서는 us.atlas.microsoft.com 지리적 URL을 사용합니다. Creator 서비스가 미국에서 만들어지지 않은 경우 다른 지리적 URL을 사용해야 합니다. 자세한 내용은 Creator 서비스에 대한 액세스를 참조하세요.
  • 이 문서의 URL 예제에서는 다음을 바꿔야 합니다.
    • Azure Maps 구독 키를 사용하는 {Azure-Maps-Subscription-key}
    • {datasetId}datasetId 작성자 사용 자습서의 데이터 세트 만들기 상태 확인 섹션에서 가져온 항목을 사용하여 실내 맵을 만듭니다.

기능 컬렉션 쿼리

데이터 세트의 모든 컬렉션을 쿼리하려면 새 HTTP GET 요청을 만듭니다.

다음 URL을 WFS API에 입력합니다. 요청은 다음 URL과 같습니다.

https://us.atlas.microsoft.com/wfs/datasets/{datasetId}/collections?subscription-key={Your-Azure-Maps-Subscription-key}&api-version=2.0

응답 본문은 GeoJSON 형식으로 반환되며, 데이터 세트의 모든 컬렉션을 포함합니다. 간단히 하기 위해 다음 예제에서는 unit 컬렉션만 보여 줍니다. 모든 컬렉션이 포함된 예제를 보려면 WFS 컬렉션 설명 API를 참조하세요. 컬렉션에 대해 자세히 알아보려면 links 요소 내의 URL을 선택하면 됩니다.

{
"collections": [
    {
        "name": "unit",
        "description": "A physical and non-overlapping area which might be occupied and traversed by a navigating agent. Can be a hallway, a room, a courtyard, etc. It is surrounded by physical obstruction (wall), unless the is_open_area attribute is equal to true, and one must add openings where the obstruction shouldn't be there. If is_open_area attribute is equal to true, all the sides are assumed open to the surroundings and walls are to be added where needed. Walls for open areas are represented as a line_element or area_element with is_obstruction equal to true.",
        "links": [
            {
                "href": "https://atlas.microsoft.com/wfs/datasets/{datasetId}/collections/unit/definition?api-version=1.0",
                "rel": "describedBy",
                "title": "Metadata catalogue for unit"
            },
            {
                "href": "https://atlas.microsoft.com/wfs/datasets/{datasetId}/collections/unit/items?api-version=1.0",
                "rel": "data",
                "title": "unit"
            }
            {
                "href": "https://atlas.microsoft.com/wfs/datasets/{datasetId}/collections/unit?api-version=1.0",
                "rel": "self",
                "title": "Metadata catalogue for unit"
            }
        ]
    },

단위 기능 컬렉션에 대한 쿼리

이 섹션에서는 WFS API에서 unit 기능 컬렉션을 쿼리하는 경우를 보여 줍니다.

데이터 세트의 단위 컬렉션을 쿼리하려면 새 HTTP GET 요청을 만듭니다.

https://us.atlas.microsoft.com/wfs/datasets/{datasetId}/collections/unit/items?subscription-key={Your-Azure-Maps-Subscription-key}&api-version=2.0

응답이 반환되면 unit 기능 중 하나에 대한 기능 id를 복사합니다. 다음 예제에서 기능 id는 "UNIT26"입니다. id기능 상태를 업데이트할 때 기능 으로 "UNIT26"을 사용합니다.

{
    "type": "FeatureCollection",
    "features": [
        {
            "type": "Feature",
            "geometry": {
                "type": "Polygon",
                "coordinates": ["..."]
            },
            "properties": {
                "original_id": "b7410920-8cb0-490b-ab23-b489fd35aed0",
                "category_id": "CTG8",
                "is_open_area": true,
                "navigable_by": [
                    "pedestrian"
                ],
                "route_through_behavior": "allowed",
                "level_id": "LVL14",
                "occupants": [],
                "address_id": "DIR1",
                "name": "157"
            },
            "id": "UNIT26",
            "featureType": ""
        }, {"..."}
    ]
}

다음 단계