Skip To Content
ArcGIS Developers
Dashboard

Feature Layer

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 above, 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. Sub-types also include a default symbol and a list of feature templates.

Each feature template includes a template name, description and a prototypical feature.

The property resultType in the layer metadata object will determine the max record count. The resultType can either be {none, standard, tile}.

  • The resultType parameter is only supported if the layer metadata returns supportQueryWithResultType is true in the advancedQueryCapabilitites metadata object.
  • The property maxRecordCount is used if the resultType value is none. This can be the default server assigned (1000, 2000) or a value that is overwritten by the service owner or admin.
  • The property standardMaxRecordCount is used if the resultType value is standard. Example: ("standardMaxRecordCount": 32000)
  • The property tileMaxRecordCount is used if the resultType value is tile. Example: ("tileMaxRecordCount": 8000).
  • The layer metadata will also include the maxRecordCountFactor property and can be configured from the admin API. The server maxRecordCount for {standard, tile} will be the (base * maxRecordCountFactor). All maxRecordCount will be adjusted with the maxRecordCountFactor.

The property capabilities returns Query, Create, Delete, Update, and Editing capabilities. The Editing capability will be included if Create, Delete or Update is enabled for a Feature Service.

Note, query and edit operations are not available on a layer in the administrative view.

Note:

Wait for the operation response and do not attempt concurrent administrative operations.

Response caching for hosted feature service layers in ArcGIS Enterprise

In ArcGIS Enterprise 10.9, updateDefinition can be used to enable response caching for hosted feature service layers running on the relational data store. Enabling requires that the object store be configured in ArcGIS data store.

Note:

This is not applicable for ArcGIS Online hosted feature services, as they automatically use response caching.

Response caching is a back-end server caching mechanism that significantly increases performance and scalability for data served from hosted feature services on a relational data store. Its ideal for read-only data, or data that changes infrequently. When response caching is enabled, the response from a layer query that uses resultType tile or has cacheHint set to true will be cached. When the exact same query is sent again to the service, the cache response is returned as long as the data has not been updated since the cache was created. If the data has been updated, a new cache is created from the updated response. For example, clients that consistently use the same tile requests to draw content will benefit from response caching.

Note:

Queries which use current_date, current_time, or current_timestamp are not cached as the responses regularly change over time. In addition. layers with m values that have the access control property allowOthersToQuery as false are also not cached.

The option can be turned on for specific service layers as needed. At 10.9, this option can be configured from the REST API and is considered a developer option.

Enabling response caching

Before response caching can be enabled, the object store must be configured in ArcGIS Data Store. The object store is required as its used to store the responses and maintain the last edit data metadata. For more information on how to configure the object store, see Use the configuredatastore utility to create a data store. Once the object store is configured, the server will need to be restarted to allow hosted feature services to access it. Once restarted, hosted feature services running on the relational data store will include the "editingInfo": ("lastEditDate": <dateValue>) property. For more information on this property, see the Feature Layer resource.

Once the object store has been configured, response caching can be enabled on individual hosted feature service layers using the updateDefinition operation, allowing you to control which layers will write response cache content to the object store. This also applies to hosted feature service layer views, where response caching can be enabled or disabled independently on view layers.

The following example input for updateDefinition enables response caching that will expire after one day:

{
  "layerCache": {
    "enabled": true, 
    "expiration": 1
  }
}

The expiration property defines the number of days a cache will be stored before it is removed. Once a cache is removed, a new response cache will be created the next time the service is queried. The updateDefinition operation can be used to change or remove the expiration. An expiration value of 0 means the cache will never expire. The value put for the expiration property must be an integer.

