Feature Service

Description

A feature service can contain datasets (for example, tables and views) with or without a spatial column. Datasets with a spatial column are considered layers; those without a spatial column are considered tables. A feature service allows clients to query and edit feature geometry and attributes.

This resource provides basic information about the feature service, including the feature layers and tables that it contains, the service description, and so on.

The capabilities property returns Create, Delete, Extract, Query, Update, Sync, and Uploads capabilities. The Uploads capability is included if Create, Delete, or Update is enabled for a feature service. The Editing capability is included if Create, Delete, and Update is enabled and allowGeometryUpdates is true. The Sync capability allows editors to make local edits and periodically sync with the feature service. The Extract capability allows editors to create a local copy of data without the ability to sync with the feature service.

The maxRecordCount property returns the maximum number of records that will be returned at once for a query. The Feature Service resource has an input parameters option and outSR to support viewing of a feature service footprint.

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

New at 11.0

General updates

The updates below have been added, in general, for hosted feature services and non-hosted feature services (referencing enterprise geodatabases) published from ArcGIS Pro.

  • The feature service resource for hosted and non-hosted feature services published for ArcGIS Indoors include an isIndoorsService property, set as true, on their service resource. Editable feature services with the isIndoorsService property as true can be edited by viewer users if the organization has a valid Indoors license.
  • At this release, feature services can be published from a Google BigQuery data source using ArcGIS Pro 3.0 or later.
  • The service-level supportedExportFormats property has been expanded to include shapefile as a supported value.
  • At this release, a file geodatabase extracted from a feature service using the createReplica operation now includes a GDB_ServiceItems table. This table contains the feature service and feature service layer resource JSON information of the service the table was extracted from. For more information, see the Create Replica topic.

Non-hosted feature services

The following updates apply to non-hosted feature services (referencing enterprise geodatabase data) published from ArcGIS Pro.

  • The createReplica operation's replicaOptions parameter has expanded its SyncDataOptions accepted property values, as indicated by the feature service's supportedSyncDataOptions service-level property. For more information, see the Create Replica topic.
  • The synchronizeReplica operation includes a new parameter, reconcileBranchVersion, that can be applied to replicas created from branch versioned data where the feature service has the versionPerDownloadedMap setting. For more information on the new parameter, see the Synchronize Replica topic.
  • The extractChanges operation has been expanded to support the following changes, support for which depend on properties under extractChangesCapabilities on the service-level resource:
    • A new parameter, fieldsToCompare. Support for this is indicated when the supportsFieldsToCompare property, under extractChangesCapabilities, is set as true.
    • The ability to return features rather than IDs only. Support for this is indicated when the supportsFeatureReturn property, under extractChangesCapabilities, is set as true.
    • A new parameter, serverGens. Support for this is indicated when the supportsServerGens property, under extractChangesCapabilities, is set as true.
    • The ability to return attachment differences. Support for this is indicated when the supportsReturnAttachments property, under extractChangesCapabilities, is set as true
    For more information on these changes, see the Extract Changes topic.

Hosted feature services

The following changes apply for hosted feature services:

  • The service-level applyEdits operation now supports an async parameter. Support for this parameter is indicated when the service-level supportsAsyncApplyEdits property, under advancedEditingCapabilities, is true. For more information on this new parameter, see the Apply Edits topic.
  • The service-level applyEdits operation includes a new parameter, returnEditResults. Support for this new parameter is indicated by a feature service having the service-level supportsReturnEditResults property, under advancedEditingCapabilities, set as true. To learn more about the new parameter, see the service-level Apply Edits topic.

The following updates apply to hosted feature services running on a relational data store:

  • The ChangeTracking capability can now be enabled on a feature service resource using the updateDefinition operation. Adding ChangeTracking exposes the extractChanges options and adds the extractChangesCapabilities property to the feature service resource. This property describes the extractChanges operation that are supported for that feature service.
    NoteNote:

    At this release, a hosted feature service cannot have both the Sync and ChangeTracking capabilities enabled at the same time.

New at 10.9.1

New at 10.9

New at 10.8.1

New at 10.8

New at 10.7

New at 10.6.1

New at 10.6

NoteNote:

When querying, z-values are returned in the sourceSpatialReference vertical coordinate system regardless of what is specified as the output spatial reference. It is also expected that z-values are provided in the sourceSpatialReference source vertical coordinate system when editing.

NoteNote:

