Request parameters
Transaction operation implements adding features, updating features and deleting features three functions. The format is XML and the node features introduction is on the following:
Table 1 Node features for the Transaction operation
| Request parameters | Required/Optional | Description |
| <Transaction> | Mandatory |
A Transaction feature includes zero or multiple features that used to add, update and delete. Allows the <Transaction> is null , namely it does not contain other elements and the Transaction operation is meaningless. |
| <Insert> | Optional | Requires when adding features. The inserted feature should be described by <feature> with the format GML. And it may add several features in a <Insert>. |
| <Update> | Optional | Requires when updating features. typeName is used to specifies the type of updating feature. A <Update> contains one or multiple <Property> that used to specify the Name and Value. The property is null when do not have <Value>element. <Update> element also contains <Filter> that is to limit the range of updating element. Please refer to request example to see the result. |
| <Delete> | Optional | Requires when deleting features. typeName is used to specifies the type of deleting feature. A <Filter> element specify the one or multiple deleting features. |
Request example
This examples perform 3 action to the WFS service data-world/wfs100. First add a new feature. Second update the feature and then delete it. That is performing POST request to http://localhost:8090/iserver/services/data-world/wfs100?request=Transaction and sending the following request body:
Performs POST request and the request body is showing below:
<wfs:Transaction xmlns:wfs="http://www.opengis.net/wfs"
service="WFS" version="1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.opengis.net/wfs http://schemas.opengis.net/wfs/1.0.0/WFS-transaction.xsd http://www.supermap.com/World http://localhost:8090/iserver/services/data-World/wfs100?SERVICE=WFS&VERSION=1.0.0&REQUEST=DescribeFeatureType&TYPENAME=World:Capitals">
<wfs:Insert>
<World:Capitals xmlns:World="http://www.supermap.com/World">
<World:CAPITAL>testCapital</World:CAPITAL>
<World:COUNTRY>testCountry</World:COUNTRY>
<World:the_geom>
<gml:Point xmlns:gml="http://www.opengis.net/gml" srsName="EPSG:4326">
<gml:coordinates>143.09,35.57</gml:coordinates>
</gml:Point>
</World:the_geom>
</World:Capitals>
</wfs:Insert>
</wfs:Transaction>
After adding the feature, please refer to Response example.
Performs POST request and the request body is showing below:
<wfs:Transaction xmlns:wfs="http://www.opengis.net/wfs"
service="WFS" version="1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.opengis.net/wfs http://schemas.opengis.net/wfs/1.0.0/WFS-transaction.xsd http://www.supermap.com/World http://localhost:8090/iserver/services/data-world/wfs100?SERVICE=WFS&VERSION=1.0.0&REQUEST=DescribeFeatureType&TYPENAME=World:Capitals">
<wfs:Update typeName="World:Capitals" xmlns:World="http://www.supermap.com/World">
<wfs:Property>
<wfs:Name>CAPITAL</wfs:Name>
<wfs:Value>otherCapital</wfs:Value>
</wfs:Property>
<ogc:Filter xmlns:ogc="http://www.opengis.net/ogc">
<ogc:PropertyIsEqualTo>
<ogc:PropertyName>COUNTRY</ogc:PropertyName>
<ogc:Literal>testCountry</ogc:Literal>
</ogc:PropertyIsEqualTo>
</ogc:Filter>
</wfs:Update>
</wfs:Transaction>
After updating the feature, please refer to Response example.
Perform the POST request. Delete the otherCapital feature in World:Capitals layer, and the request body is:
<wfs:Transaction xmlns:wfs="http://www.opengis.net/wfs"
service="WFS" version="1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.opengis.net/wfs http://schemas.opengis.net/wfs/1.0.0/WFS-transaction.xsd http://www.supermap.com/World http://localhost:8090/iserver/services/data-world/wfs100?SERVICE=WFS&VERSION=1.0.0&REQUEST=DescribeFeatureType&TYPENAME=World:Capitals">
<wfs:Delete typeName="feature:Capitals" xmlns:feature="http://www.supermap.com/World">
xmlns:wfs="http://www.opengis.net/wfs" xmlns:ogc="http://www.opengis.net/ogc"
<ogc:Filter xmlns:ogc="http://www.opengis.net/ogc">
<ogc:PropertyIsEqualTo>
<ogc:Literal>otherCapital</ogc:Literal>
</ogc:PropertyIsEqualTo>
</ogc:Filter>
</wfs:Delete>
</wfs:Transaction>
After deleting the feature, please refer to Response example.
Execute a POST request to create a polygon feature with a hole in the ChongQing:City layer. The request body is as follows:
<wfs:Transaction xmlns:wfs="http://www.opengis.net/wfs" xmlns:gml="http://www.opengis.net/gml"
service="WFS" version="1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.opengis.net/wfs http://schemas.opengis.net/wfs/1.0.0/WFS-transaction.xsd https://www.supermap.com/DataSource http://172.16.120.157:8499/iserver/services/data-WorkSpace/wfs100?SERVICE=WFS&VERSION=1.0.0&REQUEST=DescribeFeatureType&TYPENAME=ChongQing:City">
<wfs:Insert>
<ChongQing:City xmlns:ChongQing="https://www.supermap.com/ChongQing">
<ChongQing:the_geom>
<gml:Polygon>
<gml:outerBoundaryIs>
<gml:LinearRing>
<gml:coordinates>108.46641599600281,-17.489768467768315 147.63474980294149,-17.489768467768315 147.63474980294149,-49.04203736780222 97.58632327185319,-56.29543251723529 92.87161642472168,-45.052670035614014 108.46641599600281,-17.489768467768315</gml:coordinates>
</gml:LinearRing>
</gml:outerBoundaryIs>
<gml:innerBoundaryIs>
<gml:LinearRing>
<gml:coordinates>117.89582969026583,-30.183209979276185 117.17049017532253,-40.70063294595417 134.21596877649023,-35.26058658387936 117.89582969026583,-30.183209979276185</gml:coordinates>
</gml:LinearRing>
</gml:innerBoundaryIs>
</gml:Polygon>
</ChongQing:the_geom>
</ChongQing:City>
</wfs:Insert>
</wfs:Transaction>
After the feature is successfully added, see Response Example for the response.
Execute a POST request to create a batch of polygon features with holes in the ChongQing:City layer. The request body is as follows:
<wfs:Transaction xmlns:wfs="http://www.opengis.net/wfs" xmlns:gml="http://www.opengis.net/gml"
service="WFS" version="1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.opengis.net/wfs http://schemas.opengis.net/wfs/1.0.0/WFS-transaction.xsd https://www.supermap.com/DataSource http://172.16.120.157:8499/iserver/services/data-WorkSpace/wfs100?SERVICE=WFS&VERSION=1.0.0&REQUEST=DescribeFeatureType&TYPENAME=ChongQing:City">
<wfs:Insert>
<ChongQing:City xmlns:ChongQing="https://www.supermap.com/ChongQing">
<ChongQing:the_geom>
<gml:MultiPolygon>
<gml:polygonMember>
<gml:Polygon>
<gml:outerBoundaryIs>
<gml:LinearRing>
<gml:coordinates>116.0,39.0 116.1,39.0 116.1,39.1 116.0,39.1 116.0,39.0</gml:coordinates>
</gml:LinearRing>
</gml:outerBoundaryIs>
<gml:innerBoundaryIs>
<gml:LinearRing>
<gml:coordinates>116.02,39.02 116.08,39.02 116.08,39.08 116.02,39.08 116.02,39.02</gml:coordinates>
</gml:LinearRing>
</gml:innerBoundaryIs>
</gml:Polygon>
</gml:polygonMember>
<gml:polygonMember>
<gml:Polygon>
<gml:outerBoundaryIs>
<gml:LinearRing>
<gml:coordinates>117.0,39.0 117.1,39.0 117.1,39.1 117.0,39.1 117.0,39.0</gml:coordinates>
</gml:LinearRing>
</gml:outerBoundaryIs>
<gml:innerBoundaryIs>
<gml:LinearRing>
<gml:coordinates>117.02,39.02 117.08,39.02 117.08,39.08 117.02,39.08 117.02,39.02</gml:coordinates>
</gml:LinearRing>
</gml:innerBoundaryIs>
</gml:Polygon>
</gml:polygonMember>
</gml:MultiPolygon>
</ChongQing:the_geom>
</ChongQing:City>
</wfs:Insert>
</wfs:Transaction>
After the features are successfully added, the response is similar to that of adding a single feature, and will not be repeated here.