ilog.views.maps.format.cadrg
Class IlvCADRGFrameReader

java.lang.Object
  extended by ilog.views.maps.format.cadrg.IlvCADRGFrameReader
All Implemented Interfaces:
IlvMapFeatureIterator

public class IlvCADRGFrameReader
extends Object
implements IlvMapFeatureIterator

This class is used to read CADGR frames. A frame is a file that constitutes the basic entity of the CADRG format. Frame files can be found in the coverage directories that are below the root directory of a CADRG product.

The geometries returned by the IlvCADRGFrameReader are instances of the class IlvMapImage. Usually, a CADRG Frame contains 36 subframes. Each subframe is translated into an IlvMapFeature.

Since:
ILOG JViews 3.0
See Also:
IlvCADRGFrame, IlvCADRGTocReader

Constructor Summary
IlvCADRGFrameReader(DataInput dataInput, boolean transparency)
          Creates an instance of a CADRG frame reader from a dataInput opened on a CADRG Frame.
IlvCADRGFrameReader(String fileName, boolean transparency)
          Creates an instance of a CADRG frame reader for the specified frame file.
IlvCADRGFrameReader(URL url, boolean transparency)
          Creates an instance of a CADRG frame reader for the specified URL.
 
Method Summary
 void dispose()
          Releases the resources allocated by the reader.
 void finalize()
          Is called by the Java Garbage Collector to release the resources allocated to the reader.
 ColorModel getColorModel()
          Returns the color model to use for this frame.
 IlvCoordinateSystem getCoordinateSystem()
          Returns the spatial reference system that describes the coordinate system of geometric coordinates of the map features.
 IlvFeatureRenderer getDefaultFeatureRenderer()
          Returns the default renderer for this reader.
 IlvCoordinate getLowerRightCorner()
          Returns the coordinates of the lower-right corner of the frame in longitude and latitude expressed in the reader's projection.
 IlvCoordinate getLowerRightCorner(int subFrameIndex)
          Returns the lower right coordinate of one of the 36 sub frames.
 IlvMapFeature getNextFeature()
          Returns the next feature read.
 IlvCoordinate getUpperLeftCorner()
          Returns the coordinates of the upper-left corner of the frame in longitude and latitude expressed in the readers' projection.
 IlvCoordinate getUpperLeftCorner(int subFrameIndex)
          Returns the upper left coordinate of one of the 36 sub frames.
 boolean isGeoreferenced()
          Returns false if the frame is an overview or a frame containing legends.
 boolean isSubFrameValid(int subFrame)
          Returns true if the sub frame is defined in the CADRG frame.
 byte[] readNextSubFrameRaster()
          Reads the next available buffer in the CADRG Frame file.
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IlvCADRGFrameReader

public IlvCADRGFrameReader(String fileName,
                           boolean transparency)
                    throws FileNotFoundException,
                           IOException,
                           IlvMapFormatException
Creates an instance of a CADRG frame reader for the specified frame file.

Parameters:
fileName - The name of the CADRG frame file
transparency - If true, the transparent pixels of the CADRG frame are displayed as transparent; otherwise, they appear black.
Throws:
FileNotFoundException - if the file does not exist.
IOException - if an IO error occurs.
IlvMapFormatException

IlvCADRGFrameReader

public IlvCADRGFrameReader(URL url,
                           boolean transparency)
                    throws IOException,
                           IlvMapFormatException
Creates an instance of a CADRG frame reader for the specified URL.

Parameters:
url - The URL of the CADRG frame file
transparency - If true, the transparent pixels of the CADRG frame are displayed as transparent; otherwise, they appear black.
Throws:
IOException - if an IO error occurs.
IlvMapFormatException - if a format error occurs.

IlvCADRGFrameReader

public IlvCADRGFrameReader(DataInput dataInput,
                           boolean transparency)
                    throws IOException,
                           IlvMapFormatException
Creates an instance of a CADRG frame reader from a dataInput opened on a CADRG Frame.

