Query raster layer information using the Java Connector


ArcIMS 4.0 defines a new ArcXML request named GET_RASTER_INFO to retrieve pixel value information from an image layer in an Image or ArcMap service. The ArcIMS 4.0 Java Connector includes a JavaBeans Object Model Library and a custom JSP Tag Library that contain methods for retrieving raster information. However, only the Tag library reference includes detailed information on implementing a solution. This document provides additional information on the methods and properties included with the Java Connector JavaBeans Object Model Library to interact with raster layer information. Note that Java Connector documentation is included on the ArcIMS installation CD and can be found under $AIMSHOME\Documentation\Java_Connector. If the document was not installed, you must perform a custom install and select the Java Connector specifically from the available connectors.


The class represents a raster image layer in the Java Connector. An ImageLayer can be created or retrieved from a map component layer collection:

Code: layers = map.getLayers(); imagelayer = ( layers.getLayersCollection().get(0);

ImageLayer contains two methods used to query image pixel values: setRasterObject() and getRasterInfo(). The setRasterObject() method takes one argument, a object. The Raster object uses the setX() and setY() methods to set a point value to be used when querying a pixel in an image layer.

Code: raster = new;

Once the Raster object for an ImageLayer is set, the next refresh of the Map object which contains the ImageLayer will send a GET_RASTER_INFO ArcXML request. The ImageLayer's getRasterInfo() method will retrieve information in a RASTER_INFO response, including the queried pixel value. The getRasterInfo() method returns a object containing specific band information inherent to the queried image layer. The example code below assumes that the image layer contains three bands.

map.refresh(); rasterinfo = imagelayer.getRasterInfo(); bands = rasterinfo.getBands(0); band0 = bands.getBand(0); band1 = bands.getBand(1); band2 = bands.getBand(2);
String band0value = band0.getBandValue();
String band1value = band1.getBandValue();
String band2value = band2.getBandValue();

Before the next refresh of the Map object, the Raster object applied to the ImageLayer must be set to null, otherwise another GET_RASTER_INFO request will be sent to the ArcIMS service.


Article ID:000005783

  • Legacy Products

Get help from ArcGIS experts

Contact technical support

Download the Esri Support App

Go to download options

Discover more on this topic