FRAMES | NO FRAMES

 

B U S I N E S S   A N A L Y S T   10.0   R E S T   A P I   R E P O S I T O R Y   U T I L I T Y

Delete Features Endpoint

Deletes features in a repository feature layer.

 

Availability: Business Analyst Server 9.3.1 SP1.

 

URL Example

http://localhost/ArcGIS/baserver/REST/services/DefaultMap/BAServer/DeleteFeatures/execute

Parameters

Parameter

Description

ChangedItem (required)

Folder item containing a feature layer to be modified. Type esriFolderItem.

OIDs (required)

Array of OIDs of features to be deleted. Type array of int.

f (optional)

Response format. Type string. Available formats: HTML, JSON, PJSON, XML.

Default: HTML.

IsFullErrorMessage (optional)

Mode for composing error messages. Type boolean.

Default: false.

token

Authentication token. This parameter is required if your Business Analyst Server is secured. Type string.

Returns

Variable of type boolean whose true value means that at least one feature was deleted.

Remarks

This endpoint deletes features whose Object ID value is listed in the input OIDs array. Typically, values of Object ID are enumerated in a repository feature layer from zero (for shapefile workspace type) or one (in other cases). When features are removed from a repository feature layer, Object IDs of remaining features can be changed. For example, in the case of shapefile workspace, Object IDs of remaining features are renumbered.

Example Usage

The example below illustrates a workflow consisting of uploading a custom trade area layer to the Business Analyst Server Repository with the Upload Feature Set endpoint, deleting a feature with this endpoint, and retrieving the modified layer with the Open Feature Layer endpoint.

 

The retrieved feature layer is shown here in the case of a shapefile-based repository.

 

NOTE: 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".

 

STEP 1: Upload Custom Feature Set

http://localhost/ArcGIS/baserver/REST/services/DefaultMap/BAServer/UploadFeatureSet/execute?
FeatureSet={"Recordset":{
  "geometryType":"esriGeometryPolygon",
  "spatialReference":{"wkid":4269},
  "features":[
    {
      "geometry":{
        "rings":[[
          [-122.4346,37.8566476371076],[-122.360655858915,37.826739954428],
          [-122.347749703146,37.761714833162],[-122.406398364369,37.7151967133423],
          [-122.488250155425,37.7254855017619],[-122.525947479981,37.784114591287],
          [-122.488335196333,37.8427896412311],[-122.4346,37.8566476371076]
        ]],
        "spatialReference":{"wkid":4269}
      },
      "attributes":{"AREA_ID":"1_1","STORE_ID":"1","RING":1,"RING_DEFN":"5","AREA_DESC":"0 - 5 Miles"}
    },
    {
      "geometry":{
        "rings":[[
          [-122.4329,37.8057482650651],[-122.35900658434,37.775840365754],
          [-122.346109142864,37.7108146974946],[-122.404717633044,37.6642961225184],
          [-122.48651348554,37.6745850161913],[-122.524184911958,37.7332146557964],
          [-122.486598312884,37.791890171551],[-122.4329,37.8057482650651]
        ]],
        "spatialReference":{"wkid":4269}
      },
      "attributes":{"AREA_ID":"2_1","STORE_ID":"2","RING":1,"RING_DEFN":"5","AREA_DESC":"0 - 5 Miles"}
    }
  ]
}}&
OutputAnalysisItem={
  "workspaceName":"Default Workspace",
  "projectName":"Default Project",
  "folderType":"esriFolderTradeAreas",
  "itemName":"DeleteFeaturesSample"
}&
f=PJSON

 

STEP 2: Delete Features

http://localhost/ArcGIS/baserver/REST/services/DefaultMap/BAServer/DeleteFeatures/execute?
ChangedItem={
  "workspaceName":"Default Workspace",
  "projectName":"Default Project",
  "folderType":"esriFolderTradeAreas",
  "itemName":"DeleteFeaturesSample"
}&
OIDs=0&
f=PJSON

 

STEP 3: Open Feature Layer

http://localhost/ArcGIS/baserver/REST/services/DefaultMap/BAServer/OpenFeatureLayer/execute?
Item={
  "workspaceName":"Default Workspace",
  "projectName":"Default Project",
  "folderType":"esriFolderTradeAreas",
  "itemName":"DeleteFeaturesSample"
}&
f=PJSON

 

Response

{
  "results":
  [
    {
      "paramName":"OutputFeatureClass",
      "dataType":"GPFeatureRecordSetLayer",
      "value":
      {
        "geometryType":"esriGeometryPolygon",
        "spatialReference":
        {
          "wkid":4326
        },
        "features":
        [
          {
            "geometry":
            {
              "rings":
              [
                [
                  [
                    -122.4329,
                    37.805748
                  ],
                  ...
                  [
                    -122.4329,
                    37.805748
                  ]
                ]
              ],
              "spatialReference":
              {
                "wkid":4326
              }
            },
            "attributes":
            {
              "FID":1,
              "AREA_DESC":"0 - 5 Miles",
              "AREA_ID":"2_1",
              "RING":1,
              "RING_DEFN":"5",
              "STORE_ID":"2"
            }
          }
        ]
      }
    }
  ],
  "messages":
  [
  ]
}

 

NOTE: The response has been abbreviated where "..." is noted.

 

See Also

Add Features Endpoint

Edit Features Endpoint

Open Feature Layer Endpoint

Upload Feature Set Endpoint

Business Analyst Server Repository

Business Analyst Server REST API Reference