|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
ObjectImageReader
SpatialImageReader
ImageReaderAdapter
WorldFileImageReader
public class WorldFileImageReader
Reader for the World File format. This reader wraps an other image reader
for an "ordinary" image format, like TIFF, PNG or JPEG. This WorldFileImageReader
delegates the reading of pixel values to the wrapped reader, and additionally looks for
two small text files in the same directory than the image file, with the same filename
but a different extension:
A text file containing the coefficients of the affine transform mapping pixel
coordinates to geodesic coordinates. The reader expects one coefficient per line,
in the same order than the one expected by the
AffineTransform(double[])
constructor, which is scaleX, shearY, shearX,
scaleY, translateX, translateY.
This reader looks for a file having the following extensions, in preference order:
'w'. Example: "tfw" for
"tiff" images, and "jgw" for "jpeg" images.'w' appended."tfw extension.A text file containing the Coordinate Reference System (CRS)
definition in Well Known Text (WKT) syntax. This reader looks
for a file having the ".prj" extension.
WorldFileImageWriter
| coverage/geotk-coverageio (download) | View source code for this class |
| Nested Class Summary | |
|---|---|
static class |
WorldFileImageReader.Spi
Service provider interface (SPI) for WorldFileImageReaders. |
| Field Summary |
|---|
| Fields inherited from class ImageReaderAdapter |
|---|
main |
| Fields inherited from class ImageReader |
|---|
availableLocales, ignoreMetadata, input, locale, minIndex, originatingProvider, progressListeners, seekForwardOnly, updateListeners, warningListeners, warningLocales |
| Fields inherited from interface WarningProducer |
|---|
LOGGER |
| Constructor Summary | |
|---|---|
WorldFileImageReader(WorldFileImageReader.Spi provider)
Constructs a new image reader. |
|
WorldFileImageReader(WorldFileImageReader.Spi provider,
ImageReader main)
Constructs a new image reader wrapping the given reader. |
|
| Method Summary | |
|---|---|
protected void |
close()
Closes the input streams created by this reader. |
protected Object |
createInput(String readerID)
Creates the input to be given to the reader identified by the given argument. |
protected SpatialMetadata |
createMetadata(int imageIndex)
Creates a new stream or image metadata. |
| Methods inherited from class SpatialImageReader |
|---|
checkBandIndex, checkImageIndex, collapseNoDataValues, getDestination, getImageType, getRawDataType, setInput, warningOccurred |
| Methods inherited from class Object |
|---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public WorldFileImageReader(WorldFileImageReader.Spi provider)
throws IOException
provider - The ImageReaderSpi that is constructing this object.
IOException - If an error occurred while creating the main reader.
public WorldFileImageReader(WorldFileImageReader.Spi provider,
ImageReader main)
provider - The ImageReaderSpi that is constructing this object, or null.main - The reader to use for reading the pixel values.| Method Detail |
|---|
protected Object createInput(String readerID)
throws IOException
readerID argument is "main" (ignoring case), then this method delegates
to the super-class method. Otherwise
this method returns an input which is typically a File or URL
having the same name than the input of this reader, but a different
extension. The new extension is determined from the readerID argument, which can
be:
"tfw" for the World File. The extension of the returned
input may be "tfw" (most common), "jgw", "pgw" or other
suffix depending on the extension of this reader input, and
depending which file has been determined to exist. See the
class javadoc for more details.
"prj" for Map Projection file. The extension
of the returned input is "prj".
"main"),
World File ("tfw") or Map Projection ("prj")
input. They can also invoke this method with other identifiers than the three above-cited
ones, in which case this method uses the given identifier as the extension of the returned
input. However the default WorldFileImageReader implementation uses only
"main", "tfw" and "prj".
createInput in class ImageReaderAdapterreaderID - "main" for the main input,
"tfw" for the World File input, or
"prj" for the Map Projection input. Other
identifiers are allowed but subclass-specific.
File or URL
object, or null if there is no input for the given identifier.
IOException - If an error occurred while creating the input.WorldFileImageWriter.createOutput(String)
protected SpatialMetadata createMetadata(int imageIndex)
throws IOException
The World File and Map Projection files are determined by calls
to the createInput(String) method with "tfw" and "prj" argument
values. Subclasses can override the later method if they want to specify different files
to be read.
createMetadata in class ImageReaderAdapterimageIndex - -1 for stream metadata, or the image index for image metadata.
null if none.
IOException - If an error occurred while reading metadata.
protected void close()
throws IOException
close in class ImageReaderAdapterIOException - if an error occurred while closing the stream.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||