Parameters:
dataInput - the data input of the CADRG frame file
transparency - If true, the transparent pixels of the CADRG frame are displayed as transparent; otherwise, they appear black.
Throws:
IOException - if an IO error occurs.
IlvMapFormatException - if a format error occurs.
Method Detail

getCoordinateSystem

public IlvCoordinateSystem getCoordinateSystem()
Returns the spatial reference system that describes the coordinate system of geometric coordinates of the map features.

Specified by:
getCoordinateSystem in interface IlvMapFeatureIterator
Returns:
The coordinate system, or null if the coordinate system is unknown.
Since:
JViews 5.0

getUpperLeftCorner

public IlvCoordinate getUpperLeftCorner()
Returns the coordinates of the upper-left corner of the frame in longitude and latitude expressed in the readers' projection.

Specified by:
getUpperLeftCorner in interface IlvMapFeatureIterator
Returns:
the coordinates of the upper-left corner.

getLowerRightCorner

public IlvCoordinate getLowerRightCorner()
Returns the coordinates of the lower-right corner of the frame in longitude and latitude expressed in the reader's projection.

Specified by:
getLowerRightCorner in interface IlvMapFeatureIterator
Returns:
the coordinates of the lower-right corner.

getDefaultFeatureRenderer

public IlvFeatureRenderer getDefaultFeatureRenderer()
Returns the default renderer for this reader.

Specified by:
getDefaultFeatureRenderer in interface IlvMapFeatureIterator
Returns:
Returns the default renderer for this reader.

dispose

public void dispose()
Releases the resources allocated by the reader. This function can be called several times, but only the first call actually free resources.

Specified by:
dispose in interface IlvMapFeatureIterator

finalize

public void finalize()
Is called by the Java Garbage Collector to release the resources allocated to the reader. If the dispose method has not been called, it releases the resources used by the reader.

Overrides:
finalize in class Object
See Also:
dispose()

getNextFeature

public IlvMapFeature getNextFeature()
                             throws IOException
Returns the next feature read. A frame is usually composed of 36 subframes. This method returns null when all the features are read.

Specified by:
getNextFeature in interface IlvMapFeatureIterator
Returns:
the next feature read or null.
Throws:
IOException

readNextSubFrameRaster

public byte[] readNextSubFrameRaster()
                              throws IOException
Reads the next available buffer in the CADRG Frame file. Using this method directly prevents the use of getNextFeature().

Returns:
a 256*256 raster data coherent with the ColorModel
Throws:
IOException
Since:
JViews 7.5
See Also:
getNextFeature(), getColorModel()

isGeoreferenced

public boolean isGeoreferenced()
Returns false if the frame is an overview or a frame containing legends.

Specified by:
isGeoreferenced in interface IlvMapFeatureIterator
Returns:
true if frame is georeferenced.

getColorModel

public ColorModel getColorModel()
Returns the color model to use for this frame.

Returns:
Returns the color model to use for this frame.
Since:
JViews 7.5

getUpperLeftCorner

public IlvCoordinate getUpperLeftCorner(int subFrameIndex)
Returns the upper left coordinate of one of the 36 sub frames.

Parameters:
subFrameIndex - index of the sub frame (from 0 to 35)
Returns:
Returns the upper left coordinate of one of the 36 sub frames.
Since:
JViews 7.5

getLowerRightCorner

public IlvCoordinate getLowerRightCorner(int subFrameIndex)
Returns the lower right coordinate of one of the 36 sub frames.

Parameters:
subFrameIndex - index of the sub frame (from 0 to 35)
Returns:
Returns the lower right coordinate of one of the 36 sub frames.
Since:
JViews 7.5

isSubFrameValid

public boolean isSubFrameValid(int subFrame)
Returns true if the sub frame is defined in the CADRG frame.

Parameters:
subFrame - index of the sub frame (from 0 to 35)
Returns:
Returns true if the sub frame is defined in the CADRG frame.
Since:
JViews 7.5


Copyright © 1996-2007 ILOG S.A. All rights reserved.   Documentation homepage.