Once updateDefintion has been used to enable response caching, the layers admin resource (https://myenterprise.esri.com/server/rest/admin/services/Hosted/counties/FeatureServer/0?f=pjson) will list the current response caching settings:

"adminLayerInfo": {
  "layerCache": {
    "expiration": 1,
    "enabled": true
  },
  ...
}
Note:

Response caching cannot be enabled on hosted feature service views that are based on a join, or from a spatiotemporal data source in ArcGIS Enterprise 10.9.

Disabling response caching

Response caching can also be disabled on hosted feature layers and hosted feature layers and hosted feature layer views using updateDefinition. Disabling response caching will remove all of the layer's cached content from the object store.

The following example input for updateDefinition disables response caching:

{
  "layerCache": {
    "enabled": false
  }
}

Once disabled, the layer resource will include "supportsQueryWithCacheHint": false.

Request parameters

ParameterDetails
f

The response format. The default response format is html.

Values: html | json

Example usage

Get information about layer 0 in the "WorldService" Feature Service

https://services.myserver.com/OrgID/arcgis/rest/admin/services/WorldService/FeatureServer/0

JSON Response syntax

{
  "id": <layerId>,
  "name": "<layerName>",
  "type": "<layerType>",
  "description": "<description>",
  "copyrightText": "<copyrightText>",
  "supportsRollbackOnFailures": <true | false>,
  "geometryType": "<geometryType>",
  "minScale": <minScale>,
  "maxScale": <maxScale>,
  "extent": <envelope>,
  "drawingInfo": {
    "renderer": <renderer>,
    "transparency": <transparency>,
    "labelingInfo": <labelingInfo>
  },
  },
  "hasAttachments": <true|false>
  "htmlPopupType": "<esriServerHTMLPopupTypeNone | esriServerHTMLPopupTypeAsURL | esriServerHTMLPopupTypeAsHTMLText>",
  "objectIdField": "<objectIdFieldName>",
  "globalIdField": "<globalIdFieldName>",
  "displayField": "<displayField>",
  "typeIdField": "<typeIFieldName>",
  "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>
    }
  ],
  "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"
        }
      ]
    }
  ],
  "templates": [
    {
      "name": "<templateName1>",
      "description": "<templateDescription1>",
      "prototype": <prototypicalFeature1>
    },
    {
      "name": "<templateName2>",
      "description": "<templateDescription2>",
      "prototype": "<prototypicalFeature2>"
    }
  ],
  "supportedQueryFormats": "<supportedQueryFormats>",
  "maxRecordCount": "<maxRecordCount>",
  "standardMaxRecordCount": "<standardMaxRecordCount>",
  "tileMaxRecordCount": "<tileMaxRecordCount>",
  "maxRecordCountFactor": "<maxRecordCountFactor>",
  "capabilities": "<capabilities>"
}

JSON Response example

