본문 바로가기
GIS

WFS - Operations(2) : GetPropertyValue, DescribeFeatureType

by 드로니뚜벅이 2023. 3. 21.

WFS 서버에서 제공할 수 있는 작업(Operation) 유형에 대해 자세히 알아 보겠습니다.

Operation Option Description
GetCapabilities   지원되는 작업, 매개변수 그리고 사용 가능한 피쳐 타입 목록을 포함하여 서비스에 대한 메타데이터를 검색합니다.
DescribeFeatureType   WFS 인스턴스에서 제공하거나 허용하는 피쳐 유형 및 피쳐 속성의 구조에 대한 설명을 전달합니다.
GetFeature   WFS를 통해 게시된(published) 데이터 저장소에서 선택한 피쳐 인스턴스를 전달합니다.
ListStoredQueries   WFS 인스턴스 내에 저장된 질의(queries) 목록을 전달합니다.
DescribeStoredQueries   WFS 인스턴스 내에 저장된  질의(queries)에 대한 설명을 전달합니다.
GetPropertyValue Optional 일련의 피쳐 인스턴스에 대한 피처 속성 값 혹은 복잡한 피쳐 속성 값의 일부를 검색합니다.
GetFeatureWithLock Optional GetFeature 요청과 유사한 기능을 제공하지만 아마도 후속 업데이트나 변경을 위해 기능을 피쳐를 잠그는 추가 기능입니다.
LockFeature Optional 일련의 피쳐 인스턴스를 잠궈서 잠금이 설정된 동안에는 다른 작업이 데이터를 수정할 수 없도도록 합니다.
Transaction Optional 피쳐 인스턴스와 속성을 수정하거나 삭제할 수 있게 합니다.
CreateStoreadQuery Optional 나중에 클라이언트가 빠르고 쉽게 트리거할 수 있는 쿼리를 생성하고 저장합니다.
DropStoredQuery Optional 이전에 저장된 쿼리를 서버에서 삭제합니다.

 

GetPropertyValue

요청에 지정된 피쳐 속성 값을 반환합니다. 이 작업은 전체 피쳐 인스턴스 데이터가 아닌 속성 값만 반환하기 때문에 대역폭이 제한된 네트워크를 통해 서버에 액세스할 때 가장 유용합니다.

 

Request

다음은 쿼리 액션을 포함하고 HTTP POST 메서드를 통해 전송한 GetPropertyValue 요청 예입니다.

<wfs:GetPropertyValue service="WFS" version="2.0.0"
   valueReference="ci:inhabitants"
   resolve="local"
   resolveDepth="*"
    xmlns:wfs="http://www.opengis.net/wfs/2.0" xmlns:ci="http://www.interactive-instruments.de/namespaces/demo/cities/4.1/cities" xmlns:fes="http://www.opengis.net/fes/2.0"
    xmlns:sf="http://www.openplans.org/spearfish" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://www.opengis.net/wfs/2.0 http://schemas.opengis.net/wfs/2.0/wfs.xsd">
    <wfs:Query typeNames="ci:City">
        <fes:Filter>
            <fes:PropertyIsLessThan>
               <fes:ValueReference>ci:inhabitants</fes:ValueReference>
               <fes:Literal>400000</fes:Literal>
            </fes:PropertyIsLessThan>
        </fes:Filter>
    </wfs:Query>
</wfs:GetPropertyValue>

 

Response

위 요청에 대한 응답 결과는 아래와 같습니다.

<wfs:ValueCollection timeStamp="2017-09-22T10:06:30.991+02:00" numberReturned="1" numberMatched="unknown" xmlns:gml="http://www.opengis.net/gml/3.2" xmlns:wfs="http://www.opengis.net/wfs/2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<wfs:member>324800</wfs:member>
</wfs:ValueCollection>

 

DescribeFeatureType

요청에 지정된 피쳐 타입의 속성을 포함한 구조 설명을 반환합니다.

