Class GDALStoreProvider
Object
DataStoreProvider
GDALStoreProvider
The provider of
GDALStore instances.
Given a StorageConnector input, this class tries to instantiate a GDALStore.
This data store uses the GDAL native library for loading data.
Each GDALStoreProvider instance is linked to a GDAL library specified
at construction time, or to a JVM-wide shared GDAL library if the
no-argument constructor is used. In the non-shared case, GDAL will be unloaded
when this GDALStoreProvider instance is garbage collected.
- Since:
- 1.5
-
Nested Class Summary
Nested classes/interfaces inherited from class DataStoreProvider
DataStoreProvider.Prober<S>Modifier and TypeClassDescriptionprotected static interfaceAn action to execute for testing if aStorageConnectorinput can be read. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final OptionKey<String[]> Key for declaring GDAL drivers that may be used for opening the file.Fields inherited from class DataStoreProvider
CREATE, LOCATION -
Constructor Summary
ConstructorsConstructorDescriptionCreates a new provider which will load the GDAL library from the default library path. -
Method Summary
Modifier and TypeMethodDescriptionReturns the GDAL version number together with the list of drivers.Returns an unmodifiable list of all GDAL drivers currently available.Returns the logger used by GDAL stores.Returns a description of all parameters accepted by this provider for opening a file with GDAL.Returns the release date of the GDAL library.Returns a generic name for this data store, used mostly in warnings or error messages.Returns the version number of the GDAL library.open(StorageConnector connector) Creates aGDALStoreinstance associated with this provider.open(ParameterValueGroup parameters) Creates aGDALStoreinstance from the given parameters.probeContent(StorageConnector connector) Returns the MIME type if the given storage appears to be supported by this data store.static GDALStoreProviderprovider()Returns a provider which will load the GDAL library from the default library path.static GDALStoreProviderCreates a new provider which will load the GDAL library from the specified file.Methods inherited from class DataStoreProvider
getFormat, getSupportedVersions, probeContentModifier and TypeMethodDescriptionReturns a description of the data format.Returns the range of versions supported by the data store, ornullif unspecified.protected <S> ProbeResultprobeContent(StorageConnector connector, Class<S> type, DataStoreProvider.Prober<? super S> prober) Applies the specified test on the storage content without modifying buffer or input stream position.
-
Field Details
-
DRIVERS_OPTION_KEY
Key for declaring GDAL drivers that may be used for opening the file. Drivers are identified by their short names. The drivers will be tested in the order they are specified.- See Also:
-
-
Constructor Details
-
GDALStoreProvider
Creates a new provider which will load the GDAL library from the default library path.This constructor is public for compatibility with usage of SIS on the class-path. It may become protected in a future version of Apache SIS, if the use of module-path become mandatory.
- Throws:
DataStoreException- if the GDAL library has not been found or if this Apache SIS module is not authorized to call native methods.- See Also:
-
-
Method Details
-
provider
Returns a provider which will load the GDAL library from the default library path. If the GDAL library is not found on the library path, then this method searches in the libraries loaded withSystem.loadLibrary(String)RESTRICTED.- Returns:
- the default data store provider using the GDAL library.
- Throws:
DataStoreException- if the GDAL library has not been found or if this Apache SIS module is not authorized to call native methods.- Since:
- 1.7
-
provider
Creates a new provider which will load the GDAL library from the specified file. This method may return an existing provider previously created for the same path. When the returned provider will be garbage collected, the following cleanup actions will be performed:- The
GDALDestroynative function will be invoked if thisGDALStoreProviderinstance was the last one using the specified library. - Then the library will be unloaded. Note that the OS may keep the library
in memory if it is still used by another
GDALStoreProviderinstance.
- Parameters:
library- path to the library to load.- Returns:
- data store provider using the GDAL library at the given type.
- Throws:
DataStoreException- if the GDAL library has not been found or if this Apache SIS module is not authorized to call native methods.- Since:
- 1.7
- The
-
getShortName
Returns a generic name for this data store, used mostly in warnings or error messages.- Specified by:
getShortNamein classDataStoreProvider- Returns:
- a short name or abbreviation for the data store.
- See Also:
-
getVersion
-
getReleaseDate
-
getDrivers
-
configuration
Returns the GDAL version number together with the list of drivers. The GDAL version is in the root node, and drivers are listed as children. The table contains the following columns:-
for the value returned by
invalid reference
TableColumn#NAME.invalid reference
#getName() -
for the value returned by
invalid reference
TableColumn#IDENTIFIER.invalid reference
#getIdentifier()
- Returns:
- a table of available GDAL drivers.
- Throws:
DataStoreException- if an error occurred while querying GDAL metadata.
-
-
getOpenParameters
Returns a description of all parameters accepted by this provider for opening a file with GDAL.- Specified by:
getOpenParametersin classDataStoreProvider- Returns:
- description of available parameters for opening a file with GDAL.
- See Also:
-
probeContent
Returns the MIME type if the given storage appears to be supported by this data store. A supported status does not guarantee that reading or writing will succeed, only that there appears to be a reasonable chance according GDAL.- Specified by:
probeContentin classDataStoreProvider- Parameters:
connector- information about the storage (URL, stream, etc).- Returns:
- a supported status with the MIME type
if the given storage seems to be readable by
GDALStoreinstances. - Throws:
DataStoreException- if an I/O error occurred.
-
open
Creates aGDALStoreinstance associated with this provider.- Specified by:
openin classDataStoreProvider- Parameters:
connector- information about the storage (URL, stream, etc).- Returns:
- a data store implementation associated with this provider for the given storage.
- Throws:
DataStoreException- if an error occurred while creating the data store instance.- See Also:
-
open
Creates aGDALStoreinstance from the given parameters.- Overrides:
openin classDataStoreProvider- Parameters:
parameters- opening parameters as defined bygetOpenParameters().- Returns:
- a data store instance associated with this provider for the given parameters.
- Throws:
DataStoreException- if an error occurred while creating the data store instance.- See Also:
-
getLogger
Returns the logger used by GDAL stores.- Overrides:
getLoggerin classDataStoreProvider- Returns:
- the logger to use as a fallback (when there are no listeners) for warning messages.
- See Also:
-