FRAMES | NO FRAMES |
Uploads a custom feature set into the repository.
Availability: Business Analyst Server 10.0.
bool UploadFeatureSet ( UploadFeatureSetParameters Parameters, esriFolderItem OutputItem );
Parameter | Description |
---|---|
Parameters | Configuration options for the utility. Type UploadFeatureSetParameters. |
OutputItem | Folder item to upload the custom feature layer to. Type esriFolderItem. |
Variable of type Boolean whose value is always true.
This method is used for uploading a custom feature layer with the point or polygon geometry. The custom feature layer is usually a point layer containing point features such as customers, businesses, hospitals, schools, etc. or a Business Analyst Trade Area layer.
NOTE: While uploaded, features of the repository layer receive serial values for the Object ID attribute starting from an initial value. The initial value depends on a type of feature class workspace used in the Business Analyst Server Repository. In a repository using shapefiles, feature IDs are enumerated from zero, but, in the ArcGIS Spatial Database Engine-based (ArcSDE-based) repository, feature IDs are usually enumerated from one. Since Object ID attribute value is automatically assigned to features of the repository layer, it has no sence to specify the Object ID attribute for features of the source feature layer. If this attribute is specified, it will be ignored. The name of the Object ID attribute of features depends on a feature class workspace type used. Typical names for Object ID are "FID", "OID", or "OBJECTID".
The example below creates a custom trade area around a store location and uploads it to a repository feature layer.
NOTE: The signature of the BAServerHelper.UploadFeatureSet method is modified against this method—a source feature record set is passed in parameters instead of UploadFeatureSetParameters type.
C# |
// Instantiate the BAServerHelper class to access analysis methods BAServerHelper baServerHelper = new BAServerHelper(); baServerHelper.ActiveDatasetID = "USA_ESRI"; // Optional parameter baServerHelper.IsFullErrorMessage = true; // Default is false // ========= STEP 1: Create custom trade area layer using simple rings PointRecord[] storePoints = new PointRecord[1]; storePoints[0] = new PointRecord(); storePoints[0].Name = "store_study_site"; storePoints[0].Description = "Store Study Site"; storePoints[0].StoreID = "1"; storePoints[0].Latitude = 34.057596; storePoints[0].Longitude = -117.195683; // Create a store feature layer based on an array of point records. PointLayer storeLayer = new PointLayer(); storeLayer.Points = storePoints; SimpleRingsParameters parameters = new SimpleRingsParameters(); // Set specific analysis parameters parameters.DistanceUnits = esriUnits.esriMiles; parameters.Donut = true; parameters.Radii = new double[] { 1, 2, 3 }; parameters.Stores = storeLayer; // Set other parameters RenderingParameters imageOptions = null; TaskOutputType[] outputOptions = new TaskOutputType[] { TaskOutputType.GetFeatureClass }; esriFolderItem outputLayer = null; esriFolderItem outputReport = null; TaskResultOutput result = baServerHelper.SimpleRings(parameters, imageOptions, outputOptions, outputLayer, outputReport); RecordSet customLayer = result.RecordSet; // ========= STEP 2: Upload the custom layer to repository item outputLayer = new esriFolderItem(); outputLayer.folderType = esriFolderType.esriFolderTradeAreas; outputLayer.itemName = "tradeArea_UploadFeatureSet"; outputLayer.workspaceName = "Default Workspace"; outputLayer.projectName = "Default Project"; baServerHelper.UploadFeatureSet(customLayer, outputLayer); |