public class

ArcGISImageServiceLayer

extends DynamicLayer
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.
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.
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 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.
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

Public Constructors

public ArcGISImageServiceLayer (String url, ImageServiceParameters options)

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

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

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

This constructor is used if you instantiate an ArcGISImageServiceLayer object.

Parameters
url the URL of the dynamic map service.
options optional parameters.
credentials the credentials
initLayer 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 the URL of the image map service.
options optional parameters.
credentials 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
  • Returns the bandCount.

public int[] getBandIds ()

Gets ImageService Band IDs. BandIds are zero based.

Returns
  • the band ids

public int getCompressionQuality ()

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

Returns
  • 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
  • Returns the copyrightText.

public ImageServiceParameters.IMAGE_FORMAT getImageFormat ()

Gets the image format.

Returns
  • 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
  • the interpolation value.

public MosaicRule getMosaicRule ()

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

Returns
  • the current MosaicRule.

public ImageServiceParameters getOptions ()

Gets the options of the ArcGISImageServiceLayer.

Returns
  • 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
  • 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
  • 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
  • Returns the pixelType.

public RasterFunction getRenderingRule ()

Gets the rendering rule of the layer.

Returns
  • the new rendering rule.

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 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 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 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 the new interpolation value.

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 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 the new rendering rule.

Protected Methods

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

Throws
Exception

protected void initLayer ()

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