Layer (Feature Service)

Description

The layer resource represents a single feature layer or a non-spatial table in a feature service. A feature layer is a table or view with at least one spatial column.

For tables, it provides basic information about the table such as its ID, name, fields, types, and templates. For feature layers, in addition to the table information, it provides information such as its geometry type, min and max scales, and spatial reference. Each type includes information about the type, such as the type ID, name, and definition expression. Subtypes also include a default symbol and a list of feature templates. Each feature template includes a template name, description, and prototypical feature.

The property capabilities return Query, Create, Delete, Update, and Editing capabilities. The Editing capability will be included if Create, Delete, or Update is enabled for a feature service.

The maxRecordCount property returns the maximum number of records that will be returned at once for a query.

The Layer resource returns relatedTableId, cardinality, role, keyField, and composite for all relationships. In addition, the relationshiptableId and keyFieldInRelationshipTable properties are returned for attributed relationships only.

The effectiveMinScale and effectiveMaxScale properties represent the effective minimum and maximum scales at which the layer is visible. Effective minimum and maximum scale are calculated based on the minScale and maxScale values of the current layer and its ancestors.

The Layer resource supports an input parameter returnUpdates that accepts a Boolean value. Pass this parameter to retrieve updated timeExtent for the layer.

The field property nullable indicates whether the field can accept null values.

If a layer has attachments, its hasAttachments property will be true.

If the layer objectIdField does not have a length property or the length property is set to 4, the objectIdField is 32-bit. If the objectIdField has a length of 8, the objectIdField is 64-bit.

The following properties describe features that have been added to the Feature Service through the various releases. If the property does not exist, it's equivalent to having a value of false or not set.

NoteNote:
A unique index is also required on the globalid column in order for supportsApplyEditsWithGlobalIds to be true. Globalid columns may not already have a unique index. You can use the add attribute index geoprocessing tool to create a new unique index on the globalid column in ArcGIS Pro and ArcGIS desktop. You can also remove the non-unique index using the remove attribute index geoprocessing tool. For services that support it, the AddtoDefinition operation from the services admin API can also be used to add the index.

SqlType

FieldType

Result database column type

Not specified

esriFieldTypeOID

[int]

sqlTypeBigInt

esriFieldTypeOID

[bigint] - not currently supported

sqlTypeBigInt

esriFieldTypeInteger

[bigint]

sqlTypeInteger

esriFieldTypeInteger

[int]

sqlTypeBit

esriFieldTypeSmallInteger

[bit]

sqlTypeTinyInt

esriFieldTypeSmallInteger

[tinyint]

sqlTypeInteger

esriFieldTypeSmallInteger

[smallint]

NA

esriFieldTypeDate

columnSize = 4 [smalldatatime]

NA

esriFieldTypeDate

columnSize = 10 [datetimeoffset]

NA

esriFieldTypeDate

columnSize = 8 or none [datetime2]

sqlTypeTime

esriFieldTypeString

[time]

sqlTypeTimestamp

esriFieldTypeString

[timestamp]

none

esriFieldTypeString

nvarchar

SqlTypeResource hierarchy

fslayer

Request parameters

Parameter

Details

f

Description: The response format. The default response format is html.

Values: html | json | pjson

returnUpdates

This option was added at 10.1.

Description: If value is true, an updated time extent is returned. If the layer is not time-aware, an empty response is returned.

Values: true | false

Example usage

Example: Get information about layer 0 in the "USA" Feature Service

http://services.myserver.com/ERmEceOGq5cHrItq/ArcGIS/rest/services/USA/FeatureServer/0

JSON response syntax

