public class

IdentifyParameters

extends Object
java.lang.Object
   ↳ com.esri.core.tasks.identify.IdentifyParameters

Class Overview

The IdentifyParameters class is a container for input parameters that are used during the execution of an IdentifyTask. The parameters specify the details necessary for identifying features. See the IdentifyTask class description for more details on what it accomplishes.

Certain parameters for an Identify operation are required, while others are optional. To construct an IdentifyParameters instance using the required parameters, use IdentifyParameters(Geometry, Envelope, SpatialReference, int[], int, int, int, boolean). Optional parameters can then be specified using the relevant setter methods.

Summary

Constants
int ALL_LAYERS Identify on all layers of the service.
int TOP_MOST_LAYER Identify only on the top-most layer of the service.
int VISIBLE_LAYERS Identify only on the visible layers of the service.
Public Constructors
IdentifyParameters()
Default constructor.
IdentifyParameters(Geometry geometry, Envelope mapExtent, SpatialReference extentSR, int[] layers, int mapWidth, int mapHeight, int dpi, boolean returnGeometry)
Constructor with required parameters.
Public Methods
boolean equals(Object obj)
int getDPI()
Returns the dot-per-inch ratio of the map as it is being displayed.
Geometry getGeometry()
Returns the geometry to identify.
Map<String, String> getLayerDefs()
Allows you to filter the features of individual layers in the exported map by specifying definition expressions for those layers.
int getLayerMode()
Returns the mode used by the IdentifyTask to determine which layers to perform the task on.
int[] getLayers()
Returns the array of layer IDs that reference the layers that the IdentifyTask will execute on.
Envelope getMapExtent()
Returns the extent of the map to identify in.
int getMapHeight()
Returns the height of the map in screen pixels.
int getMapWidth()
Returns the width of the map in screen pixels.
double getMaxAllowableOffset()
Returns the maximum allowable offset.
boolean getReturnGeometry()
Returns if geometry will be included in the returned result.
SpatialReference getSpatialReference()
Returns the spatial reference of the map extent.
int getTolerance()
Returns the distance in screen pixels from the specified geometry within which the identify should be performed.
int hashCode()
void setDPI(int dpi)
Sets the dot-per-inch of the map (used to determine the resolution of the map).
void setGeometry(Geometry geometry)
Sets the Geometry to identify.
void setLayerDefs(Map<String, String> layerDefs)
Allows you to filter the features of individual layers in the exported map by specifying definition expressions for those layers.
void setLayerMode(int layerMode)
Sets the mode used by the IdentifyTask to determine which layers to perform the task on.
void setLayers(int[] layers)

Sets The array of layer IDs that reference the layers that the IdentifyTask will execute on.

void setMapExtent(Envelope extent)
Sets the extent of the map to perform the identify in.
void setMapHeight(int height)
Sets the height in pixels of the extent of the map (used to determine the resolution of the map).
void setMapWidth(int width)
Sets the width in pixels of the extent of the map (used to determine the resolution of the map).
void setMaxAllowableOffset(double maxAllowableOffset)
Sets the maximum allowable offset.
void setReturnGeometry(boolean returnGeometry)
Sets whether to include geometry in the returned result.
void setSpatialReference(SpatialReference spatialReference)
Sets the spatial reference of the map extent set using setMapExtent(Envelope).
void setTolerance(int tolerance)

Sets the tolerance.

[Expand]
Inherited Methods
From class java.lang.Object

Constants

public static final int ALL_LAYERS

Identify on all layers of the service.

Constant Value: 0 (0x00000000)

public static final int TOP_MOST_LAYER

Identify only on the top-most layer of the service.

Constant Value: 2 (0x00000002)

public static final int VISIBLE_LAYERS

Identify only on the visible layers of the service.

Constant Value: 1 (0x00000001)

Public Constructors

public IdentifyParameters ()

Default constructor.

public IdentifyParameters (Geometry geometry, Envelope mapExtent, SpatialReference extentSR, int[] layers, int mapWidth, int mapHeight, int dpi, boolean returnGeometry)

Constructor with required parameters.

Parameters
geometry Geometry: the geometry to identify
mapExtent Envelope: the current extent of the map
extentSR SpatialReference: the spatial reference of the map
layers int: the array of layer IDs of the layers that the IdentifyTask will execute on
mapWidth int: the width of the map in pixels
mapHeight int: the height of the map in pixels
dpi int: the dot-per-inch of the map displayed on the device
returnGeometry boolean: true to return geometry in the Identify result, false otherwise

Public Methods

public boolean equals (Object obj)

Parameters
obj Object
Returns
boolean

public int getDPI ()

Returns the dot-per-inch ratio of the map as it is being displayed.

Returns
int the DPI

public Geometry getGeometry ()

Returns the geometry to identify.

Returns
Geometry the geometry to identify

public Map<String, String> getLayerDefs ()

Allows you to filter the features of individual layers in the exported map by specifying definition expressions for those layers.

Returns
Map<String, String> the layer definition expressions

public int getLayerMode ()

Returns the mode used by the IdentifyTask to determine which layers to perform the task on.

