com.esri.arcgis.carto
Class ImageServer

java.lang.Object
  extended by com.esri.arcgis.carto.ImageServer
All Implemented Interfaces:
IImageServer, IImageServerInit, IImageTileServer, com.esri.arcgis.interop.RemoteObjRef, IServerObject, IServerObjectExtensionManager, ILogSupport, IObjectActivate, IObjectConstruct, IRequestHandler, IRequestHandler2, ISupportErrorInfo, Serializable

public class ImageServer
extends Object
implements com.esri.arcgis.interop.RemoteObjRef, IImageServer, IImageServerInit, IImageTileServer, IServerObject, IObjectConstruct, IRequestHandler, IRequestHandler2, ILogSupport, IObjectActivate, IServerObjectExtensionManager, ISupportErrorInfo

The ArcGIS Server Image Server class.

Description

This object is new at ArcGIS 9.3.

Remarks

The ImageServer server object provides the implementation of the image service, and supports IImageServer interface. The IImageServer interface is used to query the service information, and fetch pixels. The pixels are returned in a byte array and arranged in a band interleaved by pixel format plus a NoData mask. The byte array can be optionally compressed using JPEG (plus transparency), and LZ77 compression.

This interface also supports exporting an image into a well-known format and returning it as MIME data, or a URL. The supported well-known image format includes JPEG (plus transparency mask), PNG, BMP, and TIFF.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

See Also:
Serialized Form

Field Summary
 
Fields inherited from interface com.esri.arcgis.system.IObjectActivate
IID, IIDe3b78022_143e_4e61_9099_ed319ec061e7, xxDummy
 
Constructor Summary
ImageServer()
          Constructs a ImageServer using ArcGIS Engine.
ImageServer(Object obj)
          Deprecated. As of ArcGIS 9.2, replaced by normal Java casts.
ImageServer theImageServer = (ImageServer) obj;
 
Method Summary
 void activate()
          Activates the object.
 void attach(String cache)
          Attaches to a given tile cache.
 void construct(IPropertySet props)
          Two phase object construction.
 void deactivate()
          Deactivates the object.
 boolean equals(Object o)
          Compare this object with another
 IImageResult exportImage(IGeoImageDescription pImageDescription, IImageType pImageType)
          Exports into a well-known image for a given image description.
 IServerObjectExtension findExtensionByCLSID(String cLSID)
          Returns a server object extension found using a string representation of its class ID.
 IServerObjectExtension findExtensionByTypeName(String name)
          Returns a server object extension found using its type name.
 void generateTiles(IEnvelope pExtent, int minLOD, int maxLOD, ITrackCancel pCancelTracker)
          Generates tiles into the attached tile cache.