{
   "currentVersion": <currentVersion>, //Added at 10.0 SP1
   //properties applicable to both feature layers and tables
   "id" : <layerOrTableId>,
   "name" : "<layerOrTableName>",
   "type" : "<layerOrTableType>", //"Feature Layer" or "Table"
   "displayField" : "<field name>"
   "description" : "<description>",
   "copyrightText" : "<copyrightText>",
   "defaultVisibility": <true | false>,//Added at 10.1
   //Added at 10.1
    "editFieldsInfo": {
      "creationDateField": "<creationDateField>",
         "creatorField": "<creatorField>",
      "editDateField": "<editDateField>",
      "editorField": "<editorField>",
      "realm":"<realm>"
    },
    //Added at 10.1
    "ownershipBasedAccessControlForFeatures": {
     "allowOthersToUpdate": <true | false>,
     "allowOthersToDelete": <true | false>,
     "allowOthersToQuery": <true | false>
    },
    //Added at 10.1
    "syncCanReturnChanges": <true | false>,
    "relationships" : [
     {
       "id" : <relationshipId1>,
       "name" : "<relationshipName1>",
       "relatedTableId" : <relatedTableId1>,
       "cardinality" : "<esriRelCardinalityOneToOne>|<esriRelCardinalityOneToMany>|<esriRelCardinalityManyToMany>";,//Added at 10.1
       "role" : "<esriRelRoleOrigin>|<esriRelRoleDestination>";,//Added at 10.1
       "keyField" : "<keyFieldName2>",//Added at 10.1
       "composite" : <true>|<false>,//Added at 10.1
       "relationshipTableId": <attributedRelationshipClassTableId>,  //Added in 10.1. Returned only for attributed relationships
       "keyFieldInRelationshipTable": "<key field in AttributedRelationshipClass table that matches keyField>" //Added in 10.1. Returned only for attributed relationships
     },
     {
       "id" : <relationshipId2>,
       "name" : "<relationshipName2>",
       "relatedTableId" : <relatedTableId2>,
      "cardinality" : "<esriRelCardinalityOneToOne>|<esriRelCardinalityOneToMany>|<esriRelCardinalityManyToMany>";,//Added at 10.1
       "role" : "<esriRelRoleOrigin>|<esriRelRoleDestination>";,//Added at 10.1
       "keyField" : "<keyFieldName2>",//Added at 10.1
       "composite" : <true>|<false>,//Added at 10.1
       "relationshipTableId": <attributedRelationshipClassTableId>,  //Added in 10.1. Returned only for attributed relationships
       "keyFieldInRelationshipTable": "<key field in AttributedRelationshipClass table that matches keyField>" //Added in 10.1. Returned only for attributed relationships
     }
   ],
   "isDataVersioned": <true | false>, //Added at 10.1
   "supportsRollbackOnFailureParameter": <true | false>, //Added at 10.1
   "supportsStatistics": <true | false>, //Added at 10.1
   "supportsAdvancedQueries":<true | false>, //Added at 10.1
   //properties applicable to feature layers only
   "geometryType" : "<geometryType>",
   "minScale" : <minScale>,
   "maxScale" : <maxScale>,
   "effectiveMinScale" : <effectiveMinScale>,
   "effectiveMaxScale" : <effectiveMaxScale>,
   "extent" :  <envelope>,

   //for feature layers only
   "drawingInfo" : {
     "renderer" : <renderer>,
     "transparency" : <transparency>,
     "labelingInfo" : <labelingInfo>
   },
    "hasM":  <true | false>, //if the features in the layer have M values, the hasM property will be true
    "hasZ":  <true | false>, //if the features in the layer have Z values, the hasZ property will be true
   //if the layer / table supports querying based on time
    "enableZDefaults": <true | false>,//Added at 10.1
    "zDefault": <zDefaultValue>,//Added at 10.1
    "allowGeometryUpdates": <true | false>,//Added at 10.1
   "timeInfo" : {
     "startTimeField" : "<startTimeFieldName>",
     "endTimeField" : "<endTimeFieldName>",
     "trackIdField" : "<trackIdFieldName>",
     "timeExtent" : [<startTime>, <endTime>],
     "timeReference" : {
       "timeZone" : "<timeZone>",
       "respectsDaylightSaving" : <true | false>
     },
     "timeInterval" : <timeInterval>,
     "timeIntervalUnits" : "<timeIntervalUnits>"
   },

   //if the layer / table has attachments, the hasAttachments property will be true
   "hasAttachments" : <true | false>

   //from 10 onward - indicates whether the layer / table has htmlPopups
   "htmlPopupType" : "<esriServerHTMLPopupTypeNone | esriServerHTMLPopupTypeAsURL | esriServerHTMLPopupTypeAsHTMLText>",

   //layer / table fields
   "objectIdField" : "<objectIdFieldName>",
   "globalIdField" : "<globalIdFieldName>",
   "typeIdField" : "<typeIdFieldName>",
   //from 10.0 fields of type (String, Date, GlobalID, GUID and XML) have an additional length property, editable properties
   //from 10.1 fields have an additional nullable property
   "fields" : [
     {"name" : "<fieldName1>", "type" : "<fieldType1>", "alias" : "<fieldAlias1>", "length" : "<length1>", "editable" :    "<true | false>","nullable" : "<true | false>","domain" : <domain1>},
     {"name" : "<fieldName2>", "type" : "<fieldType2>", "alias" : "<fieldAlias1>", "length" : "<length2>", "editable" :    "<true | false>","nullable" : "<true | false>", "domain" : <domain2>}
   ],
   //layer / table sub-types
   "types" : [
     {
       "id" : <typeId1>,
       "name" : "<typeName1>",
       "domains" : {
         "<domainField11>" : <domain11>,
         "<domainField12>" : <domain12>
      },
       "templates" : [
         {
           "name" : "<templateName11>",
           "description" : "<templateDescription11>",
           "prototype" : <prototypicalFeature11>
         },
         {
           "name" : "<templateName12>",
           "description" : "<templateDescription12>",
           "prototype" : <prototypicalFeature12>
         }
       ]
     },
     {
       "id" : <typeId2>,
       "name" : "<typeName2>",
       "domains" : {
         "<domainField11>" : <domain21>,
         "<domainField12>" : <domain22>
       },
       "templates" : [
         {
           "name" : "<templateName21>",
           "description" : "<templateDescription21>",
           "prototype" : <prototypicalFeature21>,
           "drawingTool": "esriFeatureEditToolNone | esriFeatureEditToolPoint | esriFeatureEditToolLine | esriFeatureEditToolPolygon |
                        esriFeatureEditToolAutoCompletePolygon | esriFeatureEditToolCircle | esriFeatureEditToolEllipse | esriFeatureEditToolRectangle |
                        esriFeatureEditToolFreehand"
         },
         {
           "name" : "<templateName22>",
           "description" : "<templateDescription22>",
           "prototype" : <prototypicalFeature22>,
           "drawingTool": "esriFeatureEditToolNone | esriFeatureEditToolPoint | esriFeatureEditToolLine | esriFeatureEditToolPolygon |
                        esriFeatureEditToolAutoCompletePolygon | esriFeatureEditToolCircle | esriFeatureEditToolEllipse | esriFeatureEditToolRectangle |
                        esriFeatureEditToolFreehand"
         }
       ]
     }
   ],

   //layer / table templates - usually present when the layer / table has no sub-types
"templates" : [
     {
       "name" : "<templateName1>",
       "description" : "<templateDescription1>",
       "prototype" : <prototypicalFeature1>
     },
     {
       "name" : "<templateName2>",
       "description" : "<templateDescription2>",
       "prototype" : <prototypicalFeature2>
     }
   ],
   //Maximum number of records returned in a query result
   "maxRecordCount": <maxRecordCount> //Added at 10.1
   "supportedQueryFormats": "<supportedQueryFormats>", //Added at 10.1
   "hasStaticData" : <true | false>
   //comma separated list of supported capabilities - e.g. "Create,Delete,Query,Update,Editing"
   "capabilities" : "<capabilities>"

}

