updateFeatures

Description

Updates features in a table by passing in a feature collection with an optional commitInterval. Each feature in the collection must have an ID (primary key) which is used to match the input feature with the feature in the table. The response contains the number of features that were successfully updated. A typical workflow is to generate the feature collection using a listFeatures or search operation, modify the feature collection, then pass the modified feature collection into the updateFeatures operation.

Note: You must have View permissions on the named table as well as Create/Modify/Delete permissions on the named table's associated dataset to perform insert, update, and delete operations on writable tables. See Access Control for Datasets in the Administration section for more information.
The default value for the commitInterval is 50; therefore, the first 50 updates will be committed within one transaction. If the value is less than 1, the default value of 50 is used. It is not recommended to set this value to 1 as one transaction will be used for one update.
Note: This operation is supported on PostGIS, Oracle, SQL Server, SAP HANA, GeoPackage, and generic JDBC tables. The table must have a primary key or it will be considered a read-only table. Named tables with composite primary keys are not writable.

Messages

The following table lists the request and response messages for the updateFeatures operation.

Click on a message name to get more information about the message.

Message Description
UpdateFeaturesRequest The request message for the updateFeatures operation.
UpdateFeaturesResponse The response message for the updateFeatures operation.

Example

Example for updating features in a table. The AttributeDefinitionList defines the columns of the table, and the FeatureList defines the values to be updated:

						
<?xml version="1.0" encoding="UTF-8"?>
<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/" xmlns="http://www.mapinfo.com/midev/service/feature/v1" xmlns:ns3="http://www.mapinfo.com/midev/service/featurecollection/v1" xmlns:ns4=http://www.mapinfo.com/midev/service/geometries/v1 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
	<S:Header/>
	<S:Body>
		<UpdateFeaturesRequest table="/MyTable" commitInterval="1">
			<ns3:FeatureCollection>
				<ns3:FeatureCollectionMetadata>
					<ns3:AttributeDefinitionList>
						<ns3:AttributeDefinition xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ns3:ScalarAttributeDefinition" dataType="Double" name="Column1"/>
						<ns3:AttributeDefinition xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ns3:GeometryAttributeDefinition" srsName="epsg:4267" dataType="Geometry" name="SP_GEOMETRY"/>
					</ns3:AttributeDefinitionList>
				</ns3:FeatureCollectionMetadata>
				<ns3:FeatureList>
					<ns3:Feature id="1">
						<ns3:AttributeValue xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ns3:DoubleValue">
							<ns3:Value>123.456</ns3:Value>
						</ns3:AttributeValue>
						<ns3:AttributeValue xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ns3:GeometryValue">
							<ns4:FeatureGeometry xsi:type="ns4:Point" srsName="epsg:4326">
								<ns4:Pos>
									<ns4:X>-72</ns4:X>
									<ns4:Y>42</ns4:Y>
								</ns4:Pos>
							</ns4:FeatureGeometry>
						</ns3:AttributeValue>
					</ns3:Feature>
				</ns3:FeatureList>
			</ns3:FeatureCollection>
		</UpdateFeaturesRequest>
	</S:Body>
	</S:Header>
</S:Envelope>