Map Service Identify method

Returns 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, one for each feature returned.  MapServerIdentifyResult stores 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 Identify and the Map Service methods QueryFeatureCount, QueryFeatureIDs and QueryFeatureData.  One, Identify can work with multiple layers while the query methods work with a single layer.  And two, 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: a map description, an image display (this is needed to determine whether layers are visible or not based on the current map scale), a search shape (usually a point), a tolerance, an identify option, and an array of layer ids to be identified.

 

The IdentifyOption parameter (esriIdentifyOption enumerator) includes: esriIdentifyAllLayers, esriIdentifyVisibleLayers and esriIdentifyTopmost.  If esriIdentifyAllLayers is specified, all features for all layers in the map that fall within the tolerance value of the SearchShape will be returned.  If esriIdentifyVisibleLayers is used then only features from visible layers are returned.  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 ImageDisplay parameter is used to determine layer visiblity based on scale dependencies.  The esriIdentifyOption esriIdentifyTopmost refers to the visible layer that is topmost in the map drawing order at the location specified by SearchShape.

 

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 Identify() 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