The features listed above are available for nonhosted services published from ArcGIS Pro 2.1 or later. Services published from ArcGIS Pro 2.1 have the following layer and service property: "cimVersion": "2.1.0"

New at 10.5

Request parameters

Parameter

Details

option

This parameter was added at 10.1.

If option is footprints, the footprint of the feature service is returned as a feature collection. This feature collection can be viewed in Map Viewer Classic. This is only supported when f is json.

Value: footprints

outSR

This parameter was added at 10.1.

The spatial reference of the geometry returned in footprints. This parameter is supported only when option=footprints is specified. The spatial reference should be specified as a well-known ID. If outSR is not specified, the geometry is returned in GCS_WGS_1984.

useGlobalIds

Used to specify whether upsert needs to use GlobalId when matching features. The default value is false and ObjectId is used by default.

f

The response format. The default response format is html.

Values: html | json | pjson

Example usage

The following is a sample request URL for a feature service:

https://machine.domain.com/webadaptor/rest/services/USA/FeatureServer?f=pjson

JSON Response syntax

{
  "currentVersion": <currentVersion>,
  "serviceDescription": "<serviceDescription>",
  "hasVersionedData": <true | false>,
  "supportsDisconnectedEditing": <true | false>,
  "supportsDatumTransformation": <true | false>, //Added at 10.8
  "supportsReturnDeleteResults": <true | false>, //Added at 10.7
  "hasStaticData" : <true | false>,
  "maxRecordCount" : "<maxRecordCount>",
  "supportedQueryFormats": "<supportedQueryFormats>",
  "supportsRelationshipsResource": <true | false>, //Added at 10.7
  "capabilities": "<capabilities>",
  "description": "<description>",
  "copyrightText": "<copyrightText>",
  "userTypeExtensions": [<Extension Types>], //Added at 10.8
  "advancedEditingCapabilities": {<advancedEditingCapabilities>},
  "spatialReference": {<spatialReference>},
  "initialExtent": {<envelope>},
  "fullExtent": {<envelope>},
  "allowGeometryUpdates": <true | false>,
  "units": "<units>",
  "syncEnabled" : <true | false>,
  "supportedExportFormats": "<supported formats>", //Added at 10.9.1
  "returnServiceEditsHaveSR": <true | false>, //Added at 10.7.1
  //Added at 10.7
  "validationSystemLayers": {
    "validationPointErrorlayerId": <validationPointErrorlayerId>,
    "validationLineErrorlayerId": <validationLineErrorlayerId>,
    "validationPolygonErrorlayerId": <validationPolygonErrorlayerId>,
    "validationObjectErrortableId": <validationObjectErrortableId>
  },
  //Added at 10.6.1
  "extractChangesCapabilities": {
    "supportsReturnIdsOnly": <true | false>,
    "supportsReturnExtentOnly": <true | false>,
    "supportsReturnAttachments": <true | false>,
    "supportsLayerQueries": <true | false>,
    "supportsSpatialFilter": <true | false>,
    "supportsReturnFeature": <true | false>,
  },
  "syncCapabilities": {
    "supportsASync": <true | false>,
    "supportsRegisteringExistingData": <true | false>,
    "supportsSyncDirectionControl": <true | false>,
    "supportsPerLayerSync": <true | false>,
    "supportsPerReplicaSync": <true | false>,
    "supportsRollbackOnFailure": <true | false>,
    "supportedSyncDataOptions": <supportedSyncDataOptions>, //Added at 10.7
    "supportsQueryWithDatumTransformatiom": <true | false>, //Added at 10.8
  },
  "editorTrackingInfo": {
    "enableEditorTracking": <true | false>,
    "enableOwnershipAccessControl": <true | false>,
    "allowOthersToUpdate": <true | false>,
    "allowOthersToDelete": <true | false>
  }, 
  "documentInfo": { 
   "<key1>": "<value1>",
   "<key2>": "<value2>"
   },
  //the feature layers published by this service
  "layers": [
    { "id": <layerId1>, "name": "<layerName1>" },
    { "id": <layerId2>, "name": "<layerName2>" }
  ],
  //the non-spatial tables published by this service
  "tables": [
    { "id": <tableId1>, "name": "<tableName1>" },
    { "id": <tableId2>, "name": "<tableName2>" }
  ],
  "relationships": [
    { "id": <relationshipId1>, "name": "<relationshipName1>" },
    { "id": <relationshipId2>, "name": "<relationshipName2>" }
  ],
  "datumTransformations": [<datumTransformations>] //Added at 10.7.1
  "enableZDefaults": <true | false>,
  "isLocationTrackingService": <true | false>, //Added at 10.7
  "isLocationTrackingView": <true | false>, //Added at 10.7
  "isIndoorsService": <true | false>, //Added at 11.0
  "zDefault": <zDefaultValue>
}

