public class Driver extends Object
The Driver class is a binding for the C++ OGRSFDriver class.
Modifier and Type | Method and Description |
---|---|
DataSource |
CopyDataSource(DataSource src_ds,
String name)
Creates a new datasource by copying all the layers from the
source datasource.
|
DataSource |
CopyDataSource(DataSource src_ds,
String name,
Vector options)
Creates a new datasource by copying all the layers from the
source datasource.
|
DataSource |
CreateDataSource(String name)
Attempt to create a new data source based on the passed driver.
|
DataSource |
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 |
Deregister()
Remove the driver from the list of registered drivers.
|
boolean |
equals(Object obj) |
String |
getName()
Fetch name of driver (file format).
|
String |
GetName()
Fetch name of driver (file format).
|
int |
hashCode() |
DataSource |
Open(String name)
Attempt to open file with this driver.
|
DataSource |
Open(String name,
int update)
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.
|
public void delete()
public String getName()
This name should be relatively short (10-40 characters), and should reflect the underlying file format. For instance "ESRI Shapefile".
public DataSource CreateDataSource(String name, Vector options)
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.
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 Formatspublic DataSource CreateDataSource(String name)
Same as below with options == null.
CreateDataSource(String name, java.util.Vector options)
public DataSource CopyDataSource(DataSource src_ds, String name, Vector options)
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 Formatspublic DataSource CopyDataSource(DataSource src_ds, String name)
Same as below with options == null.
CreateDataSource(String name, java.util.Vector options)
public DataSource Open(String name, int update)
The returned dataset should be properly closed with the DataSource.delete() method.
name
- the name of the file, or data source to try and open.update
- 1 if update access is required, otherwise 0 (the
default).public DataSource Open(String name)
Same as below with update == 0.
Open(String name, int update)
public int DeleteDataSource(String name)
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.
name
- the name of the datasource to delete.public boolean TestCapability(String cap)
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.
The constant forms of the capability names should be used in preference to the strings themselves to avoid mispelling.
cap
- the capability to test.public String GetName()
This name should be relatively short (10-40 characters), and should reflect the underlying file format. For instance "ESRI Shapefile".
public void Register()
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.
public void Deregister()