public class

ArcGISImageServiceLayer

extends DynamicLayer
implements TimeAwareLayer
java.lang.Object
   ↳ com.esri.android.map.Layer
     ↳ com.esri.android.map.DynamicLayer
       ↳ com.esri.android.map.ags.ArcGISImageServiceLayer

Class Overview

The ArcGISImageServiceLayer class allows you to work with an image service resource that is exposed by the ArcGIS Server REST API (see the system requirements document for supported versions of ArcGIS Server). A image service generates map images on the server each time a request comes in.

The following are examples of how you might work with the ArcGISImageServiceLayer class. The code will add a map service from ArcGIS Online using map services that are dynamically retrieved. When working with dynamic services the ArcGISImageServiceLayer class must be used. This example code shows you how to connect to ArcGIS Online, but you can easily update the code to point to your own ArcGIS Server REST end points. Java usage:

 //ArcGISImageServiceLayer class is used to define the Layer that is added to the
 //MapView object.
 MapView mv = new MapView(this);
 mv.addLayer(new ArcGISImageServiceLayer(
 "http://myserver/arcgis/rest/services/MyImage/ImageServer",null));
 setContentView(mv);
 

Summary

[Expand]
Inherited Fields
From class com.esri.android.map.DynamicLayer
From class com.esri.android.map.Layer
Public Constructors
ArcGISImageServiceLayer(String url, ImageServiceParameters options)
This constructor is used if you're instantiating the ArcGISImageServiceLayer.
ArcGISImageServiceLayer(String url, ImageServiceParameters options, UserCredentials credentials, boolean initLayer)
This constructor is used if you instantiate an ArcGISImageServiceLayer object.
ArcGISImageServiceLayer(String url, ImageServiceParameters options, UserCredentials credentials)
This constructor is used if you're instantiating the ArcGISImageServiceLayer (see the class description for an example of this usage).
Public Methods
int getBandCount()
Gets the number of bands in the ArcGISImageServiceLayer.
int[] getBandIds()
Gets ImageService Band IDs.
int getCompressionQuality()
Gets the compression quality of the exported image.
String getCopyrightText()
Gets the copyright information of the ArcGISImageServiceLayer.
ImageServiceParameters.IMAGE_FORMAT getImageFormat()
Gets the image format.
ImageServiceParameters.RSP getInterpolation()
Gets the interpolation method.
String getLayerDefinitionOverride()
Gets an override of the layer definition represented as a JSON string, for details see setLayerDefinitionOverride(String)
MosaicRule getMosaicRule()
Gets the mosaic rule of the layer.
ImageServiceParameters getOptions()
Gets the options of the ArcGISImageServiceLayer.
double getPixelSizeX()
Gets the size of pixel in X direction.
double getPixelSizeY()
Gets the size of pixel in Y direction.
ImageServiceParameters.PIXEL_TYPE getPixelType()
Gets the pixel type of the image service.
RasterFunction getRenderingRule()
Gets the rendering rule of the layer.
TimeExtent getTimeExtent()
Gets the valid TimeExtent object for the Layer or null if this service does not support time based queries.
TimeInfo getTimeInfo()
Get all the time awareness information for this layer.
TimeExtent getTimeInterval()
Get the current date/time range that this layer is filtered by.
boolean isTimeAware()
Indicates whether or not this particular layer instance is time aware.
void setBandIds(int[] bandIds)
Sets the R,G,B of the exported image to the appropriate ImageService Band ID.
void setCompressionQuality(int compressionQuality)
Sets the compression quality of the exported image.
void setImageFormat(ImageServiceParameters.IMAGE_FORMAT format)
Sets the image format.
void setInterpolation(ImageServiceParameters.RSP interpolation)
Sets the interpolation method.
void setLayerDefinitionOverride(String layerDefinition)
Sets an override of the layer definition represented as a JSON string, which matches the structure returned by REST for an image service.
void setMosaicRule(MosaicRule mosaicRule)
Sets the mosaic rule of the layer to the specified value.
void setRenderingRule(RasterFunction renderingRule)
Sets the rendering rule of the layer to the given value.
void setTimeInterval(TimeExtent timeInterval)
Set the current date/time range that this layer will be filtered by.
Protected Methods
byte[] getImage(int width, int height, Envelope extent)
void initLayer()
Initializes the layer.
[Expand]
Inherited Methods
From class com.esri.android.map.DynamicLayer
From class com.esri.android.map.Layer
From class java.lang.Object
From interface com.esri.android.map.popup.PopupLayer
From interface com.esri.core.map.TimeAwareLayer

Public Constructors

public ArcGISImageServiceLayer (String url, ImageServiceParameters options)

This constructor is used if you're instantiating the ArcGISImageServiceLayer.

Parameters
url String: the URL of the dynamic map service.
options ImageServiceParameters: optional parameters.

public ArcGISImageServiceLayer (String url, ImageServiceParameters options, UserCredentials credentials, boolean initLayer)

This constructor is used if you instantiate an ArcGISImageServiceLayer object.

Parameters
url String: the URL of the dynamic map service.
options ImageServiceParameters: optional parameters.
credentials UserCredentials: the credentials
initLayer boolean: set to true to initialize the the layer, or the layer will not initialized.

public ArcGISImageServiceLayer (String url, ImageServiceParameters options, UserCredentials credentials)

This constructor is used if you're instantiating the ArcGISImageServiceLayer (see the class description for an example of this usage).

Parameters
url String: the URL of the image map service.
options ImageServiceParameters: optional parameters.
credentials UserCredentials: the credentials

Public Methods

