ilog.views.maps.format.image
Class IlvRasterBasicImageReader

java.lang.Object
  extended by ilog.views.maps.raster.IlvRasterAbstractReader
      extended by ilog.views.maps.format.image.IlvRasterBasicImageReader
All Implemented Interfaces:
IlvPersistentObject, IlvMapFeatureIterator, IlvMapReusableFeatureIterator

public class IlvRasterBasicImageReader
extends IlvRasterAbstractReader

GIF,JPG,PNG or TIFF reader that creates reprojectable and pixel-on-demand images. Example of use:

 // create a raster reader for the gif file
 IlvRasterBasicImageReader imageReader = new IlvRasterBasicImageReader();
 imageReader.addMap(gifFile.getFile());
 // georeference this image (it covers the whole earth)
 imageReader.setImageBounds(0,-Math.PI,Math.PI/2,Math.PI,-Math.PI/2);         
 // create a datasource for the gif file.
 IlvMapDataSource imageDataSource = IlvRasterDataSourceFactory.buildTiledImageDataSource(manager,imageReader,true,true,null);
 

Since:
JViews 7.5

Field Summary
 
Fields inherited from class ilog.views.maps.raster.IlvRasterAbstractReader
needReload
 
Constructor Summary
IlvRasterBasicImageReader()
          Default constructor to create on-demand pixel JPG,TIFF,GIF or PNG images.
IlvRasterBasicImageReader(IlvInputStream stream)
          Constructor to reconstruct an image reader from saved information.
 
Method Summary
 boolean addMap(String file)
          Adds an image to read.
 boolean addMap(URL url)
          Adds an image to read.
 IlvCoordinateSystem getCoordinateSystem()
          Returns the associated coordinate system ornull if none has been set.
 IlvMathTransform getInternalTransformation(int imageIndex)
          Return the projection associated with the raster stored at the given index.
 IlvFeatureAttributeProperty getProperties(int imageIndex)
          Returns the feature properties to be associated with the image.
 void reload(IlvThreadMonitoringData monitorInfo)
          Given the state of the reader (the number of images read, coverage zone,...), the purpose of this method is to recreate all images from the original source.
 void setImageBounds(int imageIndex, double xlon1, double ylat1, double xlon2, double ylat2)
          Sets the internal transformation to place image at specified lat/lon.
 void setInternalTransformation(IlvMathTransform transformation)
          Specifies a mathematical transform to apply when reading the image.
 void write(IlvOutputStream stream)
          Writes the attributes of a persistent object.
 
Methods inherited from class ilog.views.maps.raster.IlvRasterAbstractReader
addRaster, computeGisImageBounds, computeLimits, createRasterTileLoader, dispose, getDefaultFeatureRenderer, getImageBounds, getImageCount, getInverseTransformation, getLowerRightCorner, getLowerRightCorner, getMaximumIntervalsForDeterminingImageLocation, getNextFeature, getRasterMappedBuffer, getRasterProperties, getTileLoader, getTileLoader, getTileLoaders, getTransformation, getUpperLeftCorner, getUpperLeftCorner, isGeoreferenced, isHighQualityRendering, isNeedReload, removeRaster, restart, setHighQualityRendering, setMaximumIntervalsForDeterminingImageLocation, setTransformation
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IlvRasterBasicImageReader

public IlvRasterBasicImageReader()
Default constructor to create on-demand pixel JPG,TIFF,GIF or PNG images.


IlvRasterBasicImageReader

public IlvRasterBasicImageReader(IlvInputStream stream)
                          throws IlvReadFileException
Constructor to reconstruct an image reader from saved information.

Parameters:
stream - Stream to read from.
Throws:
IlvReadFileException
Method Detail

getInternalTransformation

public IlvMathTransform getInternalTransformation(int imageIndex)
Return the projection associated with the raster stored at the given index.

Specified by:
getInternalTransformation in class IlvRasterAbstractReader
Parameters:
imageIndex - The index of the raster.
Returns:
The projection that corresponds to the raster stored at the given index.
See Also:
IlvRasterAbstractReader.getInternalTransformation(int)

addMap

public boolean addMap(String file)
Adds an image to read.

Parameters:
file - file to read.
Returns:
true if image is loaded.

addMap

public boolean addMap(URL url)
Adds an image to read.

Parameters:
url - url of the image file.
Returns:
true if image is loaded.
Since:
JViews 7.5

write

public void write(IlvOutputStream stream)
           throws IOException
Writes the attributes of a persistent object.

Specified by:
write in interface IlvPersistentObject
Overrides:
write in class IlvRasterAbstractReader
Parameters:
stream - The output stream.
Throws:
IOException - thrown when an exception occurs during the write operation for this object.

reload

public void reload(IlvThreadMonitoringData monitorInfo)
Given the state of the reader (the number of images read, coverage zone,...), the purpose of this method is to recreate all images from the original source. Note : this method should not rely on the list of IlvRasterProperties of the reader as they might not be saved when the theme only is saved.

Overrides:
reload in class IlvRasterAbstractReader
Parameters:
monitorInfo - Used to update task progress.

setInternalTransformation

public void setInternalTransformation(IlvMathTransform transformation)
Specifies a mathematical transform to apply when reading the image.

Parameters:
transformation - interpolation and/or reprojection operation.

getCoordinateSystem

public IlvCoordinateSystem getCoordinateSystem()
Returns the associated coordinate system ornull if none has been set.

Returns:
The associated coordinate system.

getProperties

public IlvFeatureAttributeProperty getProperties(int imageIndex)
Returns the feature properties to be associated with the image.

Specified by:
getProperties in class IlvRasterAbstractReader
Parameters:
imageIndex - The index of the image.
Returns:
The properties to be associated with the image.
See Also:
IlvRasterAbstractReader.getProperties(int)

setImageBounds

public void setImageBounds(int imageIndex,
                           double xlon1,
                           double ylat1,
                           double xlon2,
                           double ylat2)
Sets the internal transformation to place image at specified lat/lon.

Parameters:
imageIndex -
xlon1 -
ylat1 -
xlon2 -
ylat2 -


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