com.esri.core.tasks.ags.identify
Class IdentifyParameters

java.lang.Object
  extended by com.esri.core.tasks.ags.identify.IdentifyParameters

public class IdentifyParameters
extends Object

The IdentifyParameters class is a container for input parameters that are used during the instantiation of the IdentifyTask object. The IdentifyTask uses these parameters to perform the action and return the results of the identify task. See the IdentifyTask class description for more details on what it accomplishes.

This class provides a method, validate(), that will make sure the required parameters have been set with values.

This class also provides a developer with the convenience method generateRequestParams() that will generate a HashMap of pairs for each parameter.


Field Summary
static int ALL_LAYERS
          Identify on all layers of the service.
static int TOP_MOST_LAYER
          Identify only on the top-most layer of the service.
static int VISIBLE_LAYERS
          Identify only on the visible layers of the service.
 
Constructor Summary
IdentifyParameters()
          Default constructor.
IdentifyParameters(Geometry geometry, Envelope mapExtent, SpatialReference extentSR, int[] layers, int mapWidth, int mapHeight, int dpi, boolean returnGeometry)
          Constructor with required parameters.
 
Method Summary
 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 must 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 if geometry must be included in the returned result.
 void setSpatialReference(SpatialReference spatialReference)
          Sets the spatial reference of the map extent.
 void setTolerance(int tolerance)
           Sets the tolerance.
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ALL_LAYERS

public static final int ALL_LAYERS
Identify on all layers of the service.

See Also:
Constant Field Values

VISIBLE_LAYERS

public static final int VISIBLE_LAYERS
Identify only on the visible layers of the service.

See Also:
Constant Field Values

TOP_MOST_LAYER

public static final int TOP_MOST_LAYER
Identify only on the top-most layer of the service.

See Also:
Constant Field Values
Constructor Detail

IdentifyParameters

public IdentifyParameters()
Default constructor.


IdentifyParameters

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

Parameters:
geometry - the geometry to identify
mapExtent - the current extent of the map
extentSR - the spatial reference of the map
layers - the array of layer IDs of the layers that the IdentifyTask will execute on
mapWidth - the width of the map in pixels
mapHeight - the height of the map in pixels
dpi - the dot-per-inch of the map displayed on the device
Method Detail

getReturnGeometry

public boolean getReturnGeometry()
Returns if geometry must be included in the returned result.

Returns:
true if geometry must be included in the returned result. Othewise, returns false

setReturnGeometry

public void setReturnGeometry(boolean returnGeometry)
Sets if geometry must be included in the returned result.

Parameters:
returnGeometry - if geometry must be included in the returned result

getMaxAllowableOffset

public double getMaxAllowableOffset()
Returns the maximum allowable offset.

Returns:
the maximum allowable offset

setMaxAllowableOffset

public void setMaxAllowableOffset(double maxAllowableOffset)
Sets the maximum allowable offset.

Parameters:
maxAllowableOffset - the maximum allowable offset

getLayerDefs

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:
the layer definition expressions

setLayerDefs

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.

Parameters:
layerDefs - the layer definition expressions to set

setGeometry

public void setGeometry(Geometry geometry)
Sets the Geometry to identify.

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

Parameters:
geometry - the geometry to identify

getGeometry

public Geometry getGeometry()
Returns the geometry to identify.

Returns:
the geometry to identify

setMapExtent

public void setMapExtent(Envelope extent)
Sets the extent of the map to perform the identify in.

Parameters:
extent - The extent of the map

getMapExtent

public Envelope getMapExtent()
Returns the extent of the map to identify in.

Returns:
the extent of the map

setSpatialReference

public void setSpatialReference(SpatialReference spatialReference)
Sets the spatial reference of the map extent.

Parameters:
spatialReference - the spatial reference of the map extent

getSpatialReference

public SpatialReference getSpatialReference()
Returns the spatial reference of the map extent.

Returns:
the spatial reference of the map extent

setLayerMode

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 - the layer mode to set.

    getLayerMode

    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:
    The layer mode

    setLayers

    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 - The IDs of the layers to perform the identify operation on

    getLayers

    public int[] getLayers()
    Returns the array of layer IDs that reference the layers that the IdentifyTask will execute on.

    Returns:
    the array of layer IDs.

    setMapWidth

    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 - the width of the map in screen pixels

    getMapWidth

    public int getMapWidth()
    Returns the width of the map in screen pixels.

    Returns:
    the width of the map in screen pixels

    setMapHeight

    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 - height of the map in screen pixels

    getMapHeight

    public int getMapHeight()
    Returns the height of the map in screen pixels.

    Returns:
    the height of the map in screen pixels

    setDPI

    public void setDPI(int dpi)
    Sets the dot-per-inch of the map (used to determine the resolution of the map).

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

    getDPI

    public int getDPI()
    Returns the dot-per-inch ratio of the map as it is being displayed.

    Returns:
    the DPI

    setTolerance

    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 - the tolerance to set.

    getTolerance

    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:
    The distance in screen pixels from the boundary of the specified geometry

    hashCode

    public int hashCode()
    Overrides:
    hashCode in class Object

    equals

    public boolean equals(Object obj)
    Overrides:
    equals in class Object


    Copyright © 2012. All Rights Reserved.