Image service Update method
Updates catalog items in an image service. It can overwrite existing rasters or attributes.
Udpate(FIDSet FIDs,RasterItemDescription[] RasterItemDescriptions)
Parameter |
Description |
---|---|
FIDSet |
A list of catalog item IDs to update. |
RasterItemDescription[] | An array of RasterItemDescription objects. |
Return Value
An array of ImageServerEditResult objects.
Remarks
Update can be used to replace the existing raster with new rasters, update georeferencing information, visibility range, or attribute values.
ImageServerEditResult contains the raster ID being modified, and the status of the modification (success or failure).
Examples
C#
//define image server
UploadTest_ImageServer imageServer = new UploadTest_ImageServer();
imageServer.Url = _serviceurl;
//define raster item description
string[] urls = new string[] { "http://istest/cal/tile1/tile1.tif", "http://istest/cal/tile1/tile1.aux.xml", "http://istest/cal/tile1/tile1.tfw", "http://istest/cal/tile1/tile1.ovr" };
string[] names = new string[] { "tile1.tif", "tile1.aux.xml", "tile1.tfw" };
RasterItemDescription itemDescription = new RasterItemDescription();
itemDescription.DataFileURLs = urls;
itemDescription.DataFileNames = names;
itemDescription.BuildThumbnail = true;
itemDescription.BuildThumbnailSpecified = true;
itemDescription.Type = "Raster Dataset";
PropertySetProperty prop = new PropertySetProperty();
prop.Key = "MyField";
prop.Value = "MyValue";
PropertySet propSet = new PropertySet();
propSet.PropertyArray = new PropertySetProperty[] { prop };
itemDescription.Properties = propSet;
//define transformation to update georeferencing
PolynomialXform polyXform = new PolynomialXform();
polyXform.SourceGCPs = new double[]{0,0, 100, 100, 0,100};
polyXform.TargetGCPs = new double[] { 100, 100, 300, 300, 100, 300 };
polyXform.PolynomialOrder = 1;
polyXform.PolynomialOrderSpecified = true;
polyXform.SpatialReference = ((EnvelopeN)imageServer.GetServiceInfo().Extent).SpatialReference;
itemDescription.GeodataXform = polyXform;
//define FIDSet
FIDSet fidSet = new FIDSet();
fidSet.FIDArray = new int[] { 5 };
//update
ImageServerEditResult[] editResults = imageServer.Update(fidSet, new RasterItemDescription[] { itemDescription });
//log results
for (int i = 0; i < editResults.Length; i++)
Console.WriteLine("RID: {0}, status: {1}", editResults[i].RasterID,editResults[i].Succeeded);
}
10/23/2013