FRAMES | NO FRAMES

 

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

Upload Feature Set Endpoint

Uploads a custom feature set into the repository.

 

Availability: Business Analyst Server.

 

URL Example

http://localhost:6080/arcgis/rest/services/DefaultMap/MapServer/exts/BAServer/UploadFeatureSet/execute

Parameters

Parameter

Description

FeatureSet (required)

Custom feature set. Type DataLayer. The FeatureSet layer should be specified by the RecordSet property value.

OutputAnalysisItem (required)

Folder item to upload the custom feature layer. Type esriFolderItem.

IsFullErrorMessage (optional)

Mode for composing error messages. Type boolean.

Default: false.

f (optional)

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

Default: HTML.

token

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

Returns

Variable of type boolean whose value is always true.

Remarks

This endpoint 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 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. Because the Object ID attribute value is automatically assigned to features of the repository layer, you do not need to specify the Object ID attribute for features of the source feature layer. If this attribute is specified, it will be ignored.

Example Usage

The example below illustrates a workflow consisting of uploading a custom trade area layer to Business Analyst Server Repository and retrieving it with the Open Feature Layer endpoint. The retrieved feature layer is shown in two variants—for shapefile-based repository and for SDE-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". You can recognize the Object ID field by its type "esriFieldTypeOID" returned within the "fields" array when the feature layer is retrieved with Open Feature Layer task. Additional attributes can also appear in the repository feature layer. For example, the "Shape.area" and "Shape.len" attributes appear in a response from the SDE-based repository.

 

STEP 1: Upload Custom Feature Set

http://localhost:6080/arcgis/rest/services/DefaultMap/MapServer/exts/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":"CustomTradeArea"
}&
f=PJSON

 

STEP 2: Open Feature Layer

http://localhost:6080/arcgis/rest/services/DefaultMap/MapServer/exts/BAServer/OpenFeaturelayer/execute?
Item={
  "workspaceName":"Default Workspace",
  "projectName":"Default Project",
  "folderType":"esriFolderTradeAreas",
  "itemName":"CustomTradeArea"
}&
f=PJSON

 

Response from a Shapefile-Based Repository

{
  "results":
  [
    {
      "paramName":"OutputFeatureClass",
      "dataType":"GPFeatureRecordSetLayer",
      "value":
      {
        "geometryType":"esriGeometryPolygon",
        "spatialReference":
        {
          "wkid":4269
        },
        "fieldAliases":
        {
          "FID":"FID",
          "AREA_ID":"AREA_ID",
          "STORE_ID":"STORE_ID",
          "RING":"RING",
          "RING_DEFN":"RING_DEFN",
          "AREA_DESC":"AREA_DESC"
        },
        "fields":
        [
          {
            "name":"FID",
            "type":"esriFieldTypeOID",
            "alias":"FID"
          },
          ...
          {
            "name":"AREA_DESC",
            "type":"esriFieldTypeString",
            "alias":"AREA_DESC",
            "length":256
          },
        ],
        "features":
        [
          {
            "geometry":
            {
              "rings":
              [
                [
                  [
                    -122.4346,
                    37.856648
                  ],
                  ...
                  [
                    -122.4346,
                    37.856648
                  ]
                ]
              ],
              "spatialReference":
              {
                "wkid":4269
              }
            },
            "attributes":
            {
              "FID":0,
              "AREA_ID":"1_1",
              "STORE_ID":"1",
              "RING":1,
              "RING_DEFN":"5",
              "AREA_DESC":"0 - 5 Miles",
            }
          },
          {
            "geometry":
            {
              "rings":
              [
                [
                  [
                    -122.4329,
                    37.805748
                  ],
                  ...
                  [
                    -122.4329,
                    37.805748
                  ]
                ]
              ],
              "spatialReference":
              {
                "wkid":4269
              }
            },
            "attributes":
            {
              "FID":1,
              "AREA_ID":"2_1",
              "STORE_ID":"2",
              "RING":1,
              "RING_DEFN":"5",
              "AREA_DESC":"0 - 5 Miles",
            }
          }
        ]
      }
    }
  ],
  "messages":
  [
  ]
}

 

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

 

Response from a SDE-Based Repository

{
  "results":
  [
    {
      "paramName":"OutputFeatureClass",
      "dataType":"GPFeatureRecordSetLayer",
      "value":
      {
        "geometryType":"esriGeometryPolygon",
        "spatialReference":
        {
          "wkid":4326
        },
        "fieldAliases":
        {
          "FID":"Object ID",
          "AREA_DESC":"AREA_DESC",
          "AREA_ID":"AREA_ID",
          "RING":"RING",
          "RING_DEFN":"RING_DEFN",
          "STORE_ID":"STORE_ID",
          "Shape.area":"Shape.area",
          "Shape.len":"Shape.len"
        },
        "fields":
        [
          {
            "name":"FID",
            "type":"esriFieldTypeOID",
            "alias":"Object ID"
          },
          ...
          {
            "name":"Shape.len",
            "type":"esriFieldTypeDouble",
            "alias":"Shape.len"
          }
        ],
        "features":
        [
          {
            "geometry":
            {
              "rings":
              [
                [
                  [
                    -122.4346,
                    37.856648
                  ],
                  ...
                  [
                    -122.4346,
                    37.856648
                  ]
                ]
              ],
              "spatialReference":
              {
                "wkid":4326
              }
            },
            "attributes":
            {
              "OBJECTID":1,
              "AREA_DESC":"0 - 5 Miles",
              "AREA_ID":"1_1",
              "RING":1,
              "RING_DEFN":"5",
              "STORE_ID":"1",
              "Shape.area":0.0180196727515,
              "Shape.len":0.49830034470522
            }
          },
          {
            "geometry":
            {
              "rings":
              [
                [
                  [
                    -122.4329,
                    37.805748
                  ],
                  ...
                  [
                    -122.4329,
                    37.805748
                  ]
                ]
              ],
              "spatialReference":
              {
                "wkid":4326
              }
            },
            "attributes":
            {
              "OBJECTID":2,
              "AREA_DESC":"0 - 5 Miles",
              "AREA_ID":"2_1",
              "RING":1,
              "RING_DEFN":"5",
              "STORE_ID":"2",
              "Shape.area":0.0180074758195,
              "Shape.len":0.498103034899043
            }
          }
        ]
      }
    }
  ],
  "messages":
  [
  ]
}

 

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

 

See Also

Add Features Endpoint

Delete Features Endpoint

Edit Features Endpoint

Open Feature Layer Endpoint

Business Analyst Server Repository

Business Analyst Server REST Reference