public int getBandCount ()

Gets the number of bands in the ArcGISImageServiceLayer. The BandCount is defined in the associated service. You should not invoke the method unless the layer is initialized.

Returns
int Returns the bandCount.

public int[] getBandIds ()

Gets ImageService Band IDs. BandIds are zero based.

Returns
int[] the band ids

public int getCompressionQuality ()

Gets the compression quality of the exported image. Only valid with JPG image format.

Returns
int A value from 0 to 100. 100 is best quality but largest in file size.

public String getCopyrightText ()

Gets the copyright information of the ArcGISImageServiceLayer. The text is defined in the associated service. You should not invoke the method unless the layer is initialized.

Returns
String Returns the copyrightText.

public ImageServiceParameters.IMAGE_FORMAT getImageFormat ()

Gets the image format.

Returns
ImageServiceParameters.IMAGE_FORMAT the image format.

public ImageServiceParameters.RSP getInterpolation ()

Gets the interpolation method. The interpolation method affects how the raster dataset is transformed when it undergoes warping or when it changes coordinate space.

Returns
ImageServiceParameters.RSP the interpolation value.

public String getLayerDefinitionOverride ()

Gets an override of the layer definition represented as a JSON string, for details see setLayerDefinitionOverride(String)

Returns
String a JSON string representing the overriding layer definition

public MosaicRule getMosaicRule ()

Gets the mosaic rule of the layer. The mosaic rule defines how individual images should be mosaicked.

Returns
MosaicRule the current MosaicRule.

public ImageServiceParameters getOptions ()

Gets the options of the ArcGISImageServiceLayer.

Returns
ImageServiceParameters Returns the options.

public double getPixelSizeX ()

Gets the size of pixel in X direction. The size is defined in the associated service. You should not invoke the method unless the layer is initialized.

Returns
double Returns the pixelSizeX.

public double getPixelSizeY ()

Gets the size of pixel in Y direction. The size is defined in the associated service. You should not invoke the method unless the layer is initialized.

Returns
double Returns the pixelSizeY.

public ImageServiceParameters.PIXEL_TYPE getPixelType ()

Gets the pixel type of the image service. Pertains to the type of values stored in the raster, such as signed integer, unsigned integer, or floating point. Integers are whole numbers, whereas floating points have decimals. The type is defined in the associated service. You should not invoke the method unless the layer is initialized.

Returns
ImageServiceParameters.PIXEL_TYPE Returns the pixelType.

public RasterFunction getRenderingRule ()

Gets the rendering rule of the layer.

Returns
RasterFunction the new rendering rule.

public TimeExtent getTimeExtent ()

Gets the valid TimeExtent object for the Layer or null if this service does not support time based queries.

Returns
TimeExtent the valid range of dates for this layer.

public TimeInfo getTimeInfo ()

Get all the time awareness information for this layer.

Returns
TimeInfo the time awareness information as a TimeInfo object

public TimeExtent getTimeInterval ()

Get the current date/time range that this layer is filtered by.

Returns
TimeExtent the current date/time range

public boolean isTimeAware ()

Indicates whether or not this particular layer instance is time aware.

Returns
boolean True if this is a time aware layer, false otherwise.

public void setBandIds (int[] bandIds)

Sets the R,G,B of the exported image to the appropriate ImageService Band ID. BandIds are zero based. You need to call refresh() to reflect changes of the band ids.

Parameters
bandIds int: the new band ids.

public void setCompressionQuality (int compressionQuality)

Sets the compression quality of the exported image. Only valid with JPG image format.You need to call

Parameters
compressionQuality int: A value from 0 to 100. 100 is best quality but largest in file size. refresh() to reflect changes of the compression quality.

public void setImageFormat (ImageServiceParameters.IMAGE_FORMAT format)

Sets the image format. You need to call refresh() to reflect changes of the format.

Parameters
format ImageServiceParameters.IMAGE_FORMAT: the new image format.

public void setInterpolation (ImageServiceParameters.RSP interpolation)

Sets the interpolation method. The interpolation method affects how the raster dataset is transformed when it undergoes warping or when it changes coordinate space. You need to call refresh() to reflect changes of the interpolation value.

Parameters
interpolation ImageServiceParameters.RSP: the new interpolation value.

public void setLayerDefinitionOverride (String layerDefinition)

Sets an override of the layer definition represented as a JSON string, which matches the structure returned by REST for an image service. Typically this layer definition is defined by a WebMapLayer (see getLayerDefinitionOverride()).

Parameters
layerDefinition String: a JSON string representing the overriding layer definition
Throws
RuntimeException if the JSON string is invalid

public void setMosaicRule (MosaicRule mosaicRule)

Sets the mosaic rule of the layer to the specified value. The mosaic rule defines how individual images should be mosaicked. You need to call refresh() to reflect changes of the MosaicRule.

Parameters
mosaicRule MosaicRule: the mosaic rule.

public void setRenderingRule (RasterFunction renderingRule)

Sets the rendering rule of the layer to the given value. You need to call refresh() to reflect changes of the rendering rule.

Parameters
renderingRule RasterFunction: the new rendering rule.

public void setTimeInterval (TimeExtent timeInterval)

Set the current date/time range that this layer will be filtered by.

Parameters
timeInterval TimeExtent: the new date/time range

Protected Methods

protected byte[] getImage (int width, int height, Envelope extent)

Parameters
width int
height int
extent Envelope
Returns
byte[]
Throws
Exception

protected void initLayer ()

Initializes the layer. The implementation should submit the OnStatusChangedListener.STATUS event accordingly.