Class Driver
The Driver class is a binding for the C++ OGRSFDriver class.
-
Method Summary
Modifier and TypeMethodDescriptionCopyDataSource
(DataSource src_ds, String name) Creates a new datasource by copying all the layers from the source datasource.CopyDataSource
(DataSource src_ds, String name, Vector options) Creates a new datasource by copying all the layers from the source datasource.CreateDataSource
(String name) Attempt to create a new data source based on the passed driver.CreateDataSource
(String name, Vector options) Attempt to create a new data source based on the passed driver.void
delete()
Deprecated.Do not do anything...int
DeleteDataSource
(String name) Destroy a datasource.void
Remove the driver from the list of registered drivers.boolean
getName()
Fetch name of driver (file format).GetName()
Fetch name of driver (file format).int
hashCode()
Attempt to open file with this driver.Attempt to open file with this driver.void
Register()
Add a driver to the list of registered drivers.boolean
TestCapability
(String cap) Test if capability is available.Methods inherited from class org.gdal.gdal.MajorObject
GetDescription, GetMetadata_Dict, GetMetadata_Dict, GetMetadata_List, GetMetadata_List, GetMetadataDomainList, GetMetadataItem, GetMetadataItem, SetDescription, SetMetadata, SetMetadata, SetMetadata, SetMetadata, SetMetadata, SetMetadata, SetMetadataItem, SetMetadataItem
-
Method Details
-
delete
public void delete()Deprecated.Do not do anything...- Overrides:
delete
in classMajorObject
-
equals
-
hashCode
public int hashCode() -
getName
Fetch name of driver (file format).This name should be relatively short (10-40 characters), and should reflect the underlying file format. For instance "ESRI Shapefile".
- Returns:
- driver name.
-
CreateDataSource
Attempt to create a new data source based on the passed driver.The papszOptions argument can be used to control driver specific creation options. These options are normally documented in the format specific documentation.
The returned dataset should be properly closed with the DataSource.delete() method.
- Parameters:
name
- the name for the new data source.options
- a vector of strings of the format name=value. Options are driver specific, and driver information can be found at the following url: OGR Formats- Returns:
- null is returned on failure, or a new DataSource on success.
-
CreateDataSource
Attempt to create a new data source based on the passed driver.Same as below with options == null.
- Since:
- Java bindings 1.7.0
- See Also:
-
CopyDataSource
Creates a new datasource by copying all the layers from the source datasource.- Parameters:
src_ds
- source datasourcename
- the name for the new data source.options
- a vector of strings of the format name=value. Options are driver specific, and driver information can be found at the following url: OGR Formats- Returns:
- null is returned on failure, or a new DataSource on success.
-
CopyDataSource
Creates a new datasource by copying all the layers from the source datasource.Same as below with options == null.
- Since:
- Java bindings 1.7.0
- See Also:
-
Open
Attempt to open file with this driver.The returned dataset should be properly closed with the DataSource.delete() method.
- Parameters:
name
- the name of the file, or data source to try and open.update
- 1 if update access is required, otherwise 0 (the default).- Returns:
- null on error or if the pass name is not supported by this driver, otherwise a DataSource.
-
Open
Attempt to open file with this driver.Same as below with update == 0.
- Since:
- Java bindings 1.7.0
- See Also:
-
DeleteDataSource
Destroy a datasource.Destroy the named datasource. Normally it would be safest if the datasource was not open at the time.
Whether this is a supported operation on this driver case be tested using TestCapability() on ODrCDeleteDataSource.
- Parameters:
name
- the name of the datasource to delete.- Returns:
- 0 on success. Otherwise throws a RuntimeException if this is not supported by this driver (or an error code if DontUseExceptions() has been called)
-
TestCapability
Test if capability is available.One of the following data source capability names can be passed into this function, and a TRUE or FALSE value will be returned indicating whether or not the capability is available for this object.
- ODrCCreateDataSource: True if this driver can support creating data sources.
- ODrCDeleteDataSource: True if this driver supports deleting data sources.
The constant forms of the capability names should be used in preference to the strings themselves to avoid misspelling.
- Parameters:
cap
- the capability to test.- Returns:
- true if capability available otherwise false.
- ODrCCreateDataSource: True if this driver can support creating data sources.
-
GetName
Fetch name of driver (file format).This name should be relatively short (10-40 characters), and should reflect the underlying file format. For instance "ESRI Shapefile".
- Returns:
- driver name.
-
Register
public void Register()Add a driver to the list of registered drivers.If the driver is already registered (based on handle comparison) then the driver isn't registered. New drivers are added at the end of the list of registered drivers.
- Since:
- GDAL 1.8.0
-
Deregister
public void Deregister()Remove the driver from the list of registered drivers.- Since:
- GDAL 1.8.0
-