GDAL
|
Proxy for a plugin driver. More...
#include <gdal_priv.h>
Public Member Functions | |
GDALPluginDriverProxy (const std::string &osPluginFileName) | |
Constructor for a plugin driver proxy. | |
const std::string & | GetPluginFileName () const |
Return the plugin file name (not a full path) | |
CPLErr | SetMetadataItem (const char *pszName, const char *pszValue, const char *pszDomain="") override |
Set single metadata item. | |
char ** | GetMetadata (const char *pszDomain) override |
Fetch metadata. | |
const char * | GetMetadataItem (const char *pszName, const char *pszDomain="") override |
Fetch single metadata item. | |
GDALDataset * | Create (const char *pszName, int nXSize, int nYSize, int nBands, GDALDataType eType, CSLConstList papszOptions) |
Create a new dataset with this driver. | |
GDALDataset * | CreateMultiDimensional (const char *pszName, CSLConstList papszRootGroupOptions, CSLConstList papszOptions) |
Create a new multidimensional dataset with this driver. | |
CPLErr | Delete (const char *pszName) |
Delete named dataset. | |
CPLErr | Rename (const char *pszNewName, const char *pszOldName) |
Rename a dataset. | |
CPLErr | CopyFiles (const char *pszNewName, const char *pszOldName) |
Copy the files of a dataset. | |
GDALDataset * | CreateCopy (const char *, GDALDataset *, int, CSLConstList papszOptions, GDALProgressFunc pfnProgress, void *pProgressData) |
Create a copy of a dataset. | |
bool | CanVectorTranslateFrom (const char *pszDestName, GDALDataset *poSourceDS, CSLConstList papszVectorTranslateArguments, char ***ppapszFailureReasons) |
Returns whether the driver can translate from a vector dataset, using the arguments passed to GDALVectorTranslate() stored in papszVectorTranslateArguments. | |
GDALDataset * | VectorTranslateFrom (const char *pszDestName, GDALDataset *poSourceDS, CSLConstList papszVectorTranslateArguments, GDALProgressFunc pfnProgress, void *pProgressData) |
Create a copy of a vector dataset, using the arguments passed to GDALVectorTranslate() stored in papszVectorTranslateArguments. | |
int | GetMOFlags () const |
Returns the GMO_ flags. | |
void | SetMOFlags (int nFlagsIn) |
Assign GMO_flags. | |
virtual const char * | GetDescription () const |
Fetch object description. | |
virtual void | SetDescription (const char *) |
Set object description. | |
virtual char ** | GetMetadataDomainList () |
Fetch list of metadata domains. | |
virtual CPLErr | SetMetadata (char **papszMetadata, const char *pszDomain="") |
Set metadata. | |
Static Public Member Functions | |
static CPLErr | QuietDelete (const char *pszName, CSLConstList papszAllowedDrivers=nullptr) |
Delete dataset if found. | |
static GDALDriverH | ToHandle (GDALDriver *poDriver) |
Convert a GDALDriver* to a GDALDriverH. | |
static GDALMajorObjectH | ToHandle (GDALMajorObject *poMajorObject) |
Convert a GDALMajorObject* to a GDALMajorObjectH. | |
static GDALDriver * | FromHandle (GDALDriverH hDriver) |
Convert a GDALDriverH to a GDALDriver*. | |
Protected Member Functions | |
char ** | BuildMetadataDomainList (char **papszList, int bCheckNonEmpty,...) CPL_NULL_TERMINATED |
Helper function for custom implementations of GetMetadataDomainList() | |
Friends | |
class | GDALDriverManager |
Proxy for a plugin driver.
Such proxy must be registered with GDALDriverManager::DeclareDeferredPluginDriver().
If the real driver defines any of the following metadata items, the proxy driver should also define them with the same value:
The pfnIdentify and pfnGetSubdatasetInfoFunc callbacks, if they are defined in the real driver, should also be set on the proxy driver.
Furthermore, the following metadata items must be defined if the real driver sets the corresponding callback:
|
explicit |
Constructor for a plugin driver proxy.
osPluginFileName | Plugin filename. e.g "ogr_Parquet.so" |
|
protectedinherited |
Helper function for custom implementations of GetMetadataDomainList()
papszList | initial list of domains. May be NULL. Will become invalid after function call (use return value) |
bCheckNonEmpty | if TRUE, each candidate domain will be tested to be non empty |
... | NULL terminated variadic list of candidate domains. |
|
inherited |
Returns whether the driver can translate from a vector dataset, using the arguments passed to GDALVectorTranslate() stored in papszVectorTranslateArguments.
This is used to determine if the driver supports the VectorTranslateFrom() operation.
pszDestName | Target dataset name | |
poSourceDS | Source dataset | |
papszVectorTranslateArguments | Non-positional arguments passed to GDALVectorTranslate() (may be nullptr) | |
[out] | ppapszFailureReasons | nullptr, or a pointer to an null-terminated array of strings to record the reason(s) for the impossibility. |
|
inherited |
Copy the files of a dataset.
Copy all the files associated with a dataset.
Equivalent of the C function GDALCopyDatasetFiles().
pszNewName | new name for the dataset. |
pszOldName | old name for the dataset. |
|
inherited |
Create a new dataset with this driver.
What argument values are legal for particular drivers is driver specific, and there is no way to query in advance to establish legal values.
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.
After you have finished working with the returned dataset, it is required to close it with GDALClose(). This does not only close the file handle, but also ensures that all the data and metadata has been written to the dataset (GDALFlushCache() is not sufficient for that purpose).
In GDAL 2, the arguments nXSize, nYSize and nBands can be passed to 0 when creating a vector-only dataset for a compatible driver.
Equivalent of the C function GDALCreate().
pszFilename | the name of the dataset to create. UTF-8 encoded. |
nXSize | width of created raster in pixels. |
nYSize | height of created raster in pixels. |
nBands | number of bands. |
eType | type of raster. |
papszOptions | list of driver specific control parameters. The APPEND_SUBDATASET=YES option can be specified to avoid prior destruction of existing dataset. |
|
inherited |
Create a copy of a dataset.
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. So to test if CreateCopy() is available, you can test if GDAL_DCAP_CREATECOPY or GDAL_DCAP_CREATE is set in the GDAL metadata.
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.
This function copy all metadata from the default domain ("")
Even is bStrict is TRUE, only the value of the data is equivalent, but the data layout (INTERLEAVE as PIXEL/LINE/BAND) of the dst dataset is controlled by the papszOptions creation options, and may differ from the poSrcDS src dataset. Starting from GDAL 3.5, if no INTERLEAVE and COMPRESS creation option has been specified in papszOptions, and if the driver supports equivalent interleaving as the src dataset, the CreateCopy() will internally add the proper creation option to get the same data interleaving.
After you have finished working with the returned dataset, it is required to close it with GDALClose(). This does not only close the file handle, but also ensures that all the data and metadata has been written to the dataset (GDALFlushCache() is not sufficient for that purpose).
For multidimensional datasets, papszOptions can contain array creation options, if they are prefixed with "ARRAY:".
pszFilename | the name for the new dataset. UTF-8 encoded. |
poSrcDS | the dataset being duplicated. |
bStrict | TRUE if the copy must be strictly equivalent, or more normally FALSE indicating that the copy may adapt as needed for the output format. |
papszOptions | additional format dependent options controlling creation of the output file. The APPEND_SUBDATASET=YES option can be specified to avoid prior destruction of existing dataset. Starting with GDAL 3.8.0, the following options are recognized by the GTiff, COG, VRT, PNG au JPEG drivers:
|
pfnProgress | a function to be used to report progress of the copy. |
pProgressData | application data passed into progress function. |
|
inherited |
Create a new multidimensional dataset with this driver.
Only drivers that advertise the GDAL_DCAP_MULTIDIM_RASTER capability and implement the pfnCreateMultiDimensional method might return a non nullptr GDALDataset.
This is the same as the C function GDALCreateMultiDimensional().
pszFilename | the name of the dataset to create. UTF-8 encoded. |
papszRootGroupOptions | driver specific options regarding the creation of the root group. Might be nullptr. |
papszOptions | driver specific options regarding the creation of the dataset. Might be nullptr. |
|
inherited |
Delete named dataset.
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 all the files that are returned by GDALGetFileList() on the dataset handle.
It is unwise to have open dataset handles on this dataset when it is deleted.
Equivalent of the C function GDALDeleteDataset().
pszFilename | name of dataset to delete. |
|
inlinestaticinherited |
Convert a GDALDriverH to a GDALDriver*.
|
virtualinherited |
Fetch object description.
The semantics of the returned description are specific to the derived type. For GDALDatasets it is the dataset name. For GDALRasterBands it is actually a description (if supported) or "".
This method is the same as the C function GDALGetDescription().
|
overridevirtual |
Fetch metadata.
The returned string list is owned by the object, and may change at any time. It is formatted as a "Name=value" list with the last pointer value being NULL. Use the CPL StringList functions such as CSLFetchNameValue() to manipulate it.
Note that relatively few formats return any metadata at this time.
This method does the same thing as the C function GDALGetMetadata().
pszDomain | the domain of interest. Use "" or NULL for the default domain. |
Reimplemented from GDALMajorObject.
|
virtualinherited |
Fetch list of metadata domains.
The returned string list is the list of (non-empty) metadata domains.
This method does the same thing as the C function GDALGetMetadataDomainList().
Reimplemented in GDALDataset.
|
overridevirtual |
Fetch single metadata item.
The C function GDALGetMetadataItem() does the same thing as this method.
pszName | the key for the metadata item to fetch. |
pszDomain | the domain to fetch for, use NULL for the default domain. |
Reimplemented from GDALMajorObject.
|
inherited |
Returns the GMO_ flags.
|
staticinherited |
Delete dataset if found.
This is a helper method primarily used by Create() and CreateCopy() to predelete any dataset of the name soon to be created. It will attempt to delete the named dataset if one is found, otherwise it does nothing. An error is only returned if the dataset is found but the delete fails.
This is a static method and it doesn't matter what driver instance it is invoked on. It will attempt to discover the correct driver using Identify().
pszName | the dataset name to try and delete. |
papszAllowedDrivers | NULL to consider all candidate drivers, or a NULL terminated list of strings with the driver short names that must be considered. (Note: implemented only starting with GDAL 3.4.1) |
|
inherited |
Rename a dataset.
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.
Equivalent of the C function GDALRenameDataset().
pszNewName | new name for the dataset. |
pszOldName | old name for the dataset. |
|
virtualinherited |
Set object description.
The semantics of the description are specific to the derived type. For GDALDatasets it is the dataset name. For GDALRasterBands it is actually a description (if supported) or "".
Normally application code should not set the "description" for GDALDatasets. It is handled internally.
This method is the same as the C function GDALSetDescription().
Reimplemented in GDALPamRasterBand.
|
virtualinherited |
Set metadata.
The C function GDALSetMetadata() does the same thing as this method.
papszMetadataIn | the metadata in name=value string list format to apply. |
pszDomain | the domain of interest. Use "" or NULL for the default domain. |
Reimplemented in GDALDataset, GDALRasterBand, GDALPamDataset, and GDALPamRasterBand.
|
overridevirtual |
Set single metadata item.
The C function GDALSetMetadataItem() does the same thing as this method.
pszName | the key for the metadata item to fetch. |
pszValue | the value to assign to the key. |
pszDomain | the domain to set within, use NULL for the default domain. |
Reimplemented from GDALDriver.
|
inherited |
Assign GMO_flags.
nNewFlags | new flags. |
|
inlinestaticinherited |
Convert a GDALDriver* to a GDALDriverH.
|
inlinestaticinherited |
Convert a GDALMajorObject* to a GDALMajorObjectH.
|
inherited |
Create a copy of a vector dataset, using the arguments passed to GDALVectorTranslate() stored in papszVectorTranslateArguments.
This may be implemented by some drivers that can convert from an existing dataset in an optimized way.
This is for example used by the PMTiles to convert from MBTiles.
pszDestName | Target dataset name |
poSourceDS | Source dataset |
papszVectorTranslateArguments | Non-positional arguments passed to GDALVectorTranslate() (may be nullptr) |
pfnProgress | a function to be used to report progress of the copy. |
pProgressData | application data passed into progress function. |