Package gov.nasa.worldwind.data
Class BasicDataRasterReaderFactory
- java.lang.Object
-
- gov.nasa.worldwind.data.BasicDataRasterReaderFactory
-
- All Implemented Interfaces:
DataRasterReaderFactory
public class BasicDataRasterReaderFactory extends java.lang.Object implements DataRasterReaderFactory
Implements aDataRasterReaderFactory
with a default list of readers. The list includes the following readers:RPFRasterReader
DTEDRasterReader
GDALDataRasterReader
GeotiffRasterReader
BILRasterReader
ImageIORasterReader
To specify a different factory, set the
AVKey.DATA_RASTER_READER_FACTORY_CLASS_NAME
value inConfiguration
, either directly or via the WorldWind configuration file. To add readers to the default set, create a subclass of this class, overridefindReaderFor(Object, gov.nasa.worldwind.avlist.AVList)
, and specify the new class to the configuration.
-
-
Field Summary
Fields Modifier and Type Field Description protected DataRasterReader[]
readers
The default list of readers.
-
Constructor Summary
Constructors Constructor Description BasicDataRasterReaderFactory()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DataRasterReader
findReaderFor(java.lang.Object source, AVList params)
Search the list of available data raster readers for one that will read a specified data source.DataRasterReader
findReaderFor(java.lang.Object source, AVList params, DataRasterReader[] readers)
Search a specified list of data raster readers for one that will read a specified data source.DataRasterReader[]
getReaders()
Returns this class' list of readers.
-
-
-
Field Detail
-
readers
protected DataRasterReader[] readers
The default list of readers.
-
-
Method Detail
-
getReaders
public DataRasterReader[] getReaders()
Returns this class' list of readers.- Specified by:
getReaders
in interfaceDataRasterReaderFactory
- Returns:
- the list of readers.
-
findReaderFor
public DataRasterReader findReaderFor(java.lang.Object source, AVList params)
Search the list of available data raster readers for one that will read a specified data source. The determination is based on both the data type and the data source reference; some readers may be able to open data of the corresponding type but not as, for example, an InputStream or a URL.The list of readers searched is determined by the DataRasterReaderFactory associated with the current
Configuration
, as specified by theAVKey.DATA_RASTER_READER_FACTORY_CLASS_NAME
. If no factory is specified in the configuration,BasicDataRasterReaderFactory
is used.- Specified by:
findReaderFor
in interfaceDataRasterReaderFactory
- Parameters:
source
- the source to read. May by aFile
, a file path, a URL or anInputStream
.params
- optional metadata associated with the data source that might be useful in determining the data reader. TODO: How does the caller determine which parameters are necessary or useful?- Returns:
- a data reader for the specified source, or null if no reader can be found.
-
findReaderFor
public DataRasterReader findReaderFor(java.lang.Object source, AVList params, DataRasterReader[] readers)
Search a specified list of data raster readers for one that will read a specified data source. The determination is based on both the data type and the data source reference; some readers may be able to open data of the corresponding type but not as, for example, an InputStream or a URL.- Specified by:
findReaderFor
in interfaceDataRasterReaderFactory
- Parameters:
source
- the source to read. May by aFile
, a file path, a URL or anInputStream
.params
- optional metadata associated with the data source that might be useful in determining the data reader.readers
- the list of readers to search.- Returns:
- a data reader for the specified source, or null if no reader can be found.
-
-