• <nav id="fhetv"></nav>

          <listing id="fhetv"></listing>

          <var id="fhetv"><mark id="fhetv"><cite id="fhetv"></cite></mark></var>

          1. 目錄

            上一個主題

            1.6. VI. OWS-OGC Web 服務通用標準

            下一個主題

            1.8. VIII. WMS-地圖 Web 服務


            1.7. VII. WFS-要素 Web 服務?

            1.7.1. 概述?

            WFS(OpenGIS? Web Feature Service)當前版本是 1.1.0。WFS 標準定義了一些操作,這些操作允許用戶在分布式的環境下通過 HTTP 對空間數據進行查詢、編輯等操作。

            WFS 服務要求服務的接口必須由 XML 描述,另外數據交互必須由 GML 進行,數據過濾采用CQl 18 語言。

            1.7.2. 種類與操作?

            當一個客戶端想要訪問 WFS 服務時,一般會涉及到以下的流程:

            1.?通過操作獲取 WFS 服務支持的操作和要素類(Feature Type,可以理覽為 WFS 中的數據集)。

            2.?(可能)通過操作獲取 WFS 服務支持的要素類的定義。

            3.?客戶端發送某個操作的請求。

            4.?WFS 服務處理請求。

            5.?WFS 服務返回處理的結果和狀態。

            上面幾個步驟中所提到的“操作”包括:

            1.?GetCapabilities(獲取服務中的要素類及支持的操作)

            2.?DescribeFeatureType(描述要素類的信息)

            3.?GetFeature(獲取要素)

            4.?GetGmlObject(通過 XLink 獲取 GML 對象)

            5.?Transaction(創建、更新、刪除數據的事務操作)

            6.?LockFeature(在事務過程中鎖定要素)

            但是,這些操作并不是必須全部實現,而是實現全部或部分。根據所支持的

            操作不同,WFS 可以分為 3 類:

            1.?Basic WFS(就是最常被提及的 WFS,必須支持 GetCapabilities/ DescribeFeatureType GetFeature 操作,在功能上意味著提供一個叧讀的數據服務)

            2.?XLink WFS(必須在 Basic WFS 基礎上加上 GetGmlObject 操作)

            3.?Transaction WFS(也有稱為 WFS-T,必須在 Basic WFS 基礎上加上 Transaction 操作以支持編輯數據,另外也可以加上 GetGmlObject/LockFeature 操作)關于服務涉及的基本元素,可以參考前面的章節:《服務涉及的基本元素》。

            注意,在后面的內容中,服務的操作叧介縐 Basic WFS 和 Transaction WFS 中需要實現的操作,也就是說 GetCapabilities、DescribeFeatureType、 GetFeature 和 Transaction 操作。

            1.7.3. GetCapabilities 操作?

            1.7.3.1. 1. KVP 格式請求?

            GetCapabilities 操作需要以下的參數:

            參數

            是否必須

            默認值

            SERVICE

            WFS

            REQUEST=GetCapabilities

            以下是一個 WFS 使用 KVP 格式的 GetCapabilities 操作示例:

            http://www.someserver.com/wfs?
            
            SERVICE=WFS&
            
            REQUEST=GetCapabilities
            

            1.7.3.2. 2. XML 格式請求?

            以下是一個 WFS 使用 XML 格式的 GetCapabilities 操作示例:

            <?xml version="1.0" ?>
            
            <GetCapabilities service="WFS" xmlns="http://www.opengis.net/wfs"
            
            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
            
            xsi:schemaLocation="http://www.opengis.net/wfs ../wfs/1.1.0/WFS.xsd" />
            

            1.7.3.3. 3. 響應示例?

            以下是一個 WFS 的 GetCapabilities 操作的響應示例:

            <?xml version="1.0" encoding="UTF-8"?>
            
            <wfs:WFS_Capabilites xmlns:ows="http://www.opengis.net/ows"
            
            xmlns:ogc="http://www.opengis.net/ogc" xmlns:wfs="http://www.opengis.net/wfs"
            
            xmlns:gml="http://www.opengis.net/gml" xmlns:xlink="http://www.w3.org/1999/xlink"
            
            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
            
            xsi:schemaLocation="http://www.opengis.net/wfs ../wfs.xsd" version="1.1.0"
            
            updateSequence="0">
            
            
            
            
            
            
            
            <ows:ServiceIdentification>
            
            <ows:ServiceType>WFSows:ServiceType>
            
            <ows:ServiceTypeVersion>1.1.0ows:ServiceTypeVersion>
            
            <ows:Title>OGC Member WFSows:Title>
            
            ...
            
            ows:ServiceIdentification>
            
            
            
            
            
            
            
            <ows:ServiceProvider>
            
            <ows:ProviderName>BlueOxows:ProviderName>
            
            <ows:ServiceContact>
            
            ...
            
            ows:ServiceContact>
            
            ows:ServiceProvider>
            
            
            
            
            
            
            
            <ows:OperationsMetadata>
            
            <ows:Operation name="GetCapabilities">
            
            ...
            
            ows:Operation>
            
            <ows:Operation name="DescribeFeatureType">
            
            ...
            
            ows:Operation>
            
            <ows:Operation name="GetFeature">
            
            ...
            
            ows:Operation>
            
            <ows:Operation name="GetFeatureWithLock">
            
            ...
            
            ows:Operation>
            
            <ows:Operation name="GetGMLObject">
            
            ...
            
            ows:Operation>
            
            <ows:Operation name="LockFeature">
            
            ...
            
            ows:Operation>
            
            <ows:Operation name="Transaction">
            
            ...
            
            ows:Operation>
            
            <ows:Parameter name="srsName">
            
            <ows:Value>EPSG:4326ows:Value>
            
            ows:Parameter>
            
            <ows:Constraint name="DefaultMaxFeatures">
            
            <ows:Value>10000ows:Value>
            
            ows:Constraint>
            
            ...
            
            ows:OperationsMetadata>
            
            
            
            
            
            
            
            <wfs:FeatureTypeList>
            
            <wfs:FeatureType xmlns:bo="http://www.BlueOx.org/BlueOx">
            
            <wfs:DefaultSRS>EPSG:62696405wfs:DefaultSRS>
            
            <wfs:OutputFormats>
            
            <wfs:Format>text/xml; subtype=gml/3.1.1wfs:Format>
            
            wfs:OutputFormats>
            
            <ows:WGS84BoundingBox>
            
            <ows:LowerCorner>-180 -90ows:LowerCorner>
            
            <ows:UpperCorner>180 90ows:UpperCorner>
            
            ows:WGS84BoundingBox>
            
            ...
            
            wfs:FeatureType>
            
            wfs:FeatureTypeList>
            
            
            
            
            
            
            
            <wfs:ServesGMLObjectTypeList>
            
            <wfs:GMLObjectType xmlns:bo="http://www.BlueOx.org/BlueOx">
            
            <wfs:Name>bo:OxTypewfs:Name>
            
            <wfs:Title>Babe's Lineagewfs:Title>
            
            <wfs:OutputFormats>
            
            <wfs:Format>text/xml; subtype=gml/3.1.1wfs:Format>
            
            <wfs:Format>text/xhmtlwfs:Format>
            
            wfs:OutputFormats>
            
            wfs:GMLObjectType>
            
            wfs:ServesGMLObjectTypeList>
            
            
            
            
            
            
            
            <wfs:SupportsGMLObjectTypeList>
            
            <wfs:GMLObjectType>
            
            <wfs:Name>gml:PointTypewfs:Name>
            
            <wfs:OutputFormats>
            
            <wfs:Format>text/xml; subtype=gml/3.1.1wfs:Format>
            
            <wfs:Format>text/xhtmlwfs:Format>
            
            wfs:OutputFormats>
            
            wfs:GMLObjectType>
            
            ...
            
            wfs:SupportsGMLObjectTypeList>
            
            
            
            
            
            
            
            <ogc:Filter_Capabilities>
            
            <ogc:Spatial_Capabilities>
            
            <ogc:GeometryOperands>
            
            <ogc:GeometryOperand>gml:Envelopeogc:GeometryOperand>
            
            <ogc:GeometryOperand>gml:Pointogc:GeometryOperand>
            
            <ogc:GeometryOperand>gml:LineStringogc:GeometryOperand>
            
            <ogc:GeometryOperand>gml:Polygonogc:GeometryOperand>
            
            ...
            
            ogc:GeometryOperands>
            
            <ogc:SpatialOperators>
            
            <ogc:SpatialOperator name="BBOX" />
            
            <ogc:SpatialOperator name="Equals" />
            
            <ogc:SpatialOperator name="Disjoint" />
            
            <ogc:SpatialOperator name="Intersects" />
            
            <ogc:SpatialOperator name="Touches" />
            
            <ogc:SpatialOperator name="Crosses" />
            
            <ogc:SpatialOperator name="Within" />
            
            <ogc:SpatialOperator name="Contains" />
            
            <ogc:SpatialOperator name="Overlaps" />
            
            <ogc:SpatialOperator name="Beyond" />
            
            ogc:SpatialOperators>
            
            ogc:Spatial_Capabilities>
            
            <ogc:Scalar_Capabilities>
            
            <ogc:LogicalOperators />
            
            <ogc:ComparisonOperators>
            
            <ogc:ComparisonOperator>LessThanogc:ComparisonOperator>
            
            <ogc:ComparisonOperator>GreaterThanogc:ComparisonOperator>
            
            <ogc:ComparisonOperator>LessThanEqualToogc:ComparisonOperator>
            
            <ogc:ComparisonOperator>GreaterThanEqualToogc:ComparisonOperator>
            
            <ogc:ComparisonOperator>EqualToogc:ComparisonOperator>
            
            <ogc:ComparisonOperator>NotEqualToogc:ComparisonOperator>
            
            <ogc:ComparisonOperator>Likeogc:ComparisonOperator>
            
            <ogc:ComparisonOperator>Betweenogc:ComparisonOperator>
            
            <ogc:ComparisonOperator>NullCheckogc:ComparisonOperator>
            
            ogc:ComparisonOperators>
            
            <ogc:ArithmeticOperators>
            
            <ogc:SimpleArithmetic />
            
            <ogc:Functions>
            
            <ogc:FunctionNames>
            
            <ogc:FunctionName nArgs="1">MINogc:FunctionName>
            
            <ogc:FunctionName nArgs="1">MAXogc:FunctionName>
            
            <ogc:FunctionName nArgs="1">SINogc:FunctionName>
            
            <ogc:FunctionName nArgs="1">COSogc:FunctionName>
            
            <ogc:FunctionName nArgs="1">TANogc:FunctionName>
            
            ogc:FunctionNames>
            
            ogc:Functions>
            
            ogc:ArithmeticOperators>
            
            ogc:Scalar_Capabilities>
            
            <ogc:Id_Capabilities>
            
            <ogc:EID />
            
            <ogc:FID />
            
            ogc:Id_Capabilities>
            
            ogc:Filter_Capabilities>
            
            wfs:WFS_Capabilites>
            

            1.7.4. DescribeFeatureType 操作?

            1.7.4.1. 1. KVP 格式請求?

            DescribeFeatureType 操作需要以下的參數:

            參數

            是否必須

            默認值

            VERSION

            1.1.0

            SERVICE

            WFS

            REQUEST=DescribeFeatureType

            TYPENAME

            OUTPUTFORMAT

            text/xml; subtype=gml/3.1.1

            以下是一個 WFS 使用 KVP 格式的 DescribeFeatureType 操作示例:

            http://www.someserver.com/wfs?
            
            SERVICE=WFS&
            
            VERSION=1.1.0&
            
            REQUEST=DescribeFeatureType&
            
            TYPENAME=TreesA_1M,BuiltUpA_1M
            

            1.7.4.2. 2. XML 格式請求?

            以下是一個 WFS 使用 XML 格式的 DescribeFeatureType 操作示例:

            xml version="1.0" ?>
            
            
            <
            DescribeFeatureType
             version
            ="1.1.0"
             service
            ="WFS"
            
            
            outputFormat
            ="text/xml; subtype=gml/3.1.1"
             xmlns
            ="http://www.opengis.net/wfs"
            
            
            xmlns
            :myns
            ="http://www.myserver.com/myns"
             xmlns
            :xsi
            ="http://www.w3.org/2001/XMLSchema-instance"
            
            
            xsi
            :schemaLocation
            ="http://www.opengis.net/wfs ../wfs/1.1.0/WFS.xsd"
            >
            
            
            <
            TypeName
            >
            myns:PersonTypeName
            >
            
            
            DescribeFeatureType
            >
            

            1.7.4.3. 3. 響應示例?

            以下是一個 WFS 的 DescribeFeatureType 操作的響應示例:

            xml version="1.0" ?>
            
            
            <
            wfs
            :FeatureCollection
            xmlns
            ="http://www.someserver.com/myns"
            
            
            xmlns
            :myns
            ="http://www.someserver.com/myns"
            xmlns
            :wfs
            ="http://www.opengis.net/wfs"
            
            
            xmlns
            :gml
            ="http://www.opengis.net/gml"
            xmlns
            :xsi
            ="http://www.w3.org/2001/XMLSchema-instance"
            
            
            xsi
            :schemaLocation
            ="http://www.opengis.net/wfs ../wfs/1.1.0/WFS.xsd
            
            
            http://www.someserver.com/myns ex10.xsd"
            >
            
            
            <
            gml
            :boundedBy
            >
            
            
            <
            gml
            :Envelope
            >
            
            
            <
            gml
            :coord
            >
            
            
            <
            gml
            :X
            >
            10gml
            :X
            >
            
            
            <
            gml
            :Y
            >
            10gml
            :Y
            >
            
            
            gml
            :coord
            >
            
            
            <
            gml
            :coord
            >
            
            
            <
            gml
            :X
            >
            20gml
            :X
            >
            
            
            <
            gml
            :Y
            >
            20gml
            :Y
            >
            
            
            gml
            :coord
            >
            
            
            gml
            :Envelope
            >
            
            
            gml
            :boundedBy
            >
            
            
            <
            gml
            :featureMember
            >
            
            
            <
            Person
            >
            
            
            <
            myns
            :lastName
            >
            Smithmyns
            :lastName
            >
            
            
            <
            myns
            :firstName
            >
            Fredmyns
            :firstName
            >
            
            
            <
            myns
            :age
            >
            35myns
            :age
            >
            
            
            <
            myns
            :sex
            >
            Malemyns
            :sex
            >
            
            
            <
            myns
            :location
            >
            
            
            <
            gml
            :Point
            >
            
            
            <
            gml
            :pos
            >
            15 15gml
            :pos
            >
            
            
            gml
            :Point
            >
            
            
            myns
            :location
            >
            
            
            <
            myns
            :mailAddress
            >
            
            
            <
            myns
            :Address
            >
            
            
            <
            myns
            :streetName
            >
            Main St.myns
            :streetName
            >
            
            
            <
            myns
            :streetNumber
            >
            5myns
            :streetNumber
            >
            
            
            <
            myns
            :city
            >
            SomeCitymyns
            :city
            >
            
            
            <
            myns
            :province
            >
            Someprovincemyns
            :province
            >
            
            
            <
            myns
            :postalCode
            >
            X1X 1X1myns
            :postalCode
            >
            
            
            <
            myns
            :country
            >
            Canadamyns
            :country
            >
            
            
            <
            myns
            :Address
            >
            
            
            myns
            :mailAddress
            >
            
            
            Person
            >
            
            
            gml
            :featureMember
            >
            
            
            wfs
            :FeatureCollection
            >
            

            1.7.5. ?GetFeature 操作?

            1.7.5.1. 1. KVP 格式請求?

            GetFeature 操作需要以下的參數:

            參數

            是否必須

            默認值

            VERSION

            1.1.0

            SERVICE

            WFS

            REQUEST=GetFeature

            TYPENAME

            OUTPUTFORMAT

            text/xml; subtype=gml/3.1.1

            BBOX

            FILTER

            SORTBY

            MAXFEATURES

            PROPERTYNAME

            SRSNAME

            FEATUREID

            EXPIRY

            RESULTTYPE

            results

            FEATUREVERSION

            以下是一個WFS使用KVP格式的GetFeature操作示例:

            http://www.someserver.com/wfs?
            
            SERVICE=WFS&
            
            VERSION=1.1.0&
            
            REQUEST=GetFeature&
            
            PROPERTYNAME=InWaterA_1M/wkbGeom,InWaterA_1M/tileId&
            
            TYPENAME=InWaterA_1M&
            
            FILTER=InWaterA_1M/wkbGeom
            
            10,10
            
            20 20
            

            1.7.5.2. 2.XML格式請求?

            以下是一個WFS使用XML格式的GetFeature操作示例:

            xml version="1.0" ?>
            
            
            <
            DescribeFeatureType
             version
            ="1.1.0"
             service
            ="WFS"
            
            
            outputFormat
            ="text/xml; subtype=gml/3.1.1"
             xmlns
            ="http://www.opengis.net/wfs"
            
            
            xmlns
            :myns
            ="http://www.myserver.com/myns"
             xmlns
            :xsi
            ="http://www.w3.org/2001/XMLSchema-instance"
            
            
            xsi
            :schemaLocation
            ="http://www.opengis.net/wfs ../wfs/1.1.0/WFS.xsd"
            >
            
            
            <
            TypeName
            >
            myns:PersonTypeName
            >
            
            
            DescribeFeatureType
            >
            

            1.7.5.3. 3.響應示例?

            以下是一個WFS的GetFeature操作的響應示例:

            xml version="1.0" ?>
            
            
            <
            wfs
            :FeatureCollection
             xmlns
            ="http://www.someserver.com/myns"
            
            
            xmlns
            :myns
            ="http://www.someserver.com/myns"
             xmlns
            :wfs
            ="http://www.opengis.net/wfs"
            
            
            xmlns
            :gml
            ="http://www.opengis.net/gml"
             xmlns
            :xsi
            ="http://www.w3.org/2001/XMLSchema-instance"
            
            
            xsi
            :schemaLocation
            ="http://www.opengis.net/wfs ../wfs/1.1.0/WFS.xsd
            
            
            http://www.someserver.com/myns ex10.xsd"
            >
            
            
            <
            gml
            :boundedBy
            >
            
            
            <
            gml
            :Envelope
            >
            
            
            <
            gml
            :coord
            >
            
            
            <
            gml
            :X
            >
            10gml
            :X
            >
            
            
            <
            gml
            :Y
            >
            10gml
            :Y
            >
            
            
            gml
            :coord
            >
            
            
            <
            gml
            :coord
            >
            
            
            <
            gml
            :X
            >
            20gml
            :X
            >
            
            
            <
            gml
            :Y
            >
            20gml
            :Y
            >
            
            
            gml
            :coord
            >
            
            
            gml
            :Envelope
            >
            
            
            gml
            :boundedBy
            >
            
            
            <
            gml
            :featureMember
            >
            
            
            <
            Person
            >
            
            
            <
            myns
            :lastName
            >
            Smithmyns
            :lastName
            >
            
            
            <
            myns
            :firstName
            >
            Fredmyns
            :firstName
            >
            
            
            <
            myns
            :age
            >
            35myns
            :age
            >
            
            
            <
            myns
            :sex
            >
            Malemyns
            :sex
            >
            
            
            <
            myns
            :location
            >
            
            
            <
            gml
            :Point
            >
            
            
            <
            gml
            :pos
            >
            15 15gml
            :pos
            >
            
            
            gml
            :Point
            >
            
            
            myns
            :location
            >
            
            
            <
            myns
            :mailAddress
            >
            
            
            <
            myns
            :Address
            >
            
            
            <
            myns
            :streetName
            >
            Main St.myns
            :streetName
            >
            
            
            <
            myns
            :streetNumber
            >
            5myns
            :streetNumber
            >
            
            
            <
            myns
            :city
            >
            SomeCitymyns
            :city
            >
            
            
            <
            myns
            :province
            >
            Someprovincemyns
            :province
            >
            
            
            <
            myns
            :postalCode
            >
            X1X 1X1myns
            :postalCode
            >
            
            
            <
            myns
            :country
            >
            Canadamyns
            :country
            >
            
            
            <
            myns
            :Address
            >
            
            
            myns
            :mailAddress
            >
            
            
            Person
            >
            
            
            gml
            :featureMember
            >
            
            
            wfs
            :FeatureCollection
            >
            

            1.7.6. Transaction 操作?

            1.7.6.1. 1. KVP 格式請求?

            Transaction 操作使用 KVP 格式請求目前叧支持 Delete(Insert 和 Update 必須通過 XML 格式請求發送)。Transaction 操作需要以下的參數:

            參數

            是否必須

            默認值

            VERSION

            1.1.0

            SERVICE

            WFS

            REQUEST=Transaction

            OPERATION=Delete

            TYPENAME

            RELEASEACTION

            FILTER

            BBOX

            FEATUREID

            以下是一個WFS使用KVP格式的Transaction操作示例:

            http://www.someserver.com/wfs?
            
            SERVICE=WFS&
            
            VERSION=1.1.0&
            
            REQUEST=Transaction&
            
            OPERATION=Delete&
            
            TYPENAME=InWaterA_1M,BuiltUpA_1M&
            
            FILTER=(<Filter><Within><PropertyName>InWaterA_1M/wkbGeom<PropertyName>
            
            <gml:Envelope>
            
            <gml:lowerCorner>10 10</gml:lowerCorner>
            
            <gml:upperCorner>20 20</gml:upperCorner></gml:Envelope></Within>
            
            </Filter>)(< Filter><Within><PropertyName>BuiltUpA_1M/wkbGeom
            
            <PropertyName><gml:Envelope><gml:lowerCorner>10 10</gml:lowerCorner>
            
            <gml:upperCorner>20,20</gml:upperCorner>
            
            </gml:Envelope></Within></Filter>)
            

            1.7.6.2. 2.XML格式請求?

            以下是一個WFS使用XML格式的Transaction操作示例:

            <?xml version="1.0" ?>
            
            <wfs:Transaction version="1.1.0" service="WFS"
            
            handle="Transaction 01" xmlns="http://www.someserver.com/myns"
            
            xmlns:wfs="http://www.opengis.net/wfs" xmlns:ogc="http://www.opengis.net/ogc"
            
            xmlns:gml="http://www.opengis.net/gml" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
            
            xsi:schemaLocation="http://www.someserver.com/myns
            
            http://www.someserver.com/wfs/cwwfs.cgi?
            
            request=DESCRIBEFEATURETYPE&amp;
            
            typename=ELEVP_1M,RoadL_1M,BuiltUpA_1M
            
            http://www.opengis.net/wfs ../wfs/1.1.0/WFS.xsd">
            
            <!--
            
            Create a new instance of feature type RoadL_1M which has complex
            
            properties segment and roadType.
            
            -->
            
            <wfs:Insert handle="ComplexInsert">
            
            <RoadL_1M>
            
            <name>Highway 401</name>
            
            <segement>
            
            <designation>SEG_A41</designation>
            
            <geometry>
            
            <gml:LineString gid="e3"
            
            srsName="http://www.opengis.net/gml/srs/epsg.xml#63266405">
            
            <gml:posList>...</gml:posList>
            
            </gml:LineString>
            
            </geometry>
            
            </segment>
            
            <roadType>
            
            <surfaceType>Asphalt</surfaceType>
            
            <nLanes>12</nLanes>
            
            <grade>15</grade>
            
            </roadType>
            
            </RoadL_1M>
            
            </wfs:Insert>
            
            <!--
            
            Update the designation of a particular range of segments which are now
            
            being collapsed into a single segment. The The filter uses an XPath
            
            expression to reference the designation property
            
            -->
            
            <wfs:Update typeName="RoadL_1M">
            
            <wfs:Property>
            
            <wfs:Name>RoadL_1M/segment/designation</wfs:Name>
            
            <wfs:Value>SEG_A60</wfs:Value>
            
            </wfs:Property>
            
            <ogc:Filter>
            
            <ogc:PropertyIsBetween>
            
            <ogc:PropertyName>RoadL_1M/segment/designation</ogc:PropertyName>
            
            <ogc:LowerBoundary>
            
            <ogc:Literal>SEG_A60</ogc:Literal>
            
            </ogc:LowerBoundary>
            
            <ogc:UpperBoundary>
            
            <ogc:Literal>SEG_A69</ogc:Literal>
            
            </ogc:UpperBoundary>
            
            </ogc:PropertyIsBetween>
            
            </ogc:Filter>
            
            </wfs:Update>
            
            <!-- Delete the feature instance BuiltUpA_1M.1013. -->
            
            <wfs:Delete typeName="BuiltUpA_1M">
            
            <ogc:Filter>
            
            <ogc:GmlObjectId gml:id="BuiltUpA_1M.1013" />
            
            </ogc:Filter>
            
            </wfs:Delete>
            
            </wfs:Transaction>
            

            1.7.6.3. 3.響應示例?

            以下是一個WFS的Transaction操作的響應示例:

            <?xml version="1.0" ?>
            
            <wfs:TransactionResponse version="1.1.0"
            
            xmlns:wfs="http://www.opengis.net/wfs" xmlns:ogc="http://www.opengis.net/ogc"
            
            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
            
            xsi:schemaLocation="http://www.opengis.net/wfs ../wfs/1.1.0/WFS.xsd">
            
            <wfs:TransactionSummary>
            
            <wfs:totalInserted>1</wfs:totalInserted>
            
            <wfs:totalUpdated>1</wfs:totalUpdated>
            
            <wfs:totalDeleted>1</wfs:totalDeleted>
            
            </wfs:TransactionSummary>
            
            <wfs:InsertResults>
            
            <wfs:Feature handle="ComplexInsert">
            
            <ogc:FeatureId fid="RoadL_1M.1553" />
            
            </wfs:Feature>
            
            <wfs:Feature handle="Statement 2">
            
            <ogc:FeatureId fid="RoadL_1M.509876" />
            
            </wfs:Feature>
            
            <wfs:Feature handle="Statement 2">
            
            <ogc:FeatureId fid="BuiltUpA_1M.509877" />
            
            </wfs:Feature>
            
            </wfs:InsertResults>
            
            </wfs:TransactionResponse>
            

            1.7.7. ArcGISServer對WFS的支持?

            ArcGISServer10中支持的WFS版本為最新的1.1.0。在ArcGISServer 中,叧需簡單地勾選的Capabilities選項卡中可以選擇支持WFS,如圖 19。如果勾選了Transaction復選框,那么通過該WFS 還可以進行數據更新(注意,需要是SDE數據源)。

            image0

            圖19ArcGISServer發布WFS服務

            現在我們在瀏覽器中執行一個GetFeature操作,查詢名為“Beijing”的對象:

            http://localhost:8399/arcgis/services/test/wfsTest/MapServer/WFSServer?
            
            request=getfeature&
            
            typename=test_wfsTest:sde_cities&
            
            filter=(
            
            <ogc:Filter>
            
            <ogc:PropertyIsEqualTo>
            
            <ogc:PropertyName>CITY_NAME</ogc:PropertyName>
            
            <ogc:Literal>Beijing</ogc:Literal>
            
            </ogc:PropertyIsEqualTo>
            
            </ogc:Filter>
            
            )
            

            這個操作返回如下的結果:

            <wfs:FeatureCollection
            
            xsi:schemaLocation='http://localhost:8399/arcgis/services/test/wfsTest/MapServer/WFSServer http://localhost:8399/arcgis/services/test/wfsTest/MapServer/WFSServer?request=DescribeFeatureType%26version=1.1.0%26typename=sde_cities http://www.opengis.net/wfs http://schemas.opengis.net/wfs/1.1.0/wfs.xsd'
            
            xmlns:test_wfsTest='http://localhost:8399/arcgis/services/test/wfsTest/MapServer/WFSServer'
            
            xmlns:gml='http://www.opengis.net/gml' xmlns:wfs='http://www.opengis.net/wfs'
            
            xmlns:xlink='http://www.w3.org/1999/xlink' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'>
            
            <gml:boundedBy>
            
            <gml:Envelope srsName='urn:ogc:def:crs:EPSG:6.9:4326'>
            
            <gml:lowerCorner>-86.002616990000007
            
            -176.15156363599999</gml:lowerCorner>
            
            <gml:upperCorner>102.93161888100001
            
            179.22188769499999</gml:upperCorner>
            
            </gml:Envelope>
            
            </gml:boundedBy>
            
            <gml:featureMember>
            
            <test_wfsTest:sde_cities gml:id='F3__474'>
            
            <test_wfsTest:OBJECTID>474</test_wfsTest:OBJECTID>
            
            <test_wfsTest:CITY_NAME>Beijing</test_wfsTest:CITY_NAME>
            
            <test_wfsTest:GMI_ADMIN>CHN-BJN</test_wfsTest:GMI_ADMIN>
            
            <test_wfsTest:ADMIN_NAME>Beijing</test_wfsTest:ADMIN_NAME>
            
            <test_wfsTest:FIPS_CNTRY>CH</test_wfsTest:FIPS_CNTRY>
            
            <test_wfsTest:CNTRY_NAME>China</test_wfsTest:CNTRY_NAME>
            
            <test_wfsTest:STATUS>National and provincial capital</test_wfsTest:STATUS>
            
            <test_wfsTest:POP_RANK>1</test_wfsTest:POP_RANK>
            
            <test_wfsTest:POP_CLASS>5,000,000 and greater</test_wfsTest:POP_CLASS>
            
            <test_wfsTest:PORT_ID>0</test_wfsTest:PORT_ID>
            
            <test_wfsTest:LABEL_FLAG>1</test_wfsTest:LABEL_FLAG>
            
            <test_wfsTest:NEAR_FID>40</test_wfsTest:NEAR_FID>
            
            <test_wfsTest:NEAR_DIST>185.74736243999999</test_wfsTest:NEAR_DIST>
            
            <test_wfsTest:Shape>
            
            <gml:Point>
            
            <gml:pos>39.906189088000019 116.38803663600004</gml:pos>
            
            </gml:Point>
            
            </test_wfsTest:Shape>
            
            </test_wfsTest:sde_cities>
            
            </gml:featureMember>
            
            </wfs:FeatureCollection>
            

            接著,我想刪掉這個對象,就要使用Transaction操作。在ArcGISServer 中,執行刪除之前還需要lockId屬性,因此還需要通過GetFeatureWithLock 操作獲取一個鎖:

            http://localhost:8399/arcgis/services/test/wfsTest/MapServer/WFSServer?
            
            request=getfeaturewithlock&
            
            typename=test_wfsTest:sde_cities&
            
            filter=(
            
            <ogc:Filter>
            
            <ogc:PropertyIsEqualTo>
            
            <ogc:PropertyName>CITY_NAME</ogc:PropertyName>
            
            <ogc:Literal>Beijing</ogc:Literal>
            
            </ogc:PropertyIsEqualTo>
            
            </ogc:Filter>
            
            )
            

            這個操作返回lockId值為"{CEBC222E-00AD-49F5-A0E9-9F4CB98EE07E}",接下來,我們通過一個POST請求對這個對象進行刪除,請求體內容如下:

            <wfs:Transaction version="1.1.0" service="WFS"
            
            xmlns="http://www.someserver.com/myns"
            
            xmlns:wfs="http://www.opengis.net/wfs" xmlns:ogc="http://www.opengis.net/ogc"
            
            xmlns:gml="http://www.opengis.net/gml" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
            
            <wfs:LockId>{CEBC222E-00AD-49F5-A0E9-9F4CB98EE07E}</wfs:LockId>
            
            <wfs:Delete typeName="test_wfsTest:sde_cities">
            
            <ogc:Filter>
            
            <ogc:GmlObjectId gml:id="F3__474" />
            
            </ogc:Filter>
            
            </wfs:Delete>
            
            </wfs:Transaction>
            

            刪除成功后將會返回如下的結果:

            <wfs:TransactionResponse version='1.1.0'
            
            xmlns:xs='http://www.w3.org/2001/XMLSchema' xmlns:gml='http://www.opengis.net/gml'
            
            xmlns:ogc='http://www.opengis.net/ogc' xmlns:wfs='http://www.opengis.net/wfs'>
            
            <wfs:TransactionSummary>
            
            <wfs:totalDeleted>1</wfs:totalDeleted>
            
            </wfs:TransactionSummary>
            
            </wfs:TransactionResponse>
            

            我們也可以在其它的客戶端中直接加載這個WFS服務,比如使用uDig:

            image1

            圖20uDig中加載ArcGISServer發布的WFS服務

            18

            OGC Common Query Language,參考《OGC Catalogue Service 2.0.2》標準的 6.2 章節。

            2019夜晚睡不着你懂的,国产爆乳成aV人在线播放,久久精品人人做人人爽男男男

          2. <nav id="fhetv"></nav>

                  <listing id="fhetv"></listing>

                  <var id="fhetv"><mark id="fhetv"><cite id="fhetv"></cite></mark></var>