|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
ObjectTileManager
@ThreadSafe public abstract class TileManager
A collection of Tile objects to be given to MosaicImageReader. This base
class does not assume that the tiles are arranged in any particular order (especially grids).
But subclasses can make such assumption for better performances.
| coverage/geotk-coverageio (download) | View source code for this class |
| Field Summary | |
|---|---|
static String |
SERIALIZED_FILENAME
The default name of the filename containing a serialized form of a TileManager
instance. |
| Constructor Summary | |
|---|---|
protected |
TileManager()
Creates a tile manager. |
| Method Summary | |
|---|---|
Tile |
createGlobalTile(ImageReaderSpi provider,
Object input,
int imageIndex)
Creates a tile with a region big enough for containing every tiles. |
ImageGeometry |
getGridGeometry()
Returns the grid geometry, including the "grid to real world" transform. |
Set<ImageReaderSpi> |
getImageReaderSpis()
Returns all image reader providers used by the tiles. |
abstract Collection<Tile> |
getTiles()
Returns all tiles. |
abstract Collection<Tile> |
getTiles(Rectangle region,
Dimension subsampling,
boolean subsamplingChangeAllowed)
Returns every tiles that intersect the given region. |
boolean |
intersects(Rectangle region,
Dimension subsampling)
Returns true if at least one tile having the given subsampling or a finer
one intersects the given region. |
void |
printErrors(PrintWriter out)
Checks for file existence and image size of every tiles and reports any error found. |
void |
setGridToCRS(AffineTransform gridToCRS)
Sets the grid to CRS transform for every tiles. |
String |
toString()
Returns a string representation of this tile manager. |
| Methods inherited from class Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final String SERIALIZED_FILENAME
TileManager
instance. Files of this name can be created and loaded by various Geotk module, for
example geotk-coverage-sql and geotk-wizards-swing.
| Constructor Detail |
|---|
protected TileManager()
| Method Detail |
|---|
public void setGridToCRS(AffineTransform gridToCRS)
throws IllegalStateException,
IOException
The grid to CRS transform is not necessary for proper working of mosaic image reader, but is provided as a convenience for users.
This method can be invoked at most once. It can not be invoked at all if the transform
has been automatically invoked by TileManagerFactory.
gridToCRS - The "grid to real world" transform mapping
pixel upper left corner.
IllegalStateException - if a transform was already assigned to at least one tile.
IOException - If an I/O operation was required and failed.
public ImageGeometry getGridGeometry()
throws IOException
Note that the grid to CRS transform of the returned geometry maps pixel upper left corner. This is different than OGC practice which maps pixel center, but is consistent with Java2D practice for which this class is designed.
null if this information is not available.
IOException - If an I/O operation was required and failed.Tile.getGridToCRS()
public Set<ImageReaderSpi> getImageReaderSpis()
throws IOException
null).
IOException - If an I/O operation was required and failed.MosaicImageReader.getTileReaderSpis()
public Tile createGlobalTile(ImageReaderSpi provider,
Object input,
int imageIndex)
throws NoSuchElementException,
IOException
provider - The image reader provider to be given to the created tile, or null for
inferring it automatically. In the later case the provider is inferred from the
input suffix if any (e.g. the ".png" extension in a filename), or
failing that the most frequently used provider is selected.input - The input to be given to the created tile. It doesn't need to be an existing
file or URI since this method will not attempt to
read it.imageIndex - The image index to be given to the created tile (usually 0).
NoSuchElementException - If this manager do not contains at least one tile.
IOException - If an I/O operation was required and failed.
public abstract Collection<Tile> getTiles()
throws IOException
IOException - If an I/O operation was required and failed.
public abstract Collection<Tile> getTiles(Rectangle region,
Dimension subsampling,
boolean subsamplingChangeAllowed)
throws IOException
region - The region of interest (shall not be null).subsampling - On input, the number of source columns and rows to advance for each pixel. On
output, the effective values to use. Those values may be different only if
subsamplingChangeAllowed is true.subsamplingChangeAllowed - If true, this method is allowed to replace subsampling by the
highest subsampling that overviews can handle, not greater than the given
subsampling.
null.
IOException - If it was necessary to fetch an image dimension from its
reader and this operation failed.
public boolean intersects(Rectangle region,
Dimension subsampling)
throws IOException
true if at least one tile having the given subsampling or a finer
one intersects the given region. The default implementation returns true if
getTiles(region, subsampling, false)
returns a non-empty set. Subclasses are encouraged to provide a more efficient implementation.
region - The region of interest (shall not be null).subsampling - The maximal subsampling to look for.
true if at least one tile having the given subsampling or a finer one
intersects the given region.
IOException - If it was necessary to fetch an image dimension from its
reader and this operation failed.public void printErrors(PrintWriter out)
out - Where to report errors (null for default, which is the
standard output stream).public String toString()
toString in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||