public class Driver extends MajorObject
The Driver class is a binding for the C++ GDALDriver class.
An instance of this class is created for each supported format, and manages information about the format. This roughly corresponds to a file format, though some drivers may be gateways to many formats through a secondary multi-library.
Drivers are loaded and registered with the gdal.AllRegister() method
Modifier and Type | Method | Description |
---|---|---|
int |
CopyFiles(java.lang.String newName,
java.lang.String oldName) |
|
Dataset |
Create(java.lang.String name,
int xsize,
int ysize) |
Create a new dataset with this driver.
|
Dataset |
Create(java.lang.String name,
int xsize,
int ysize,
int nBands) |
Create a new dataset with this driver.
|
Dataset |
Create(java.lang.String name,
int xsize,
int ysize,
int nBands,
int eType) |
Create a new dataset with this driver.
|
Dataset |
Create(java.lang.String name,
int xsize,
int ysize,
int nBands,
int eType,
java.lang.String[] options) |
Create a new dataset with this driver.
|
Dataset |
Create(java.lang.String name,
int xsize,
int ysize,
int nBands,
int eType,
java.util.Vector options) |
Create a new dataset with this driver.
|
Dataset |
Create(java.lang.String name,
int xsize,
int ysize,
int nBands,
java.lang.String[] options) |
Create a new dataset with this driver.
|
Dataset |
CreateCopy(java.lang.String name,
Dataset src_ds) |
Create a copy of a dataset.
|
Dataset |
CreateCopy(java.lang.String name,
Dataset src_ds,
int strict) |
Create a copy of a dataset.
|
Dataset |
CreateCopy(java.lang.String name,
Dataset src_ds,
int strict,
java.lang.String[] options) |
Create a copy of a dataset.
|
Dataset |
CreateCopy(java.lang.String name,
Dataset src_ds,
int strict,
java.util.Vector options) |
Create a copy of a dataset.
|
Dataset |
CreateCopy(java.lang.String name,
Dataset src_ds,
int strict,
java.util.Vector options,
ProgressCallback callback) |
Create a copy of a dataset.
|
Dataset |
CreateCopy(java.lang.String name,
Dataset src_ds,
java.lang.String[] options) |
Create a copy of a dataset.
|
Dataset |
CreateCopy(java.lang.String name,
Dataset src_ds,
java.util.Vector options) |
Create a copy of a dataset.
|
Dataset |
CreateMultiDimensional(java.lang.String utf8_path) |
|
Dataset |
CreateMultiDimensional(java.lang.String utf8_path,
java.util.Vector root_group_options) |
|
Dataset |
CreateMultiDimensional(java.lang.String utf8_path,
java.util.Vector root_group_options,
java.util.Vector options) |
|
void |
delete() |
Deprecated.
Do not do anything...
|
int |
Delete(java.lang.String name) |
Delete named dataset.
|
void |
Deregister() |
Deregister the driver.
|
java.lang.String |
getHelpTopic() |
Return the URL to the help that describes the driver.
|
java.lang.String |
getLongName() |
Return the long name of a driver.
|
java.lang.String |
getShortName() |
Return the short name of a driver.
|
int |
Register() |
Register a driver for use.
|
int |
Rename(java.lang.String newName,
java.lang.String oldName) |
Rename a dataset.
|
GetDescription, GetMetadata_Dict, GetMetadata_Dict, GetMetadata_List, GetMetadata_List, GetMetadataDomainList, GetMetadataItem, GetMetadataItem, SetDescription, SetMetadata, SetMetadata, SetMetadata, SetMetadata, SetMetadata, SetMetadata, SetMetadataItem, SetMetadataItem
public void delete()
delete
in class MajorObject
public Dataset Create(java.lang.String name, int xsize, int ysize, int nBands, int eType, java.lang.String[] options)
What argument values are legal for particular drivers is driver specific, and there is no way to query in advance to establish legal values (except querying driver.GetMetadataItem(gdalconst.DMD_CREATIONOPTIONLIST)
That function will try to validate the creation option list passed to the driver with the GDALValidateCreationOptions() method. This check can be disabled by defining the configuration option GDAL_VALIDATE_CREATION_OPTIONS=NO.
At the end of dataset manipulation, the delete() method must be called on the returned dataset otherwise data might not be properly flushed to the disk.
name
- the name of the dataset to create.xsize
- width of created raster in pixels.ysize
- height of created raster in pixels.nBands
- number of bands.eType
- type of raster.options
- list of driver specific control parameters (may be null)public Dataset Create(java.lang.String name, int xsize, int ysize, int nBands, java.lang.String[] options)
Same as below with eType == gdalconst.GDT_Byte
Create(String name, int xsize, int ysize, int nBands, int eType, String[] options)
public Dataset CreateCopy(java.lang.String name, Dataset src_ds, int strict, java.lang.String[] options)
Same as below with callback == null and options as an array of strings
public Dataset CreateCopy(java.lang.String name, Dataset src_ds, java.util.Vector options)
Same as below with strict == 1 and callback == null
CreateCopy(String name, Dataset src_ds, int strict, java.util.Vector options, ProgressCallback callback)
public Dataset CreateCopy(java.lang.String name, Dataset src_ds, java.lang.String[] options)
Same as below with strict == 1, callback == null and options as an array of strings
CreateCopy(String name, Dataset src_ds, int strict, java.util.Vector options, ProgressCallback callback)
public java.lang.String getShortName()
This is the string that can be passed to the GDALGetDriverByName() function.
For the GeoTIFF driver, this is "GTiff"
public java.lang.String getLongName()
For the GeoTIFF driver, this is "GeoTIFF"
public java.lang.String getHelpTopic()
That URL is relative to the GDAL documentation directory.
For the GeoTIFF driver, this is "frmt_gtiff.html"
public Dataset Create(java.lang.String name, int xsize, int ysize, int nBands, int eType, java.util.Vector options)
Same as below but options are passed as a Vector of String.
public Dataset Create(java.lang.String name, int xsize, int ysize, int nBands, int eType)
Same as below with options == null
Create(String name, int xsize, int ysize, int nBands, int eType, String[] options)
public Dataset Create(java.lang.String name, int xsize, int ysize, int nBands)
Same as below with eType == gdalconst.GDT_Byte and options == null
Create(String name, int xsize, int ysize, int nBands, int eType, String[] options)
public Dataset Create(java.lang.String name, int xsize, int ysize)
Same as below with nbands == 1, eType == gdalconst.GDT_Byte and options == null
Create(String name, int xsize, int ysize, int nBands, int eType, String[] options)
public Dataset CreateMultiDimensional(java.lang.String utf8_path, java.util.Vector root_group_options, java.util.Vector options)
public Dataset CreateMultiDimensional(java.lang.String utf8_path, java.util.Vector root_group_options)
public Dataset CreateMultiDimensional(java.lang.String utf8_path)
public Dataset CreateCopy(java.lang.String name, Dataset src_ds, int strict, java.util.Vector options, ProgressCallback callback)
This method will attempt to create a copy of a raster dataset with the indicated filename, and in this drivers format. Band number, size, type, projection, geotransform and so forth are all to be copied from the provided template dataset.
Note that many sequential write once formats (such as JPEG and PNG) don't implement the Create() method but do implement this CreateCopy() method. If the driver doesn't implement CreateCopy(), but does implement Create() then the default CreateCopy() mechanism built on calling Create() will be used.
It is intended that CreateCopy() will often be used with a source dataset which is a virtual dataset allowing configuration of band types, and other information without actually duplicating raster data (see the VRT driver). This is what is done by the gdal_translate utility for example.
That function will try to validate the creation option list passed to the driver with the GDALValidateCreationOptions() method. This check can be disabled by defining the configuration option GDAL_VALIDATE_CREATION_OPTIONS=NO.
At the end of dataset manipulation, the delete() method must be called on the returned dataset otherwise data might not be properly flushed to the disk.
name
- the name for the new dataset.src_ds
- the dataset being duplicated.strict
- 1 if the copy must be strictly equivalent, or more
normally 0 indicating that the copy may adapt as needed for the
output format.options
- additional format dependent options controlling
creation of the output file.callback
- for reporting algorithm progress. May be nullpublic Dataset CreateCopy(java.lang.String name, Dataset src_ds, int strict, java.util.Vector options)
Same as below with callback == null
public Dataset CreateCopy(java.lang.String name, Dataset src_ds, int strict)
Same as below with options == null and callback == null
CreateCopy(String name, Dataset src_ds, int strict, java.util.Vector options, ProgressCallback callback)
public Dataset CreateCopy(java.lang.String name, Dataset src_ds)
Same as below with strict == 1, options == null and callback == null
CreateCopy(String name, Dataset src_ds, int strict, java.util.Vector options, ProgressCallback callback)
public int Delete(java.lang.String name)
The driver will attempt to delete the named dataset in a driver specific fashion. Full featured drivers will delete all associated files, database objects, or whatever is appropriate. The default behavior when no driver specific behavior is provided is to attempt to delete the passed name as a single file.
It is unwise to have open dataset handles on this dataset when it is deleted.
name
- name of dataset to delete.public int Rename(java.lang.String newName, java.lang.String oldName)
Rename a dataset. This may including moving the dataset to a new directory or even a new filesystem.
It is unwise to have open dataset handles on this dataset when it is being renamed.
newName
- new name for the dataset.oldName
- old name for the dataset.public int CopyFiles(java.lang.String newName, java.lang.String oldName)
public int Register()
Normally this method is used by format specific C callable registration entry points such as GDALRegister_GTiff() rather than being called directly by application level code.
If this driver is already registered, then no change is made, and the index of the existing driver is returned. Otherwise the driver list is extended, and the new driver is added at the end.
public void Deregister()