com.esri.android.map.ags
Class ArcGISImageServiceLayer

java.lang.Object
  extended by com.esri.android.map.Layer
      extended by com.esri.android.map.DynamicLayer
          extended by com.esri.android.map.ags.ArcGISImageServiceLayer

public class ArcGISImageServiceLayer
extends DynamicLayer

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);
 


Constructor Summary
ArcGISImageServiceLayer(String url, ImageServiceParameters options)
          This constructor is used if you're instantiating the ArcGISImageServiceLayer.
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).
ArcGISImageServiceLayer(String url, ImageServiceParameters options, UserCredentials credentials, boolean initLayer)
          This constructor is used if you instantiate an ArcGISImageServiceLayer object.
 
Method Summary
 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.
 
Methods inherited from class com.esri.android.map.DynamicLayer
cancelPendingTasks, getBrightness, getContrast, getGamma, recycle, refresh, setBrightness, setContrast, setGamma
 
Methods inherited from class com.esri.android.map.Layer
getCredentials, getDefaultSpatialReference, getExtent, getFullExtent, getHeight, getID, getName, getOpacity, getPopupInfo, getResolution, getSpatialReference, getTitle, getUrl, getUrlHashCode, getWidth, isInitialized, isRecycled, isVisible, isWebMapBaselayer, reinitializeLayer, setName, setOnStatusChangedListener, setOpacity, setPopupInfos, setVisible
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ArcGISImageServiceLayer

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.

ArcGISImageServiceLayer

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.
initLayer - set to true to initialize the the layer, or the layer will not initialized.

ArcGISImageServiceLayer

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.
Method Detail

setBandIds

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 DynamicLayer.refresh() to reflect changes of the band ids.

Parameters:
bandIds - the new band ids.

getBandIds

public int[] getBandIds()
Gets ImageService Band IDs. BandIds are zero based.


setCompressionQuality

public void setCompressionQuality(int compressionQuality)
Sets the compression quality of the exported image. Only valid with JPG image format.You need to call DynamicLayer.refresh() to reflect changes of the compression quality.

Parameters:
compressionQuality - A value from 0 to 100. 100 is best quality but largest in file size.

getCompressionQuality

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.

setImageFormat

public void setImageFormat(ImageServiceParameters.IMAGE_FORMAT format)
Sets the image format. You need to call DynamicLayer.refresh() to reflect changes of the format.

Parameters:
format - the new image format.

getImageFormat

public ImageServiceParameters.IMAGE_FORMAT getImageFormat()
Gets the image format.

Returns:
the image format.

setInterpolation

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 DynamicLayer.refresh() to reflect changes of the interpolation value.

Parameters:
interpolation - the new interpolation value.

getInterpolation

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.

setMosaicRule

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 DynamicLayer.refresh() to reflect changes of the MosaicRule.

Parameters:
mosaicRule - the mosaic rule.

getMosaicRule

public MosaicRule getMosaicRule()
Gets the mosaic rule of the layer. The mosaic rule defines how individual images should be mosaicked.

Returns:
the current MosaicRule.

setRenderingRule

public void setRenderingRule(RasterFunction renderingRule)
Sets the rendering rule of the layer to the given value. You need to call DynamicLayer.refresh() to reflect changes of the rendering rule.

Parameters:
renderingRule - the new rendering rule.

getRenderingRule

public RasterFunction getRenderingRule()
Gets the rendering rule of the layer.

Returns:
the new rendering rule.

getPixelSizeX

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.

getPixelSizeY

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.

getPixelType

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.

getBandCount

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.

getCopyrightText

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.

getOptions

public ImageServiceParameters getOptions()
Gets the options of the ArcGISImageServiceLayer.

Returns:
Returns the options.
See Also:
ArcGISImageServiceLayer(String, ImageServiceParameters)


Copyright © 2012. All Rights Reserved.