FRAMES | NO FRAMES Description | Parameters | Examples | Response
Identify (Operation)

This is an archive of a previous version of the ArcGIS REST API. The current version can be found at http://resources.arcgis.com/en/help/arcgis-rest-api/

URL http://<mapservice-url>/identify
Parent Resource Map Service

Description

The identify operation is performed on a map service resource. The result of this operation is an identify results resource. Each identified result includes its name, layer ID, layer name, geometry and geometry type, and other attributes of that result as name-value pairs.

You can provide arguments to the identify operation as query parameters defined in the parameters table below.

Parameters

Parameter Details
f Description: The response format. The default response format is html.

Values: html | json
geometry Required
Description: The geometry to identify on. The type of the geometry is specified by the geometryType parameter. The structure of the geometries is same as the structure of the JSON geometry objects returned by the ArcGIS REST API. In addition to the JSON structures, for points and envelopes, you can specify the geometries with a simpler comma-separated syntax.

Syntax:
  • JSON structures: geometryType=<geometryType>&geometry={geometry}
  • Point simple syntax: geometryType=esriGeometryPoint&geometry=<x>,<y>
  • Envelope simple syntax: geometryType=esriGeometryEnvelope&geometry=<xmin>,<ymin>,<xmax>,<ymax>
Examples:
  • geometryType=esriGeometryPoint&geometry={x: -104, y: 35.6}
  • geometryType=esriGeometryPoint&geometry=-104,35.6
  • geometryType=esriGeometryEnvelope&geometry=-104,35.6,-94.32,41

The coordinates must always use a period as the decimal separater even in countries where a comma is traditionally used.

geometryType Description: The type of geometry specified by the geometry parameter. The geometry type could be a point, a line, a polygon or an envelope. The default geometry type is a point (esriGeometryPoint).

Values: esriGeometryPoint | esriGeometryMultipoint | esriGeometryPolyline | esriGeometryPolygon | esriGeometryEnvelope
sr Description: The well-known ID of the spatial reference of the input and output geometries as well as the mapExtent. If sr is not specified, the geometry and the mapExtent are assumed to be in the spatial reference of the map, and the output geometries are also in the spatial reference of the map.
layers Description: The layers to perform the identify operation on. There are three ways to specify which layers to identify on:
  • top: Only the top-most layer at the specified location.
  • visible: All visible layers at the specified location.
  • all: All layers at the specified location.
Example: layers=all

Default: By default the identify operation identifies the top-most layer (i.e. layers=top)

You can either specify the layer options as mentioned above by themselves or specify the layer option in conjunction with a list of layer IDs. When both the layer option as well as the layer IDs are specified, the server treats it as a boolean "AND" operator. For example, if the parameter is specified as: layers=visible:2,5 only layers with IDs 2 and 5, if visible, are identified.

Syntax: [top | visible | all]:layerId1,layerId2
where layerId1, layerId2 are the layer ids returned by the map service resource.

Example: layers=visible:2,5
tolerance Required
Description: The distance in screen pixels from the specified geometry within which the identify should be performed. The value for the tolerance is an integer.

Example: tolerance=2
mapExtent Required
Description: The extent or bounding box of the map currently being viewed. Unless the sr parameter has been specified, the mapExtent is assumed to be in the spatial reference of the map.

The mapExtent and the imageDisplay parameters are used by the server to determine the layers visible in the current extent. They are also used to calculate the distance on the map to search based on the tolerance in screen pixels.

Syntax: <xmin>, <ymin>, <xmax>, <ymax>

Example: mapExtent=-104,35.6,-94.32,41
imageDisplay Required
Description: The screen image display parameters (width, height and DPI) of the map being currently viewed.

The mapExtent and the imageDisplay parameters are used by the server to determine the layers visible in the current extent. They are also used to calculate the distance on the map to search based on the tolerance in screen pixels.

Syntax: <width>, <height>, <dpi>

Example: imageDisplay=600,550,96
returnGeometry Description: If true, the resultset will include the geometries associated with each result. The default is true.

Values: true | false

Example Usage

Example 1: Identify that includes geometry using simple point syntax, tolerance, map extent, and image display. Default values for geometry type, spatial reference, layers, and returnGeometry are used. The response is in HTML format:

http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Specialty/ESRI_StateCityHighway_USA/MapServer/identify?geometryType=esriGeometryPoint&geometry=-120,40&tolerance=10&mapExtent=-119,38,-121,41&imageDisplay=400,300,96

Example 2: Identify that includes geometry using a JSON structure. The response is in JSON format:

http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Specialty/ESRI_StateCityHighway_USA/MapServer/identify?geometryType=esriGeometryPoint&geometry={x: -120, y:40}&tolerance=10&mapExtent=-119,38,-121,41&imageDisplay=400,300,96&f=json

Example 3: Identify that specifies a specific layer. In this example, only layer 2 is desired. Since this is not the top layer, the syntax layer=all:2 is used:

http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Specialty/ESRI_StateCityHighway_USA/MapServer/identify?geometryType=esriGeometryPoint&geometry={x: -120, y:40}&layers=all:2&tolerance=10&mapExtent=-119,38,-121,41&imageDisplay=400,300,96&returnGeometry=true

JSON Response Syntax

{
"results" : [
{
"layerId" : <layerId1>,
"layerName" : "<layerName1>",
"value" : "<value1>",
"displayFieldName" : "<displayFieldName1>",
"attributes" : {
"<fieldName11>" : <fieldValue11>,
"<fieldName12>" : <fieldValue12>
},
"geometryType" : "<geometryType1>",
"geometry" : {
<geometry1>}
},
{
"layerId" : <layerId2>,
"layerName" : "<layerName2>",
"value" : "<value2>",
"displayFieldName" : "<displayFieldName1>",
"attributes" : {
"<fieldName21>" : <fieldValue21>,
"<fieldName22>" : <fieldValue22>
},
"geometryType" : "<geometryType2>",
"geometry" : {<geometry2>}
}
]
}

JSON Response Example

{
"results" : [
{
"layerId" : 3,
"layerName" : "Cities",
"value" : "Joe City",
"displayFieldName" : "City Name",
"attributes" : {
"City Name" : "Joe City",
"CLASS" : "city",
"ST" : "CA"
},
"geometryType" : "esriGeometryPoint",
"geometry" : { "x" : -118.375, "y" : 34.086, "spatialReference" : {"wkid" : 4326} }
},
{
"layerId" : 59,
"layerName" : "Parcel",
"value" : "Parcel 649",
"displayFieldName" : "NAME",
"attributes" : {
"NAME" : "Parcel 649",
"SUB_REGION" : "Pacific",
"STATE_ABBR" : "CA"
},
"geometryType" : "esriGeometryPolygon",
"geometry" : { "spatialReference" : {"wkid" : 4326}, "rings" : [[[-118.35,32.81],[-118.42.806],[-118.511,32.892],[-118.35,32.81]]]}
}
]
}