JSON response example

{
  "id": 0,
  "name": "Incidents",
  "type": "Feature Layer",
  "displayField": "req_id",
  "description": "",
  "copyrightText": ""
  "supportsRollbackOnFailures": true,
  "geometryType": "esriGeometryPoint",
  "minScale": 0,
  "maxScale": 0,
  "extent": {
    "xmin": -122.514435102,
    "ymin": 5.6843418860808E-14,
    "xmax": 138.625776397,
    "ymax": 67.1577965990001,
    "spatialReference": {
      "wkid": 4326
    }
  },
  "drawingInfo": {
    "renderer": {
      "type": "uniqueValue",
      "field1": "req_type",
      "field2": null,
      "field3": null,
      "defaultSymbol": null,
      "defaultLabel": "\u003call other values\u003e",
      "uniqueValueInfos": [
        {
          "value": "Blocked Street or Sidewalk",
          "label": "Blocked Street or Sidewalk",
          "description": "",
          "symbol": {
            "type": "esriPMS",
            "url": "1DD4FC53",
            "imageData": "iVBORw0KGgoAAAANSUhEUgAAABoAAAAaCAYAAACpSkzOAAAAAXNSR0IB2cksfwAAAAlwSFlzAAAOxAII=",
            "contentType": "image/png",
            "color": null,
            "width": 19,
            "height": 19,
            "angle": 0,
            "xoffset": 0,
            "yoffset": 0
          }
        },
        {
          "value": "Damaged Property",
          "label": "Damaged Property",
          "description": "",
          "symbol": {
            "type": "esriPMS",
            "url": "DF3100A6",
            "imageData": "iVBORw0KGgoAAAANSUhEUgAAABQAAAAMCAYAAABiDJ37AAAAAXNSR0IB2cksfwAAAAlwSFlzAAAOxAII=",
            "contentType": "image/png",
            "color": null,
            "width": 15,
            "height": 9,
            "angle": 0,
            "xoffset": 0,
            "yoffset": 0
          }
        },
        {
          "value": "Graffiti Complaint - Public Property",
          "label": "Graffiti Complaint",
          "description": "",
          "symbol": {
            "type": "esriPMS",
            "url": "B2E6E7A0",
            "imageData": "iVBORw0KGgoAAAANSUhEUgAAABoAAAAaCAYAAACpSkzOAAAAAXNSR0IB2cksfwAAAAlwSFlzAAAOxAAg==",
            "contentType": "image/png",
            "color": null,
            "width": 19,
            "height": 19,
            "angle": 0,
            "xoffset": 0,
            "yoffset": 0
          }
        },
        {
          "value": "Graffiti Complaint � Private Property",
          "label": "Graffiti Complaint",
          "description": "",
          "symbol": {
            "type": "esriPMS",
            "url": "B2E6E7A0",
            "imageData": "iVBORw0KGgoAAAANSUhEUgAAABoAAAAaCAYAAACpSkzOAAAAAXNSR0IB2cksfwAAAAlwSFlzAAAOxAAAg==",
            "contentType": "image/png",
            "color": null,
            "width": 19,
            "height": 19,
            "angle": 0,
            "xoffset": 0,
            "yoffset": 0
          }
        },
        {
          "value": "Sewer Issues",
          "label": "Sewer Issues",
          "description": "",
          "symbol": {
            "type": "esriPMS",
            "url": "80DC11A7",
            "imageData": "iVBORw0KGgoAAAANSUhEUgAAABYAAAAaCAYAAACzdqxAAAAAAXNSR0IB2cksfwAAAAlwSFlzAAAOxAAAg==",
            "contentType": "image/png",
            "color": null,
            "width": 16,
            "height": 19,
            "angle": 0,
            "xoffset": 0,
            "yoffset": 0
          }
        },
        {
          "value": "Sidewalk and Curb Issues",
          "label": "Sidewalk and Curb Issues",
          "description": "",
          "symbol": {
            "type": "esriPMS",
            "url": "19213DC2",
            "imageData": "iVBORw0KGgoAAAANSUhEUgAAABoAAAAaCAYAAACpSkzOAAAAAXNSR0IB2cksfwAAAAlwSFlzAAAOxAAAII=",
            "contentType": "image/png",
            "color": null,
            "width": 19,
            "height": 19,
            "angle": 0,
            "xoffset": 0,
            "yoffset": 0
          }
        },
        {
          "value": "Tree Maintenance or Damage",
          "label": "Tree Maintenance or Damage",
          "description": "",
          "symbol": {
            "type": "esriPMS",
            "url": "37B62A6C",
            "imageData": "iVBORw0KGgoAAAANSUhEUgAAABcAAAAaCAYAAABctMd+AAAAAXNSR0IB2cksfwAAAAlwSFlzAAAOxAAACC",
            "contentType": "image/png",
            "color": null,
            "width": 17,
            "height": 19,
            "angle": 0,
            "xoffset": 0,
            "yoffset": 0
          }
        }
      ]
    },
    "transparency": 0,
    "labelingInfo": null
  },
  "hasAttachments": false,
  "htmlPopupType": "esriServerHTMLPopupTypeAsHTMLText",
  "objectIdField": "objectid",
  "globalIdField": "",
  "typeIdField": "req_type",
  "fields": [
    {
      "name": "objectid",
      "type": "esriFieldTypeOID",
      "alias": "Object ID",
      "editable": false,
      "nullable": true,
      "domain": null
    },
    {
      "name": "req_id",
      "type": "esriFieldTypeString",
      "alias": "Request ID",
      "editable": true,
      "length": 20,
      "nullable": true,
      "domain": null
    },
    {
      "name": "req_type",
      "type": "esriFieldTypeString",
      "alias": "Request Type",
      "editable": true,
      "length": 40,
      "nullable": true,
      "domain": null
    },
    {
      "name": "req_date",
      "type": "esriFieldTypeString",
      "alias": "Request Date",
      "editable": true,
      "length": 30,
      "nullable": true,
      "domain": null
    },
    {
      "name": "req_time",
      "type": "esriFieldTypeString",
      "alias": "Request Time",
      "editable": true,
      "length": 20,
      "nullable": true,
      "domain": null
    },
    {
      "name": "address",
      "type": "esriFieldTypeString",
      "alias": "Address",
      "editable": true,
      "length": 60,
      "nullable": true,
      "domain": null
    },
    {
      "name": "x_coord",
      "type": "esriFieldTypeString",
      "alias": "X Coordinate",
      "editable": true,
      "length": 20,
      "nullable": true,
      "domain": null
    },
    {
      "name": "y_coord",
      "type": "esriFieldTypeString",
      "alias": "Y Coordinate",
      "editable": true,
      "length": 20,
      "nullable": true,
      "domain": null
    },
    {
      "name": "district",
      "type": "esriFieldTypeString",
      "alias": "District",
      "editable": true,
      "length": 20,
      "nullable": true,
      "domain": null
    },
    {
      "name": "status",
      "type": "esriFieldTypeSmallInteger",
      "alias": "Status",
      "editable": true,
      "nullable": true,
      "domain": {
        "type": "codedValue",
        "name": "StatusCodes",
        "codedValues": [
          {
            "name": "New",
            "code": 1
          },
          {
            "name": "Open",
            "code": 2
          },
          {
            "name": "Closed",
            "code": 3
          }
        ]
      }
    }
  ],
  "types": [
    {
      "id": "Graffiti Complaint - Private Property",
      "name": "Graffiti Complaint",
      "domains": {
        
      },
      "templates": [
        {
          "name": "Graffiti Complaint",
          "description": "",
          "drawingTool": "esriFeatureEditToolPoint",
          "prototype": {
            "attributes": {
              "status": 1,
              "req_id": null,
              "req_type": "Graffiti Complaint - Private Property",
              "req_date": null,
              "req_time": null,
              "address": null,
              "x_coord": null,
              "y_coord": null,
              "district": null
            }
          }
        }
      ]
    },
    {
      "id": "Blocked Street or Sidewalk",
      "name": "Blocked Street or Sidewalk",
      "domains": {
        
      },
      "templates": [
        {
          "name": "Blocked Street or Sidewalk",
          "description": "",
          "drawingTool": "esriFeatureEditToolPoint",
          "prototype": {
            "attributes": {
              "status": 1,
              "req_id": null,
              "req_type": "Blocked Street or Sidewalk",
              "req_date": null,
              "req_time": null,
              "address": null,
              "x_coord": null,
              "y_coord": null,
              "district": null
            }
          }
        }
      ]
    },
    {
      "id": "Damaged Property",
      "name": "Damaged Property",
      "domains": {
        
      },
      "templates": [
        {
          "name": "Damaged Property",
          "description": "",
          "drawingTool": "esriFeatureEditToolPoint",
          "prototype": {
            "attributes": {
              "status": 1,
              "req_id": null,
              "req_type": "Damaged Property",
              "req_date": null,
              "req_time": null,
              "address": null,
              "x_coord": null,
              "y_coord": null,
              "district": null
            }
          }
        }
      ]
    },
    {
      "id": "Graffiti Complaint - Public Property",
      "name": "Graffiti Complaint",
      "domains": {
        
      },
      "templates": [
        {
          "name": "Graffiti Complaint",
          "description": "",
          "drawingTool": "esriFeatureEditToolPoint",
          "prototype": {
            "attributes": {
              "status": 1,
              "req_id": null,
              "req_type": "Graffiti Complaint - Public Property",
              "req_date": null,
              "req_time": null,
              "address": null,
              "x_coord": null,
              "y_coord": null,
              "district": null
            }
          }
        }
      ]
    },
    {
      "id": "Sewer Issues",
      "name": "Sewer Issues",
      "domains": {
        
      },
      "templates": [
        {
          "name": "Sewer Issues",
          "description": "",
          "drawingTool": "esriFeatureEditToolPoint",
          "prototype": {
            "attributes": {
              "status": 1,
              "req_id": null,
              "req_type": "Sewer Issues",
              "req_date": null,
              "req_time": null,
              "address": null,
              "x_coord": null,
              "y_coord": null,
              "district": null
            }
          }
        }
      ]
    },
    {
      "id": "Tree Maintenance or Damage",
      "name": "Tree Maintenance or Damage",
      "domains": {
        
      },
      "templates": [
        {
          "name": "Tree Maintenance or Damage",
          "description": "",
          "drawingTool": "esriFeatureEditToolPoint",
          "prototype": {
            "attributes": {
              "status": 1,
              "req_id": null,
              "req_type": "Tree Maintenance or Damage",
              "req_date": null,
              "req_time": null,
              "address": null,
              "x_coord": null,
              "y_coord": null,
              "district": null
            }
          }
        }
      ]
    },
    {
      "id": "Sidewalk and Curb Issues",
      "name": "Sidewalk and Curb Issues",
      "domains": {
        
      },
      "templates": [
        {
          "name": "Sidewalk and Curb Issues",
          "description": "",
          "drawingTool": "esriFeatureEditToolPoint",
          "prototype": {
            "attributes": {
              "status": 1,
              "req_id": null,
              "req_type": "Sidewalk and Curb Issues",
              "req_date": null,
              "req_time": null,
              "address": null,
              "x_coord": null,
              "y_coord": null,
              "district": null
            }
          }
        }
      ]
    }
  ],
  "templates": [
    
  ],
  "capabilities": "Create,Delete,Query,Update,Editing"
}