There are 3 possible values:

  • ALL_LAYERS: identify features on all layers of the service
  • VISIBLE_LAYERS: identify features on the visible layers of the service only
  • TOP_MOST_LAYER identify features on the top-most layer of the service only

  • By default the value is ALL_LAYERS.


    Returns
    int The layer mode

    public int[] getLayers ()

    Returns the array of layer IDs that reference the layers that the IdentifyTask will execute on.

    Returns
    int[] the array of layer IDs.

    public Envelope getMapExtent ()

    Returns the extent of the map to identify in.

    Returns
    Envelope the extent of the map

    public int getMapHeight ()

    Returns the height of the map in screen pixels.

    Returns
    int the height of the map in screen pixels

    public int getMapWidth ()

    Returns the width of the map in screen pixels.

    Returns
    int the width of the map in screen pixels

    public double getMaxAllowableOffset ()

    Returns the maximum allowable offset.

    Returns
    double the maximum allowable offset

    public boolean getReturnGeometry ()

    Returns if geometry will be included in the returned result.

    Returns
    boolean true if geometry will be included in the returned result, false otherwise

    public SpatialReference getSpatialReference ()

    Returns the spatial reference of the map extent.

    Returns
    SpatialReference the spatial reference of the map extent

    public int getTolerance ()

    Returns the distance in screen pixels from the specified geometry within which the identify should be performed.

    By default the value is 5. Consider adjusting the tolerance according to the resolution or level of zoom in order to retrieve an accurate number of results. Typically, the tolerance should be small with a low level of zoom (potentially lots of results in a small area of the map) and high on a closer zoom level (results spread out as the zoom level increases).

    Returns
    int The distance in screen pixels from the boundary of the specified geometry

    public int hashCode ()

    Returns
    int

    public void setDPI (int dpi)

    Sets the dot-per-inch of the map (used to determine the resolution of the map).

    Parameters
    dpi int: dot-per-inch ratio of the map

    public void setGeometry (Geometry geometry)

    Sets the Geometry to identify.

    The supported geometries are: Point, Polyline, Polygon and Envelope.

    Parameters
    geometry Geometry: the geometry to identify

    public void setLayerDefs (Map<String, String> layerDefs)

    Allows you to filter the features of individual layers in the exported map by specifying definition expressions for those layers. The layerDefs parameter should be a java.util.Map containing layer IDs (as Strings) as keys and their respective layer definition expressions as values.

    Parameters
    layerDefs Map: the Map of layer definition expressions to set

    public void setLayerMode (int layerMode)

    Sets the mode used by the IdentifyTask to determine which layers to perform the task on.

    There are 3 possible values:

  • ALL_LAYERS: identify features on all layers of the service
  • VISIBLE_LAYERS: identify features on the visible layers of the service only
  • TOP_MOST_LAYER identify features on the top-most layer of the service only

  • By default the value is ALL_LAYERS.


    You must carefully consider the following when setting the layer mode because this method's inherent relationship with the setLayers() method of this class. For instance, when you set a layer mode as well as the layer IDs, the ArcGIS Server treats the REST request as a Boolean "AND" operation between options setup with this and the setLayers() methods.


    Here is an example to help explain this relationship:
    Assume you have set the layer mode to visible so only visible layers are identified by the identify task. At the same time, let's assume you have called the setLayers() method passing in two layer IDs (2, and 5). However, layers 0, 1, 3 and 4 are all visible layers (6 layers altogether for a map service). When the identify task performs its operation, then only features on the layers with IDs 2 and 5 are identified, if they are currently visible. It's possible for layers 0, 1, 3 or 4 to be visible as well, but because of the "AND" condition they do not satisfy the relationship and features will not be identified on them.


    Parameters
    layerMode int: the layer mode to set.

    public void setLayers (int[] layers)

    Sets The array of layer IDs that reference the layers that the IdentifyTask will execute on.

    See the setLayerMode(int) method for details explaining the boolean "AND" relationship between the two methods when the REST request is sent to the ArcGIS Server to identify features.

    Parameters
    layers int: The IDs of the layers to perform the identify operation on

    public void setMapExtent (Envelope extent)

    Sets the extent of the map to perform the identify in. You must also set this map extent's spatial reference, using setSpatialReference(SpatialReference).

    Parameters
    extent Envelope: The extent of the map

    public void setMapHeight (int height)

    Sets the height in pixels of the extent of the map (used to determine the resolution of the map).

    Parameters
    height int: height of the map in screen pixels

    public void setMapWidth (int width)

    Sets the width in pixels of the extent of the map (used to determine the resolution of the map).

    Parameters
    width int: the width of the map in screen pixels

    public void setMaxAllowableOffset (double maxAllowableOffset)

    Sets the maximum allowable offset.

    Parameters
    maxAllowableOffset double: the maximum allowable offset

    public void setReturnGeometry (boolean returnGeometry)

    Sets whether to include geometry in the returned result.

    Parameters
    returnGeometry boolean: true to include geometry in the returned result, false otherwise

    public void setSpatialReference (SpatialReference spatialReference)

    Sets the spatial reference of the map extent set using setMapExtent(Envelope).

    Parameters
    spatialReference SpatialReference: the spatial reference of the map extent

    public void setTolerance (int tolerance)

    Sets the tolerance. The tolerance is the acceptable buffer distance, in screen pixels, around the geometry parameter that the IdentifyTask will identify features. The geometry type is specified by using the setGeometry() method or by passing in a geometry object during the instantiation of the IdentifyParameters object.


    By default tolerance value is 5.

    Example: if the geometry type is defined as an ArcGIS geometry Point and a tolerance of 2 is used, any feature within a 2 pixel radius of the point will be identified.

    Parameters
    tolerance int: the tolerance to set.