Map Service Identify method

Identifies map features and their attribute values based on a spatial search.

 

Identify(MapDescription MapDescription, ImageDisplay MapImageDisplay, Geometry SearchShape, int Tolerance, esriIdentifyOption IdentifyOption, int[] LayerIDs)

 

Parameter

Description

MapDescription

Used to define the map extent and visibility of layers.

ImageDisplay

Used to determine whether layers are visible or not based on the current map scale.

SearchShape

The input geometry to use when performing the spatial query. All types that inherit from Geometry are supported, including Point, Envelope, Polygon, etc. The input geometry must have the same spatial reference as the MapDescription.

Tolerance

The number of pixels to buffer around the SearchShape before performing the spatial query. The pixel value is converted by the map service to map units using map scale (map units per pixel). Map scale is determined using map extent width from MapDescription and image width from ImageDisplay

IdentifyOption

An enumeration specifying that either all layer, the topmost layer, or only visible layers are identified. 

LayerIDs

An array of layers ids for layers to search. If empty or null, all layers can be searched.

 

Return Value

 

An array of MapServerIdentifyResult objects (MapServerIdentifyResult[]), one for each feature returned, each with the layer id in which the feature is located, the feature geometry, and a property set containing field attributes.

 

Remarks

 

There are two key differences between this method and the Map Service methods QueryFeatureCount, QueryFeatureIDs and QueryFeatureData:

 

  1. Identify can work with multiple layers while the query methods work with a single layer.

  2. Identify only requires geometry and a tolerance, whereas the query methods use a QueryFilter. Essentially Identify provides a convenient method to search using a spatial filter, whereas query methods can utilize either an attribute filter (SQL expression) or a spatial filter.
     

Identify requires a number of input parameters. These include:

 

 

Features will be returned that fall within the tolerance value of the SearchShape will be returned. The IdentifyOptions parameter determines which layers to search:

 

 

Layer visibility depends on whether the layer is on or off (the Visible property on a layers LayerDescription) or whether the layer is on, but not visible due to scale dependencies. Each layer maintains a LayerDescription available via the MapDescription.LayerDescriptions array.

 

Scale dependency for a layer is available via the MinScale and MaxScale properties on MapLayerInfo, available via the MapServerInfo.MapLayerInfos array.

 

The IdentifyOption and LayerIDs parameters behave like a boolean AND, without precedence. For example, if the IdentifyOption is esriIdentifyVisibleLayers and LayerIDs is null or empty, all the visible layers are searched. If the IdentifyOption is esriIdentifyVisibleLayers and LayerIDs contains only the first layer, the first layer is searched only if it is visible.

 

The amount of information (e.g. number of MapServerIdentifyResult objects) returned from a call to the this method may be restricted by the map service. The default maximum value for the number of results returned is 500. If 600 records are matched, only the first 500 results will be returned. You will be unable to access the remaining 100 records. The maximum number of results cannot be changed via the ArcGIS Server SOAP API. The map service itself must be configured to return more results, if necessary.

 

 

Examples

C#

VB.NET

Java