|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.esri.core.tasks.ags.identify.IdentifyParameters
public class IdentifyParameters
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
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 |
---|
public static final int ALL_LAYERS
public static final int VISIBLE_LAYERS
public static final int TOP_MOST_LAYER
Constructor Detail |
---|
public IdentifyParameters()
public IdentifyParameters(Geometry geometry, Envelope mapExtent, SpatialReference extentSR, int[] layers, int mapWidth, int mapHeight, int dpi, boolean returnGeometry)
geometry
- the geometry to identifymapExtent
- the current extent of the mapextentSR
- the spatial reference of the maplayers
- the array of layer IDs of the layers that the IdentifyTask will execute onmapWidth
- the width of the map in pixelsmapHeight
- the height of the map in pixelsdpi
- the dot-per-inch of the map displayed on the deviceMethod Detail |
---|
public boolean getReturnGeometry()
public void setReturnGeometry(boolean returnGeometry)
returnGeometry
- if geometry must be included in the returned resultpublic double getMaxAllowableOffset()
public void setMaxAllowableOffset(double maxAllowableOffset)
maxAllowableOffset
- the maximum allowable offsetpublic Map<String,String> getLayerDefs()
public void setLayerDefs(Map<String,String> layerDefs)
layerDefs
- the layer definition expressions to setpublic void setGeometry(Geometry geometry)
Geometry
to identify.
The supported geometries are: Point, Polyline, Polygon and Envelope
geometry
- the geometry to identifypublic Geometry getGeometry()
public void setMapExtent(Envelope extent)
extent
- The extent of the mappublic Envelope getMapExtent()
public void setSpatialReference(SpatialReference spatialReference)
spatialReference
- the spatial reference of the map extentpublic SpatialReference getSpatialReference()
public void setLayerMode(int layerMode)
There are 3 possible values:
ALL_LAYERS
: identify features on all layers of the serviceVISIBLE_LAYERS
: identify features on the visible layers of the service onlyTOP_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.
layerMode
- the layer mode to set.public int getLayerMode()
There are 3 possible values:
ALL_LAYERS
: identify features on all layers of the serviceVISIBLE_LAYERS
: identify features on the visible layers of the service onlyTOP_MOST_LAYER
identify features on the top-most layer of the service only
By default the value is ALL_LAYERS
.
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.
layers
- The IDs of the layers to perform the identify operation onpublic int[] getLayers()
public void setMapWidth(int width)
width
- the width of the map in screen pixelspublic int getMapWidth()
public void setMapHeight(int height)
height
- height of the map in screen pixelspublic int getMapHeight()
public void setDPI(int dpi)
dpi
- dot-per-inch ratio of the mappublic int getDPI()
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.
tolerance
- the tolerance to set.public int getTolerance()
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).
public int hashCode()
hashCode
in class Object
public boolean equals(Object obj)
equals
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |