GetFeature
Web Feature Service (WFS) は、リクエストのサービスを提供して、フィーチャーのインスタンスを取得できます。また、クライアントはどのフィーチャーのプロパティを取得するか指定でき、空間的または非空間的にクエリを制約できます。サービスは、DescribeFeatureType リクエストで返される記述に基づき、フィーチャー (コンテンツ) の検索結果を返すことができます。
アプリケーションは、フィルタによって指定される条件を満たすフィーチャーの特定のセットを取得するフィルタを適用します。例えば、地理的またはそれ以外のさまざまな属性を取得します。また、フィルタによって、ある地域または新しい住宅地 (カスタム ポリゴン) 内のすべての用水のフィーチャーなど、顧客が分析のためにフィーチャーのセットを選択することもできます。
GetFeature 操作は、WFS サーバーから、フィーチャーやフィーチャーについて指定された情報を取得します。結果セットを含む XML ドキュメントがクライアントに返されます。
POST リクエスト
<xsd:elementname="GetFeature" type="wfs:GetFeatureType"/>
<xsd:complexType name="GetFeatureType">
<xsd:sequence>
<xsd:elementref="wfs:Query" maxOccurs="unbounded"/>
</xsd:sequence>
<xsd:attributename="version" type="xsd:string" use="required" fixed="2.0.2"/>
<xsd:attributename="service" type="xsd:string" use="required" fixed="WFS"/>
<xsd:attributename="handle" type="xsd:string" use="optional"/>
<xsd:attributename="outputFormat" type="xsd:string" use="optional" default="application/gml+xml;version=3.2"/>
<xsd:attributename="count" type="xsd:positiveInteger" use="optional"/>
</xsd:complexType>
<xsd:elementname="Query" type="wfs:QueryType"/>
<xsd:complexType name="QueryType">
<xsd:sequence>
<xsd:elementref="ogc:PropertyName" minOccurs="0" maxOccurs="unbounded"/>
<xsd:elementref="ogc:Filter" minOccurs="0" maxOccurs="1"/>
</xsd:sequence>
<xsd:attributename="handle" type="xsd:string" use="optional"/>
<xsd:attributename="srsName" type="xsd:anyURI " use="optional"/>
<xsd:attributename="typeNames" type="xsd:QName" use="required"/>
</xsd:complexType>
GetFeature リクエストの XML エンコーディングは、WFS 1.1.0 の場合、次の XML スキーマによって定義されます。
<xsd:elementname="GetFeature" type="wfs:GetFeatureType"/>
<xsd:complexType name="GetFeatureType">
<xsd:sequence>
<xsd:elementref="wfs:Query" maxOccurs="unbounded"/>
</xsd:sequence>
<xsd:attributename="version" type="xsd:string" use="required" fixed="1.1.0"/>
<xsd:attributename="service" type="xsd:string" use="required" fixed="WFS"/>
<xsd:attributename="handle" type="xsd:string" use="optional"/>
<xsd:attributename="outputFormat" type="xsd:string" use="optional" default="text/xml; subtype=gml/3.1.1"/>
<xsd:attributename="maxFeatures" type="xsd:positiveInteger" use="optional"/>
</xsd:complexType>
<xsd:elementname="Query" type="wfs:QueryType"/>
<xsd:complexType name="QueryType">
<xsd:sequence>
<xsd:elementref="ogc:PropertyName" minOccurs="0" maxOccurs="unbounded"/>
<xsd:elementref="ogc:Filter" minOccurs="0" maxOccurs="1"/>
</xsd:sequence>
<xsd:attributename="handle" type="xsd:string" use="optional"/>
<xsd:attributename="srsName" type="xsd:anyURI " use="optional"/>
<xsd:attributename="typeName" type="xsd:QName" use="required"/>
<xsd:attributename="featureVersion" type="xsd:string" use="optional"/>
</xsd:complexType>
GetFeature リクエストの XML エンコーディングは、WFS 1.0.0 の場合、次の XML スキーマによって定義されます。
<xsd:elementname="GetFeature" type="wfs:GetFeatureType"/>
<xsd:complexType name="GetFeatureType">
<xsd:sequence>
<xsd:elementref="wfs:Query" maxOccurs="unbounded"/>
</xsd:sequence>
<xsd:attributename="version" type="xsd:string" use="required" fixed="1.0.0"/>
<xsd:attributename="service" type="xsd:string" use="required" fixed="WFS"/>
<xsd:attributename="handle" type="xsd:string" use="optional"/>
<xsd:attributename="outputFormat" type="xsd:string" use="optional" default="xmlschema"/>
<xsd:attributename="maxFeatures" type="xsd:positiveInteger" use="optional"/>
</xsd:complexType>
<xsd:elementname="Query" type="wfs:QueryType"/>
<xsd:complexType name="QueryType">
<xsd:sequence>
<xsd:elementref="ogc:PropertyName" minOccurs="0" maxOccurs="unbounded"/>
<xsd:elementref="ogc:Filter" minOccurs="0" maxOccurs="1"/>
</xsd:sequence>
<xsd:attributename="handle" type="xsd:string" use="optional"/>
<xsd:attributename="srsName" type="xsd:anyURI " use="optional"/>
<xsd:attributename="typeName" type="xsd:QName" use="required"/>
<xsd:attributename="featureVersion" type="xsd:string" use="optional"/>
</xsd:complexType>
GET リクエスト
GET リクエストには以下の要素が含まれます。
入力 | 必須 | 説明 |
---|---|---|
SERVICE=WFS |
はい | WFS に固定されます。 |
VERSION= |
はい | 2.0.2 に固定されます。これは、このリリースで実装されている Web Feature Service 規格のバージョンです (1.0.0、1.1.0、2.0.0、または 2.0.2)。 |
REQUEST=GetFeature |
はい | get フィーチャー操作のために GetFeature を設定します。 |
TYPENAME (1.0.0 または 1.1.0)
|
はい | フィーチャー タイプのコンマ区切りのリスト。 |
MAXFEATURES (1.0.0 または 1.1.0)
|
いいえ | 返されるフィーチャーの最大数。 |
STARTINDEX |
いいえ | 2.0.0 および 2.0.2 の場合のみ。
例えば、次の URL があるとします。
前の属性は、以下のようになります。
次の属性は、以下のようになります。
|
OUTPUTFORMAT |
いいえ | バージョンによって、以下のようになります。
|
ストアド クエリ | 2.0.0 および 2.0.2 の場合のみ。STOREDQUERY_ID パラメータと ID パラメータを使用します。GetFeatureById の必須 ID のみが指定可能です。GET リクエストの例:
POST リクエストの例:
|
|
STOREDQUERY_ID |
いいえ | バージョン 2.0.0 と 2.0.2 で、異なる ID 形式 (URN と URL) が使用されます。URN 形式は、バージョン2.0.2 でまだ使用可能ですが、非推奨になっています。 2.0.0 - 2.0.2 - |
ID |
いいえ | 返されるフィーチャーの ID。 例えば、フィーチャー ID
|
v2.0.2 の場合の例:
http://<server>:<port>/rest/Spatial/WFS?SERVICE=WFS&VERSION=2.0.2&REQUEST=GetFeature&TYPENAMES=World&COUNT=10
v1.1.0 の場合の例:
http://<server>:<port>/rest/Spatial/WFS?SERVICE=WFS&VERSION=1.1.0&REQUEST=GetFeature&TYPENAME=World&MAXFEATURES=10