static String getClsid()
          getClsid.
 String getConfigurationName()
          Name of the server object configuration that defines the server object.
 byte[] getImage(IGeoImageDescription pImageDescription)
          Gets an image for a given image description.
 IName getImageDataSourceName()
          The image server data source name.
 IImageServiceInfo getServiceInfo()
          The properties of the image service provided.
 byte[] getTile(int partition, int level, int row, int column)
          Gets a tile from the attached tile cache.
 String getTypeName()
          Type of the server object (MapServer or GeocodeServer).
 float getVersion()
          The Image Server version number.
 byte[] handleBinaryRequest(byte[] request)
          Handles a binary request.
 byte[] handleBinaryRequest2(String capabilities, byte[] request)
          Handles a binary request with explicit capabilities.
 String handleStringRequest(String capabilities, String request)
          Handles a SOAP string request.
 int hashCode()
          the hashcode for this object
 void initialize(String fullName)
          Initializes this image server from a fullname to a dataset.
 void initializeFromDataset(IRasterDataset pDataset)
          Initializes this image server from a Raster Dataset.
 void initializeFromServiceURL(String serviceURL)
          Initializes this image server from an AIS service URL (ImageService://:/).
 void initLogging(ILog log)
          Initializes an object with a log.
 void interfaceSupportsErrorInfo(GUID riid)
          interfaceSupportsErrorInfo
 void setImageDataSourceNameByRef(IName ppName)
          The image server data source name.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.esri.arcgis.interop.RemoteObjRef
getJintegraDispatch, release
 

Constructor Detail

ImageServer

public ImageServer()
            throws IOException,
                   UnknownHostException
Constructs a ImageServer using ArcGIS Engine.

Throws:
IOException - if there are interop problems
UnknownHostException - if there are interop problems

ImageServer

public ImageServer(Object obj)
            throws IOException
Deprecated. As of ArcGIS 9.2, replaced by normal Java casts.
ImageServer theImageServer = (ImageServer) obj;

Construct a ImageServer using a reference to such an object returned from ArcGIS Engine or Server. This is semantically equivalent to casting obj to ImageServer.

Parameters:
obj - an object returned from ArcGIS Engine or Server
Throws:
IOException - if there are interop problems
Method Detail

getClsid

public static String getClsid()
getClsid.


equals

public boolean equals(Object o)
Compare this object with another

Overrides:
equals in class Object

hashCode

public int hashCode()
the hashcode for this object

Overrides:
hashCode in class Object

getVersion

public float getVersion()
                 throws IOException,
                        AutomationException
The Image Server version number.

Description

Returns the version number of the Image Server

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
getVersion in interface IImageServer
Returns:
The pVersion
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getServiceInfo

public IImageServiceInfo getServiceInfo()
                                 throws IOException,
                                        AutomationException
The properties of the image service provided.

Description

Returns information of the image service. The information includes description, spatial reference, extent, pixel size about the image data.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
getServiceInfo in interface IImageServer
Returns:
A reference to a com.esri.arcgis.carto.IImageServiceInfo
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getImage

public byte[] getImage(IGeoImageDescription pImageDescription)
                throws IOException,
                       AutomationException
Gets an image for a given image description.

Description

Gets the image data in byte array from the image service using the given GeoImageDescription.

Remarks

Gets the image data for a given image description. The returned image data contains first pixel values and then followed by NoData (transparency) bit mask, i.e. <pixels><mask>. The pixel values are organized in a band interleaved by pixel format, as the following:

v[0,0,0], v[1,0,0], v[2,0,0],, v[nBands-1,0,0],

v[0,0,1], v[1,0,1], v[2,0,1],, v[nBands-1, 0,1], ,

v[0,nRows-1,nCols-1], , v[nBands-1,nRows-1,nCols-1]

where nCols, nRows, and nBands are the number of columns, number of rows, and number of bands of the returned image, and v[b,I,j] is a pixel value at band number b, row number I, and column number j. The size in terms of number of bytes of a pixel value depends on pixel type. The following table shows the pixel type to pixel size mapping:

PT_U1 1

PT_U2 1

PT_U4 1

PT_UCHAR 1

PT_CHAR 1

PT_USHORT 2

PT_SHORT 2

PT_ULONG 4

PT_LONG 4

PT_FLOAT 4

PT_DOUBLE 8

The location of the pixel at band b, row I, and column j can be calculated using the following formula:

location = ((i*nCols+j)*nBands+b)*pixelsize (in bytes)

The pixel data are always in Intel (Little Endian) byte order. For pixel types of more than 1 byte, byte swapping may be needed.

The NoData mask is a bit mask, one bit per pixels of all bands, with no padding to the byte boundary for a row. Value 1 indicates the pixel is valid, and 0 indicates NoData. The mask value for a pixel at row I and column j can be calculated as the following:

Bit[] = {0x80, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x01}

l = i*nCols+j

m[l/8] & Bit[l%8]

The NoData immediately follows pixel data. The size of NoData mask in bytes is (nCols*nRows+7)/8.

The NoData mask is optional. If the total size of the returned image data greater than the pixel data size i.e. nRows*nCols*nBands*pixelsize, then the NoData mask is present.

If LZ77 compressed, the returned image data must be uncompressed (zlib). The uncompressed image data follow the same format as above.

If JPEG compressed, the returned image data are organized as JPEG data stream followed NoData mask, and followed by the size of the JPEG stream, i.e. <JPEG><mask><size>. The NoData mask is the same format as above, but is LZ77 compressed. The JPEG data stream size <size> is a 4-byte integer in Intel byte order.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
getImage in interface IImageServer
Parameters:
pImageDescription - A reference to a com.esri.arcgis.carto.IGeoImageDescription (in)
Returns:
An unsigned byte
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
See Also:
IGeoImageDescription

exportImage

public IImageResult exportImage(IGeoImageDescription pImageDescription,
                                IImageType pImageType)
                         throws IOException,
                                AutomationException
Exports into a well-known image for a given image description.

Description

Exports image data from the image server using the GeoImageDescription and ImagType.

Remarks

Exports a well-known image for a given image description. The supported formats include JPEG (plus transparency mask), PNG, BMP, and TIFF. The JPEG (plus transparency mask) format is the same as the JPEG compressed image returned from GetImage.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
exportImage in interface IImageServer
Parameters:
pImageDescription - A reference to a com.esri.arcgis.carto.IGeoImageDescription (in)
pImageType - A reference to a com.esri.arcgis.carto.IImageType (in)
Returns:
A reference to a com.esri.arcgis.carto.IImageResult
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
See Also:
IGeoImageDescription

initialize

public void initialize(String fullName)
                throws IOException,
                       AutomationException
Initializes this image server from a fullname to a dataset.

Description

Initializes an ImageServer from a full path name to the data.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
initialize in interface IImageServerInit
Parameters:
fullName - The fullName (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

initializeFromDataset

public void initializeFromDataset(IRasterDataset pDataset)
                           throws IOException,
                                  AutomationException
Initializes this image server from a Raster Dataset.

Description

Initializes an ImageServer from a raster dataset.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
initializeFromDataset in interface IImageServerInit
Parameters:
pDataset - A reference to a com.esri.arcgis.geodatabase.IRasterDataset (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

initializeFromServiceURL

public void initializeFromServiceURL(String serviceURL)
                              throws IOException,
                                     AutomationException
Initializes this image server from an AIS service URL (ImageService://:/).

Remarks

Initializes an ImageServer from an AIS service URL.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
initializeFromServiceURL in interface IImageServerInit
Parameters:
serviceURL - The serviceURL (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setImageDataSourceNameByRef

public void setImageDataSourceNameByRef(IName ppName)
                                 throws IOException,
                                        AutomationException
The image server data source name.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
setImageDataSourceNameByRef in interface IImageServerInit
Parameters:
ppName - A reference to a com.esri.arcgis.system.IName (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getImageDataSourceName

public IName getImageDataSourceName()
                             throws IOException,
                                    AutomationException
The image server data source name.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
getImageDataSourceName in interface IImageServerInit
Returns:
A reference to a com.esri.arcgis.system.IName
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

attach

public void attach(String cache)
            throws IOException,
                   AutomationException
Attaches to a given tile cache.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
attach in interface IImageTileServer
Parameters:
cache - The cache (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getTile

public byte[] getTile(int partition,
                      int level,
                      int row,
                      int column)
               throws IOException,
                      AutomationException
Gets a tile from the attached tile cache.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
getTile in interface IImageTileServer
Parameters:
partition - The partition (in)
level - The level (in)
row - The row (in)
column - The column (in)
Returns:
An unsigned byte
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

generateTiles

public void generateTiles(IEnvelope pExtent,
                          int minLOD,
                          int maxLOD,
                          ITrackCancel pCancelTracker)
                   throws IOException,
                          AutomationException
Generates tiles into the attached tile cache.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
generateTiles in interface IImageTileServer
Parameters:
pExtent - A reference to a com.esri.arcgis.geometry.IEnvelope (in)
minLOD - The minLOD (in)
maxLOD - The maxLOD (in)
pCancelTracker - A reference to a com.esri.arcgis.system.ITrackCancel (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getConfigurationName

public String getConfigurationName()
                            throws IOException,
                                   AutomationException
Name of the server object configuration that defines the server object.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Specified by:
getConfigurationName in interface IServerObject
Returns:
The name
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getTypeName

public String getTypeName()
                   throws IOException,
                          AutomationException
Type of the server object (MapServer or GeocodeServer).

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Specified by:
getTypeName in interface IServerObject
Returns:
The name
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

construct

public void construct(IPropertySet props)
               throws IOException,
                      AutomationException
Two phase object construction.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Specified by:
construct in interface IObjectConstruct
Parameters:
props - A reference to a com.esri.arcgis.system.IPropertySet (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

handleBinaryRequest

public byte[] handleBinaryRequest(byte[] request)
                           throws IOException,
                                  AutomationException
Handles a binary request.

Specified by:
handleBinaryRequest in interface IRequestHandler
Parameters:
request - An unsigned byte (in)
Returns:
An unsigned byte
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

handleStringRequest

public String handleStringRequest(String capabilities,
                                  String request)
                           throws IOException,
                                  AutomationException
Handles a SOAP string request.

Specified by:
handleStringRequest in interface IRequestHandler
Parameters:
capabilities - The capabilities (in)
request - The request (in)
Returns:
The response
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

handleBinaryRequest2

public byte[] handleBinaryRequest2(String capabilities,
                                   byte[] request)
                            throws IOException,
                                   AutomationException
Handles a binary request with explicit capabilities.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
handleBinaryRequest2 in interface IRequestHandler2
Parameters:
capabilities - The capabilities (in)
request - An unsigned byte (in)
Returns:
An unsigned byte
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

initLogging

public void initLogging(ILog log)
                 throws IOException,
                        AutomationException
Initializes an object with a log.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Specified by:
initLogging in interface ILogSupport
Parameters:
log - A reference to a com.esri.arcgis.system.ILog (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

activate

public void activate()
              throws IOException,
                     AutomationException
Activates the object.

Specified by:
activate in interface IObjectActivate
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

deactivate

public void deactivate()
                throws IOException,
                       AutomationException
Deactivates the object.

Specified by:
deactivate in interface IObjectActivate
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

findExtensionByCLSID

public IServerObjectExtension findExtensionByCLSID(String cLSID)
                                            throws IOException,
                                                   AutomationException
Returns a server object extension found using a string representation of its class ID.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
findExtensionByCLSID in interface IServerObjectExtensionManager
Parameters:
cLSID - The cLSID (in)
Returns:
A reference to a com.esri.arcgis.server.IServerObjectExtension
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

findExtensionByTypeName

public IServerObjectExtension findExtensionByTypeName(String name)
                                               throws IOException,
                                                      AutomationException
Returns a server object extension found using its type name.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
findExtensionByTypeName in interface IServerObjectExtensionManager
Parameters:
name - The name (in)
Returns:
A reference to a com.esri.arcgis.server.IServerObjectExtension
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

interfaceSupportsErrorInfo

public void interfaceSupportsErrorInfo(GUID riid)
                                throws IOException,
                                       AutomationException
interfaceSupportsErrorInfo

Description

Indicates whether the interface supports IErrorInfo.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Specified by:
interfaceSupportsErrorInfo in interface ISupportErrorInfo
Parameters:
riid - A Structure: com.esri.arcgis.support.ms.stdole.GUID (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.