DescribeFeatureType은 실제 데이터를 요청하기 전에 개별 피쳐 유형에 대한 정보를 요청합니다. 특히 작업은 지정된 피쳐 유형에 대한 피쳐 및 속성 목록을 요청하거나 사용 가능한 피쳐 유형을 나열합니다.

 

DescribeFeatureType을 위한 파라미터는 다음과 같습니다.

Parameter Required? Description
service Yes Service name - Value is WFS
version Yes Service version - Value is the current version number
request Yes Operation name - Value is DescribeFeatuerType
typeNames Yes Name of the feature type to describe (typeName for WFS 1.1.0 and earlier)
exceptions No Format for reporting exceptions - default value is application/vnd.ogc.se_xml
outputFormat No Defines the scheme description language used to describe feature types

 

Request

DescribeFeatureType 요청에 대한 예는 아래와 같습니다.

https://services.interactive-instruments.de/ogc-reference/simple/wfs?
version=2.0.0&
request=describeFeatureType&
service=wfs&
typenames=ci:City

 

Response

응답은 지정된 피쳐 타입에 대한 자세한 설명이 포함된 XML 스키마 정의 문서입니다. 경우에 따라 XML 스키마 정의 문서는 외부에서 호스팅되는 정의를 가져올 수 있습니다

<schema targetNamespace="http://www.interactive-instruments.de/namespaces/demo/cities/4.1/cities" xmlns="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" xmlns:ci="http://www.interactive-instruments.de/namespaces/demo/cities/4.1/cities" xmlns:gml="http://www.opengis.net/gml/3.2">
<import namespace="http://www.opengis.net/gml/3.2" schemaLocation="https://services.interactive-instruments.de/ogc-reference/schema/ogc/gml/3.2.1/gml.xsd"/>
<element name="City" substitutionGroup="ci:NamedGeoObject" type="ci:CityType"/>
<element abstract="true" name="NamedGeoObject" substitutionGroup="gml:AbstractFeature" type="ci:NamedGeoObjectType"/>
<complexType name="CityType">
<complexContent>
<extension base="ci:NamedGeoObjectType">
<sequence>
<element name="location" type="gml:PointPropertyType"/>
<element maxOccurs="unbounded" minOccurs="0" name="alternativeName" type="ci:AlternativeNamePropertyType"/>
<element name="country" type="string"/>
<element name="inhabitants" type="integer"/>
<element name="lzi" type="dateTime"/>
<element name="function" nillable="true" type="string"/>
<element maxOccurs="unbounded" minOccurs="0" name="district" type="gml:ReferenceType"/>
<element maxOccurs="unbounded" minOccurs="0" name="passingRiver" type="gml:ReferenceType"/>
</sequence>
</extension>
</complexContent>
</complexType>
<complexType name="NamedGeoObjectType">
<complexContent>
<extension base="gml:AbstractFeatureType">
<sequence>
<element minOccurs="0" name="name" type="string"/>
</sequence>
</extension>
</complexContent>
</complexType>
<complexType name="AlternativeNamePropertyType">
<sequence>
<element ref="ci:AlternativeName"/>
</sequence>
</complexType>
<element name="AlternativeName" substitutionGroup="gml:AbstractObject" type="ci:AlternativeNameType"/>
<complexType name="AlternativeNameType">
<sequence>
<element name="name" type="string"/>
<element name="language" type="string"/>
</sequence>
</complexType>
</schema>

 

 

'GIS' 카테고리의 다른 글

DEGREE(도, ° ) vs. RADIAN(라디안)  (0) 2023.04.12
cs2cs command  (0) 2023.04.11
좌표 정의 및 좌표계  (0) 2023.04.05
WFS - Operations(3) : Stored Queries  (0) 2023.03.21
WFS - Operations(1) : GetFeature, GetCapabilites  (0) 2023.03.21