JSON Response example

The following is an example of a feature service resource's JSON response:

{
  "currentVersion": 10.8.1,
  "serviceDescription": "Birds",
  "hasVersionedData": false,
  "supportsDisconnectedEditing: false,
  "supportsDatumTransformation": true,
  "supportsReturnDeleteResults": true,
  "supportsRelationshipsResource": true,
  "syncEnabled": false,
  "supportedExportFormats": "sqlite,filegdb,shapefile",
  "hasStaticData": false,
  "maxRecordCount": 1000,
  "supportedQueryFormats": "JSON",
  "capabilities": "Query,Create,Delete,Update,Uploads,Editing",
  "description": "",
  "copyrightText": "",
  "userTypeExtensions: [
    "utilityNetwork"
  ],
  "advancedEditingCapabilities": {
    "supportsSplit": true,
    "supportsReturnServiceEditsInSourceSR": true
  },
  "spatialReference": {
    "wkid": 4326,
    "latestWkid": 4326
  },
  "initialExtent": {
    "xmin": -118.016756138237,
    "ymin": 32.8933824408207,
    "xmax": -116.532738278622,
    "ymax": 34.3261469363675,
    "spatialReference": {
      "wkid": 4326,
      "latestWkid": 4326
    }
  },
  "fullExtent": {
    "xmin": -117.855689264791,
    "ymin": 32.5702577626442,
    "xmax": -116.87086222794,
    "ymax": 34.1460567673275,
    "spatialReference": {
      "wkid": 4326,
      "latestWkid": 4326
    }
  },
  "allowGeometryUpdates": true,
  "units": "esriDecimalDegrees",
  "syncEnabled": true,
  "validationSystemLayers": {
    "validationPointErrorlayerId": 1,
    "validationLineErrorlayerId": 2,
    "validationPolygonErrorlayerId": 3,
    "validationObjectErrortableId": 5
  },
  "extractChangesCapabilities": {
    "supportsReturnIdsOnly": true,
    "supportsReturnExtentOnly": false,
    "supportsReturnAttachments": false,
    "supportsLayerQueries": false,
    "supportsSpatialFilter": false,
    "supportsReturnFeature": false,
    "supportsReturnHasGeometryUpdates": true
  },
  "syncCapabilities": {
    "supportsASync": true,
    "supportsRegisteringExistingData": true,
    "supportsSyncDirectionControl": true,
    "supportsPerLayerSync": true,
    "supportsPerReplicaSync": false,
    "supportsRollbackOnFailure": false,
    "supportedSyncDataOptions": 3
    "supportsQueryWithDatumTransformation": true,
  },
  "editorTrackingInfo": {
    "enableEditorTracking": false,
    "enableOwnershipAccessControl": false,
    "allowOthersToUpdate": true,
    "allowOthersToDelete": false
  },
  "layers": [
    {
      "id": 0,
      "name": "Sitings",
      "parentLayerId": -1,
      "defaultVisibility": true,
      "subLayerIds": null,
      "minScale": 0,
      "maxScale": 0,
      "geometryType": "esriGeometryPoint"
    },
    {
      "id": 1,
      "name": "NestingGrounds",
      "parentLayerId": -1,
      "defaultVisibility": true,
      "subLayerIds": null,
      "minScale": 0,
      "maxScale": 0,
      "geometryType": "esriGeometryPolygon"
    },
    {
      "id": 2,
      "name": "LandCover",
      "parentLayerId": -1,
      "defaultVisibility": true,
      "subLayerIds": null,
      "minScale": 0,
      "maxScale": 0,
      "geometryType": "esriGeometryPolygon"
    }
  ],
  "tables": [],
  "relationships": [
   {
    "id": 0,
    "name": "relationship_1"
   }
  ],
  "datumTransformations": [
    {
      "geoTransforms": [
        {
          "wkid": 15931,
          "latestWkid": 15931,
          "transformForward": false,
          "name": NAD_1983_NSRS2007_To_WGS_1984_1"
        }
      ]
    },
    {
      "geoTransforms": [
        {
          "wkid": 15931,
          "latestWkid": 15931,
          "transformForward": true,
          "name": NAD_1983_NSRS2007_to_WGS_1984_1"
        }
      ]
    }
  ],
  "isIndoorsService": true,
  "isLocationTrackingService": true,
  "isLocationTrackingView": true
}