{
  "currentVersion": 10.1, 
  "id": 0, 
  "name": "Demo.dbo.WORLDCITIES", 
  "type": "Feature Layer", 
  "displayField": "CITY_NAME", 
  "description": "", 
  "copyrightText": "", 
  "supportsRollbackOnFailure": true, 
  "geometryType": "esriGeometryPoint", 
  "minScale": 0, 
  "maxScale": 0, 
  "extent": {
    "xmin": -176.151563636, 
    "ymin": -54.792, 
    "xmax": 179.221887694, 
    "ymax": 78.200001124, 
    "spatialReference": {
      "wkid": 4326
    }
  }, 
  "drawingInfo": {
    "renderer": {
      "type": "simple", 
      "symbol": {
        "type": "esriSMS", 
        "style": "esriSMSCircle", 
        "color": [
          0, 
          166, 
          116, 
          255
        ], 
        "size": 4, 
        "angle": 0, 
        "xoffset": 0, 
        "yoffset": 0, 
        "outline": {
          "color": [
            0, 
            0, 
            0, 
            255
          ], 
          "width": 1
        }
      }, 
      "label": "", 
      "description": ""
    }, 
    "transparency": 0, 
    "labelingInfo": null
  }, 
  },
  "hasAttachments": false, 
  "htmlPopupType": "esriServerHTMLPopupTypeAsHTMLText", 
  "objectIdField": "OBJECTID", 
  "globalIdField": "", 
  "typeIdField": "", 
  "fields": [
    {
      "name": "OBJECTID", 
      "type": "esriFieldTypeInteger", 
      "alias": "OBJECTID", 
      "sqlType": "sqlTypeInteger", 
      "nullable": false, 
      "editable": false, 
      "domain": null
    }, 
    {
      "name": "CITY_NAME", 
      "type": "esriFieldTypeString", 
      "alias": "CITY_NAME", 
      "sqlType": "sqlTypeNVarchar", "length": 30, 
      "nullable": true, 
      "editable": true, 
      "domain": null
    }, 
    {
      "name": "GMI_ADMIN", 
      "type": "esriFieldTypeString", 
      "alias": "GMI_ADMIN", 
      "sqlType": "sqlTypeNVarchar", "length": 7, 
      "nullable": true, 
      "editable": true, 
      "domain": null
    }, 
    {
      "name": "ADMIN_NAME", 
      "type": "esriFieldTypeString", 
      "alias": "ADMIN_NAME", 
      "sqlType": "sqlTypeNVarchar", "length": 42, 
      "nullable": true, 
      "editable": true, 
      "domain": null
    }, 
    {
      "name": "FIPS_CNTRY", 
      "type": "esriFieldTypeString", 
      "alias": "FIPS_CNTRY", 
      "sqlType": "sqlTypeNVarchar", "length": 2, 
      "nullable": true, 
      "editable": true, 
      "domain": null
    }, 
    {
      "name": "CNTRY_NAME", 
      "type": "esriFieldTypeString", 
      "alias": "CNTRY_NAME", 
      "sqlType": "sqlTypeNVarchar", "length": 30, 
      "nullable": true, 
      "editable": true, 
      "domain": null
    }, 
    {
      "name": "STATUS", 
      "type": "esriFieldTypeString", 
      "alias": "STATUS", 
      "sqlType": "sqlTypeNVarchar", "length": 50, 
      "nullable": true, 
      "editable": true, 
      "domain": null
    }, 
    {
      "name": "POP_RANK", 
      "type": "esriFieldTypeInteger", 
      "alias": "POP_RANK", 
      "sqlType": "sqlTypeInteger", 
      "nullable": true, 
      "editable": true, 
      "domain": null
    }, 
    {
      "name": "POP_CLASS", 
      "type": "esriFieldTypeString", 
      "alias": "POP_CLASS", 
      "sqlType": "sqlTypeNVarchar", "length": 22, 
      "nullable": true, 
      "editable": true, 
      "domain": null
    }, 
    {
      "name": "PORT_ID", 
      "type": "esriFieldTypeInteger", 
      "alias": "PORT_ID", 
      "sqlType": "sqlTypeInteger", 
      "nullable": true, 
      "editable": true, 
      "domain": null
    }, 
    {
      "name": "LABEL_FLAG", 
      "type": "esriFieldTypeInteger", 
      "alias": "LABEL_FLAG", 
      "sqlType": "sqlTypeInteger", 
      "nullable": true, 
      "editable": true, 
      "domain": null
    }
  ], 
  "types": [], 
  "templates": [
    {
      "name": "Demo.dbo.WORLDCITIES", 
      "description": "", 
      "drawingTool": "esriFeatureEditToolPoint", 
      "prototype": {
        "attributes": {
          "LABEL_FLAG": null, 
          "CITY_NAME": null, 
          "GMI_ADMIN": null, 
          "ADMIN_NAME": null, 
          "FIPS_CNTRY": null, 
          "CNTRY_NAME": null, 
          "STATUS": null, 
          "POP_RANK": null, 
          "POP_CLASS": null, 
          "PORT_ID": null
        }
      }
    }
  ], 
  "supportedQueryFormats": "JSON", 
  "maxRecordCount": 1000,
  "standardMaxRecordCount": 4000,
  "tileMaxRecordCount": 4000,
  "maxRecordCountFactor": 1, 
  "capabilities": "Create,Delete,Query,Update,Editing"
}