Dashboard > OWS Documenation > WFS > Transaction - add, delete, or update features
Transaction - add, delete, or update features Log In | Sign Up   View a printable version of the current page.

Added by David Blasby , last edited by Chris Holmes on Aug 14, 2005  (view change)
Labels: 
(None)

The transaction operation is used to add, delete, or update features in a standard way. It uses GML and Filters. Versioning, attribution, security, diffs, and history are outside the scope of the specification, but it can certainly be expanded to deal with them, and The Open Planning Project is going to be investigating and implementing over the coming months. This section needs to be fleshed out more, but here are a few examples (from the WFS spec):

An insert of one feature:

<?xmlversion="1.0"?>
<wfs:Transaction
version="1.0.0"
service="WFS"
xmlns="http://www.someserver.com/myns"
xmlns:gml="http://www.opengis.net/gml"
xmlns:wfs="http://www.opengis.net/wfs"
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=INWATERA_1M.xsd
http://www.opengis.net/wfs../wfs/1.0.0/WFS-transaction.xsd">
<wfs:Insert>
  <INWATERA_1M>
    <WKB_GEOM>
     <gml:Polygongid="1" srsName="http://www.opengis.net/gml/srs/epsg.xml#4326">
       <gml:outerBoundaryIs>
         <gml:LinearRing>
           <gml:coordinates>-98.54,24.26...</gml:coordinates>
         </gml:LinearRing>
       </gml:outerBoundaryIs>
     </gml:Polygon>
   </WKB_GEOM>
   <ID>150</ID>
   <F_CODE>ABCDE</F_CODE>
   <HYC>152</HYC>
   <TILE_ID>250</TILE_ID>
   <FAC_ID>111</FAC_ID>
 </INWATERA_1M>
</wfs:Insert>
</wfs:Transaction>

An update of the feature identified by: BUILTUPA_1M.10131

<?xmlversion="1.0"?>
<wfs:Transaction
version="1.0.0"
service="WFS"
xmlns="http://www.someserver.com/myns"
xmlns:ogc="http://www.opengis.net/ogc"
xmlns:wfs="http://www.opengis.net/wfs"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.opengis.net/wfs../wfs/1.0.0/WFS-transaction.xsd">
  <wfs:UpdatetypeName="BUILTUPA_1M">
    <wfs:Property>
      <wfs:Name>POPULATION</wfs:Name>
      <wfs:Value>4070000</wfs:Value>
    </wfs:Property>
    <ogc:Filter>
      <ogc:FeatureIdfid="BUILTUPA_1M.10131"/>
    </ogc:Filter>
  </wfs:Update>
</wfs:Transaction>

Delete all features in a given area:

<?xmlversion="1.0"?>
<wfs:Transaction
version="1.0.0"
service="WFS"
xmlns="http://www.someserver.com/myns"
xmlns:wfs="http://www.opengis.net/wfs"
xmlns:gml="http://www.opengis.net/gml"
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.0.0/WFS-transaction.xsd">
  <wfs:DeletetypeName="INWATERA_1M">
    <ogc:Filter>
      <ogc:Within>
        <ogc:PropertyName>WKB_GEOM</ogc:PropertyName>
          <gml:Polygongid="pp9" srsName="http://www.opengis.net/gml/srs/epsg.xml#4326">
            <gml:outerBoundaryIs>
              <gml:LinearRing>
                <gml:coordinates>-95.7,38.1-97.8,38.2...</gml:coordinates>
              </gml:LinearRing>
            </gml:outerBoundaryIs>
          </gml:Polygon>
        </ogc:Within>
      </ogc:Filter>
    </wfs:Delete>
</wfs:Transaction>
Powered by a free Atlassian Confluence Open Source Project License granted to uDig. Evaluate Confluence today.
Powered by Atlassian Confluence 2.7.1, the Enterprise Wiki. Bug/feature request - Atlassian news - Contact administrators
User-friendly Desktop Internet GIS