The following is a portion of a JSON response example for a spatial reference, VCS, tolerance, resolution properties, and high model info:

...
 "spatialReference": {
  "wkid": 102100,
  "latestWkid": 3857,
  "vcsWkid": 115700,
  "latestVcsWkid": 115700,
  "xyTolerance": 0.001,
  "zTolerance": 0.001,
  "mTolerance": 0.001,
  "falseX": -20037700,
  "falseY": -30241100,
  "xyUnits": 1.4892314192838538E8,
  "falseZ": -100000,
  "zUnits": 10000,
  "falseM": -100000,
  "mUnits": 10000
 }, 
 "heightModelInfo": {
  "heightModel": "ellipsoidal",
  "vertCRS": "WGS_1984",
  "heightUnit": "meter"
 },
...

The following is an example of a feature service that includes topology layers:

{
...
	 "layers": [
    {
		    "id": 0,
		    "name": "topo_1081.GDB.topo_2",
		    "parentLayerId": -1,
		    "defaultVisibility": true,
		    "subLayerIds": [
			     1,
        2,
        3,
        4
		    ],
		    "minScale": 0,
		    "maxScale": 0,
		    "type": "Topology Layer"
	   },
    {
		    "id": 1,
		    "name": "Dirty Areas",
		    "parentLayerId": 0,
		    "defaultVisibility": false,
		    "subLayerIds": null,
		    "minScale": 0,
		    "maxScale": 0,
		    "type": "Feature Layer",
		    "geometryType": "esriGeometryPolygon"
	   },
    {
		    "id": 2,
		    "name": "Point Errors",
		    "parentLayerId": 0,
		    "defaultVisibility": true,
		    "subLayerIds": null,
		    "minScale": 0,
		    "maxScale": 0,
		    "type": "Feature Layer",
		    "geometryType": "esriGeometryPoint"
	   },
    {
		    "id": 3,
		    "name": "Line Errors",
		    "parentLayerId": 0,
		    "defaultVisibility": true,
		    "subLayerIds": null,
		    "minScale": 0,
		    "maxScale": 0,
		    "type": "Feature Layer",
		    "geometryType": "esriGeometryPolyline"
	   },
    {
		    "id": 4,
		    "name": "Polygon Errors",
		    "parentLayerId": 0,
		    "defaultVisibility": true,
		    "subLayerIds": null,
		    "minScale": 0,
		    "maxScale": 0,
		    "type": "Feature Layer",
		    "geometryType": "esriGeometryPolygon"
	   },
    {
		    "id": 5,
		    "name": "topo_1081.GDB.us_caps_test_2",
		    "parentLayerId": -1,
		    "defaultVisibility": true,
		    "subLayerIds": null,
		    "minScale": 0,
		    "maxScale": 0,
		    "type": "Feature Layer",
		    "geometryType": "esriGeometryPoint"
	   },
    {
		    "id": 6,
		    "name": "topo_1081.GDB.us_caps_buff_2",
		    "parentLayerId": -1,
		    "defaultVisibility": true,
		    "subLayerIds": null,
		    "minScale": 0,
		    "maxScale": 0,
		    "type": "Feature Layer",
		    "geometryType": "esriGeometryPolyline"
	   },
    {
		    "id": 7,
		    "name": "topo_1081.GDB.us_states_test_2",
		    "parentLayerId": -1,
		    "defaultVisibility": true,
		    "subLayerIds": null,
		    "minScale": 0,
		    "maxScale": 0,
		    "type": "Feature Layer",
		    "geometryType": "esriGeometryPolygon"
	   }
  ],
  "tables": [],
  "relationships": [],
  "controllerDatasetLayers": {
	   "topologyLayerIds": [
		    0
	   ]
  },
  "supportsDynamicLayers": true,
  "enableZDefaults": false,
  "allowUpdateWithoutMValues": false,
  "supportsVCSProjection": true,
  "referenceScale": 0,
  "serviceItemId": "64bbff5e478f41cf8ddc6d7792b3d2eb"
},
...