public abstract class GDALImageReaderSpi extends ImageReaderSpi
GDALImageReader
s.inputTypes, STANDARD_INPUT_TYPE, writerSpiNames
extraImageMetadataFormatClassNames, extraImageMetadataFormatNames, extraStreamMetadataFormatClassNames, extraStreamMetadataFormatNames, MIMETypes, names, nativeImageMetadataFormatClassName, nativeImageMetadataFormatName, nativeStreamMetadataFormatClassName, nativeStreamMetadataFormatName, pluginClassName, suffixes, supportsStandardImageMetadataFormat, supportsStandardStreamMetadataFormat
vendorName, version
Constructor and Description |
---|
GDALImageReaderSpi(String vendorName,
String version,
String[] names,
String[] suffixes,
String[] MIMETypes,
String readerClassName,
Class<?>[] inputTypes,
String[] writerSpiNames,
boolean supportsStandardStreamMetadataFormat,
String nativeStreamMetadataFormatName,
String nativeStreamMetadataFormatClassName,
String[] extraStreamMetadataFormatNames,
String[] extraStreamMetadataFormatClassNames,
boolean supportsStandardImageMetadataFormat,
String nativeImageMetadataFormatName,
String nativeImageMetadataFormatClassName,
String[] extraImageMetadataFormatNames,
String[] extraImageMetadataFormatClassNames,
Collection<String> supportedFormats) |
Modifier and Type | Method and Description |
---|---|
boolean |
canDecodeInput(Object input)
Checks if the provided input can be decoded by the specific SPI.
|
List<String> |
getSupportedFormats()
Methods returning the formats which are supported by a plugin.
|
boolean |
isAvailable()
This method tells us if this driver is available or not.
|
protected boolean |
isDecodable(org.gdal.gdal.Dataset dataset)
Checks if the provided Dataset was opened by a Driver supporting the same
formats which are supported by the specific ImageReaderSpi.
|
void |
onRegistration(ServiceRegistry registry,
Class<?> category)
Allows to deregister GDAL based spi in case GDAL libraries are
unavailable.
|
createReaderInstance, createReaderInstance, getImageWriterSpiNames, getInputTypes, isOwnReader
getExtraImageMetadataFormatNames, getExtraStreamMetadataFormatNames, getFileSuffixes, getFormatNames, getImageMetadataFormat, getMIMETypes, getNativeImageMetadataFormatName, getNativeStreamMetadataFormatName, getPluginClassName, getStreamMetadataFormat, isStandardImageMetadataFormatSupported, isStandardStreamMetadataFormatSupported
getDescription, getVendorName, getVersion, onDeregistration
public GDALImageReaderSpi(String vendorName, String version, String[] names, String[] suffixes, String[] MIMETypes, String readerClassName, Class<?>[] inputTypes, String[] writerSpiNames, boolean supportsStandardStreamMetadataFormat, String nativeStreamMetadataFormatName, String nativeStreamMetadataFormatClassName, String[] extraStreamMetadataFormatNames, String[] extraStreamMetadataFormatClassNames, boolean supportsStandardImageMetadataFormat, String nativeImageMetadataFormatName, String nativeImageMetadataFormatClassName, String[] extraImageMetadataFormatNames, String[] extraImageMetadataFormatClassNames, Collection<String> supportedFormats)
public List<String> getSupportedFormats()
gdalinfo --formats
which lists all the supported formats.
As an instance, the result of this command may be:
VRT (rw+): Virtual Raster GTiff (rw+): GeoTIFF NITF (rw+): National
Imagery Transmission Format HFA (rw+): Erdas Imagine Images (.img)
SAR_CEOS (ro): CEOS SAR Image CEOS (ro): CEOS Image
.........................................
You need to set the String returned as the first word (as an instance:
"HFA", if you are building a plugin for the Erdas Image Images)
In some circumstances, GDAL provides more than 1 driver to manage a
specific format. As an instance, in order to handle HDF4 files, GDAL
provides two drivers: HDF4 and HDF4Image (which supports Dataset
creation). The HDF4ImageReader will be capable of manage both formats.public boolean canDecodeInput(Object input) throws IOException
getSupportedFormat abstract method.
canDecodeInput
in class ImageReaderSpi
true
if the input can be successfully decoded.IOException
protected boolean isDecodable(org.gdal.gdal.Dataset dataset)
canDecodeInput
with
a NITF file as input. GDAL will successfully open the NITF file. However,
it will use the NITF driver instead of the HDF4 driver. Since NITF is not
supported by the HDF4ImageReaderSpi, this method will return return
false
.dataset
- The input datasettrue
if the format is supported.
false
otherwise.public boolean isAvailable()
true
if the driver is available,
false
otherwise.public void onRegistration(ServiceRegistry registry, Class<?> category)
onRegistration
in interface RegisterableService
onRegistration
in class IIOServiceProvider
Copyright © 2006–2016 GeoSolutions. All rights reserved.