GDAL
Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
GNMGenericNetwork Class Referenceabstract

GNM class which represents a geography network of generic format. More...

#include <gnm.h>

Inheritance diagram for GNMGenericNetwork:
GNMNetwork GDALDataset GDALMajorObject

Public Member Functions

virtual int GetLayerCount () override
 Get the number of layers in this dataset. More...
 
virtual OGRLayerGetLayer (int) override
 Fetch a layer by index. More...
 
virtual OGRErr DeleteLayer (int) override
 Delete the indicated layer from the datasource. More...
 
virtual int TestCapability (const char *) override
 Test if capability is available. More...
 
virtual OGRLayerCopyLayer (OGRLayer *poSrcLayer, const char *pszNewName, char **papszOptions=nullptr) override
 Duplicate an existing layer. More...
 
virtual int CloseDependentDatasets () override
 Drop references to any other datasets referenced by this dataset. More...
 
virtual void FlushCache (bool bAtClosing) override
 Flush all write cached data to disk. More...
 
virtual CPLErr Create (const char *pszFilename, char **papszOptions) override=0
 Create network system layers. More...
 
virtual CPLErr Delete () override
 Delete network. More...
 
virtual int GetVersion () const override
 GetVersion return the network version if applicable. More...
 
virtual GNMGFID GetNewGlobalFID ()
 GetNewGlobalFID increase the global ID counter. More...
 
virtual CPLString GetAlgorithmName (GNMDirection eAlgorithm, bool bShortName)
 Get the algorithm name. More...
 
virtual CPLErr AddFeatureGlobalFID (GNMGFID nFID, const char *pszLayerName)
 AddFeatureGlobalFID add the FID <-> Layer name link to fast access features by global FID. More...
 
virtual CPLErr ConnectFeatures (GNMGFID nSrcFID, GNMGFID nTgtFID, GNMGFID nConFID=-1, double dfCost=1, double dfInvCost=1, GNMDirection eDir=GNM_EDGE_DIR_BOTH)
 Connects two features via third feature (may be virtual, so the identificator should be -1). More...
 
virtual CPLErr DisconnectFeatures (GNMGFID nSrcFID, GNMGFID nTgtFID, GNMGFID nConFID)
 Remove features connection. More...
 
virtual CPLErr DisconnectFeaturesWithId (GNMGFID nFID)
 Find the corresponding identificator in graph (source, target, connector) and remove such connections. More...
 
virtual CPLErr ReconnectFeatures (GNMGFID nSrcFID, GNMGFID nTgtFID, GNMGFID nConFID, double dfCost=1, double dfInvCost=1, GNMDirection eDir=GNM_EDGE_DIR_BOTH)
 Change connection attributes. More...
 
virtual CPLErr DisconnectAll () override
 DisconnectAll method clears the network graph. More...
 
virtual OGRFeatureGetFeatureByGlobalFID (GNMGFID nFID) override
 GetFeatureByGlobalFID search all network layers for given feature identificator. More...
 
virtual CPLErr CreateRule (const char *pszRuleStr)
 Create network rule. More...
 
virtual CPLErr DeleteAllRules ()
 Delete all rules from network. More...
 
virtual CPLErr DeleteRule (const char *pszRuleStr)
 Delete the specified rule. More...
 
virtual char ** GetRules () const
 Get the rule list. More...
 
virtual CPLErr ConnectPointsByLines (char **papszLayerList, double dfTolerance, double dfCost, double dfInvCost, GNMDirection eDir)
 Attempts to build the network topology automatically. More...
 
virtual CPLErr ChangeBlockState (GNMGFID nFID, bool bIsBlock)
 Change the block state of edge or vertex. More...
 
virtual CPLErr ChangeAllBlockState (bool bIsBlock=false)
 Change all vertices and edges block state. More...
 
virtual OGRLayerGetPath (GNMGFID nStartFID, GNMGFID nEndFID, GNMGraphAlgorithmType eAlgorithm, char **papszOptions) override
 Create path between start and end GFIDs. More...
 
const OGRSpatialReferenceGetSpatialRef () const override
 Fetch the spatial reference for this dataset. More...
 
virtual char ** GetFileList (void) override
 Fetch files forming dataset. More...
 
virtual CPLErr Open (GDALOpenInfo *poOpenInfo)=0
 Open a network. More...
 
virtual const char * GetName () const
 GetName - a network name. More...
 
int GetRasterXSize ()
 Fetch raster width in pixels. More...
 
int GetRasterYSize ()
 Fetch raster height in pixels. More...
 
int GetRasterCount ()
 Fetch the number of raster bands on this dataset. More...
 
GDALRasterBandGetRasterBand (int)
 Fetch a band object for a dataset. More...
 
Bands GetBands ()
 Function that returns an iterable object over GDALRasterBand in the dataset. More...
 
virtual CPLErr SetSpatialRef (const OGRSpatialReference *poSRS)
 Set the spatial reference system for this dataset. More...
 
const char * GetProjectionRef (void) const
 Fetch the projection definition string for this dataset. More...
 
CPLErr SetProjection (const char *pszProjection)
 Set the projection reference string for this dataset. More...
 
virtual CPLErr GetGeoTransform (double *padfTransform)
 Fetch the affine transformation coefficients. More...
 
virtual CPLErr SetGeoTransform (double *padfTransform)
 Set the affine transformation coefficients. More...
 
virtual CPLErr AddBand (GDALDataType eType, char **papszOptions=nullptr)
 Add a band to a dataset. More...
 
virtual void * GetInternalHandle (const char *pszHandleName)
 Fetch a format specific internally meaningful handle. More...
 
virtual GDALDriverGetDriver (void)
 Fetch the driver to which this dataset relates. More...
 
virtual const char * GetDriverName ()
 Return driver name. More...
 
virtual const OGRSpatialReferenceGetGCPSpatialRef () const
 Get output spatial reference system for GCPs. More...
 
virtual int GetGCPCount ()
 Get number of GCPs. More...
 
virtual const GDAL_GCPGetGCPs ()
 Fetch GCPs. More...
 
virtual CPLErr SetGCPs (int nGCPCount, const GDAL_GCP *pasGCPList, const OGRSpatialReference *poGCP_SRS)
 Assign GCPs. More...
 
CPLErr SetGCPs (int nGCPCount, const GDAL_GCP *pasGCPList, const char *pszGCPProjection)
 Assign GCPs. More...
 
const char * GetGCPProjection ()
 Get output projection for GCPs. More...
 
virtual CPLErr AdviseRead (int nXOff, int nYOff, int nXSize, int nYSize, int nBufXSize, int nBufYSize, GDALDataType eDT, int nBandCount, int *panBandList, char **papszOptions)
 Advise driver of upcoming read requests. More...
 
virtual CPLErr CreateMaskBand (int nFlagsIn)
 Adds a mask band to the dataset. More...
 
virtual GDALAsyncReaderBeginAsyncReader (int nXOff, int nYOff, int nXSize, int nYSize, void *pBuf, int nBufXSize, int nBufYSize, GDALDataType eBufType, int nBandCount, int *panBandMap, int nPixelSpace, int nLineSpace, int nBandSpace, char **papszOptions)
 Sets up an asynchronous data request. More...
 
virtual void EndAsyncReader (GDALAsyncReader *)
 End asynchronous request. More...
 
CPLErr RasterIO (GDALRWFlag, int, int, int, int, void *, int, int, GDALDataType, int, int *, GSpacing, GSpacing, GSpacing, GDALRasterIOExtraArg *psExtraArg)
 Read/write a region of image data from multiple bands. More...
 
int Reference ()
 Add one to dataset reference count. More...
 
int Dereference ()
 Subtract one from dataset reference count. More...
 
int ReleaseRef ()
 Drop a reference to this object, and destroy if no longer referenced. More...
 
GDALAccess GetAccess () const
 Return access mode. More...
 
int GetShared () const
 Returns shared flag. More...
 
void MarkAsShared ()
 Mark this dataset as available for sharing.
 
void MarkSuppressOnClose ()
 Set that the dataset must be deleted on close.
 
char ** GetOpenOptions ()
 Return open options. More...
 
CPLErr BuildOverviews (const char *, int, int *, int, int *, GDALProgressFunc, void *)
 Build raster overview(s) More...
 
void ReportError (CPLErr eErrClass, CPLErrorNum err_no, const char *fmt,...) CPL_PRINT_FUNC_FORMAT(4
 Emits an error related to a dataset. More...
 
void static void char ** GetMetadata (const char *pszDomain="") override
 Fetch metadata. More...
 
CPLErr SetMetadata (char **papszMetadata, const char *pszDomain) override
 Set metadata. More...
 
CPLErr SetMetadataItem (const char *pszName, const char *pszValue, const char *pszDomain) override
 Set single metadata item. More...
 
char ** GetMetadataDomainList () override
 Fetch list of metadata domains. More...
 
virtual void ClearStatistics ()
 Clear statistics. More...
 
virtual bool IsLayerPrivate (int iLayer) const
 Returns true if the layer at the specified index is deemed a private or system table, or an internal detail only. More...
 
Layers GetLayers ()
 Function that returns an iterable object over layers in the dataset. More...
 
virtual OGRLayerGetLayerByName (const char *)
 Fetch a layer by name. More...
 
virtual void ResetReading ()
 Reset feature reading to start on the first feature. More...
 
virtual OGRFeatureGetNextFeature (OGRLayer **ppoBelongingLayer, double *pdfProgressPct, GDALProgressFunc pfnProgress, void *pProgressData)
 Fetch the next available feature from this dataset. More...
 
Features GetFeatures ()
 Function that return an iterable object over features in the dataset layer. More...
 
virtual std::vector< std::string > GetFieldDomainNames (CSLConstList papszOptions=nullptr) const
 Returns a list of the names of all field domains stored in the dataset. More...
 
virtual const OGRFieldDomainGetFieldDomain (const std::string &name) const
 Get a field domain from its name. More...
 
virtual bool AddFieldDomain (std::unique_ptr< OGRFieldDomain > &&domain, std::string &failureReason)
 Add a field domain to the dataset. More...
 
virtual bool DeleteFieldDomain (const std::string &name, std::string &failureReason)
 Removes a field domain from the dataset. More...
 
virtual bool UpdateFieldDomain (std::unique_ptr< OGRFieldDomain > &&domain, std::string &failureReason)
 Updates an existing field domain by replacing its definition. More...
 
virtual std::vector< std::string > GetRelationshipNames (CSLConstList papszOptions=nullptr) const
 Returns a list of the names of all relationships stored in the dataset. More...
 
virtual const GDALRelationshipGetRelationship (const std::string &name) const
 Get a relationship from its name. More...
 
virtual bool AddRelationship (std::unique_ptr< GDALRelationship > &&relationship, std::string &failureReason)
 Add a relationship to the dataset. More...
 
virtual bool DeleteRelationship (const std::string &name, std::string &failureReason)
 Removes a relationship from the dataset. More...
 
virtual bool UpdateRelationship (std::unique_ptr< GDALRelationship > &&relationship, std::string &failureReason)
 Updates an existing relationship by replacing its definition. More...
 
virtual OGRLayerCreateLayer (const char *pszName, OGRSpatialReference *poSpatialRef=nullptr, OGRwkbGeometryType eGType=wkbUnknown, char **papszOptions=nullptr)
 This method attempts to create a new layer on the dataset with the indicated name, coordinate system, geometry type. More...
 
virtual OGRStyleTableGetStyleTable ()
 Returns dataset style table. More...
 
virtual void SetStyleTableDirectly (OGRStyleTable *poStyleTable)
 Set dataset style table. More...
 
virtual void SetStyleTable (OGRStyleTable *poStyleTable)
 Set dataset style table. More...
 
virtual OGRLayerExecuteSQL (const char *pszStatement, OGRGeometry *poSpatialFilter, const char *pszDialect)
 Execute an SQL statement against the data store. More...
 
virtual void ReleaseResultSet (OGRLayer *poResultsSet)
 Release results of ExecuteSQL(). More...
 
virtual OGRErr AbortSQL ()
 Abort any SQL statement running in the data store. More...
 
int GetRefCount () const
 Fetch reference count. More...
 
int GetSummaryRefCount () const
 Fetch reference count of datasource and all owned layers. More...
 
OGRErr Release ()
 Drop a reference to this dataset, and if the reference count drops to one close (destroy) the dataset. More...
 
virtual OGRErr StartTransaction (int bForce=FALSE)
 For datasources which support transactions, StartTransaction creates a `transaction. More...
 
virtual OGRErr CommitTransaction ()
 For datasources which support transactions, CommitTransaction commits a transaction. More...
 
virtual OGRErr RollbackTransaction ()
 For datasources which support transactions, RollbackTransaction will roll back a datasource to its state before the start of the current transaction. More...
 
virtual std::shared_ptr< GDALGroupGetRootGroup () const
 Return the root GDALGroup of this dataset. More...
 
int GetMOFlags () const
 Returns the GMO_ flags. More...
 
void SetMOFlags (int nFlagsIn)
 Assign GMO_flags. More...
 
virtual const char * GetDescription () const
 Fetch object description. More...
 
virtual void SetDescription (const char *)
 Set object description. More...
 
virtual const char * GetMetadataItem (const char *pszName, const char *pszDomain="")
 Fetch single metadata item. More...
 

Static Public Member Functions

static GDALDatasetOpen (const char *pszFilename, unsigned int nOpenFlags=0, const char *const *papszAllowedDrivers=nullptr, const char *const *papszOpenOptions=nullptr, const char *const *papszSiblingFiles=nullptr)
 
static GDALDataset ** GetOpenDatasets (int *pnDatasetCount)
 Fetch all open GDAL dataset handles. More...
 
void static void ReportError (const char *pszDSName, CPLErr eErrClass, CPLErrorNum err_no, const char *fmt,...) CPL_PRINT_FUNC_FORMAT(4
 Emits an error related to a dataset (static method) More...
 
static GDALDatasetH ToHandle (GDALDataset *poDS)
 Convert a GDALDataset* to a GDALDatasetH. More...
 
static GDALMajorObjectH ToHandle (GDALMajorObject *poMajorObject)
 Convert a GDALMajorObject* to a GDALMajorObjectH. More...
 
static GDALDatasetFromHandle (GDALDatasetH hDS)
 Convert a GDALDatasetH to a GDALDataset*. More...
 

Protected Member Functions

virtual CPLErr CheckLayerDriver (const char *pszDefaultDriverName, char **papszOptions)
 Check or create layer OGR driver. More...
 
virtual bool CheckStorageDriverSupport (const char *pszDriverName)=0
 Check if provided OGR driver accepted as storage for network data. More...
 
virtual int CheckNetworkExist (const char *pszFilename, char **papszOptions)=0
 Check if network already exist. More...
 
void CleanupPostFileClosing ()
 This method should be called by driver implementations in their destructor, after having closed all files, but before having freed resources that are needed for their GetFileList() implementation. More...
 
virtual OGRLayerICreateLayer (const char *pszName, OGRSpatialReference *poSpatialRef=nullptr, OGRwkbGeometryType eGType=wkbUnknown, char **papszOptions=nullptr)
 This method attempts to create a new layer on the dataset with the indicated name, coordinate system, geometry type. More...
 
char ** BuildMetadataDomainList (char **papszList, int bCheckNonEmpty,...) CPL_NULL_TERMINATED
 Helper function for custom implementations of GetMetadataDomainList() More...
 

Detailed Description

GNM class which represents a geography network of generic format.

Since
GDAL 2.1

Member Function Documentation

◆ AbortSQL()

OGRErr GDALDataset::AbortSQL ( )
virtualinherited

Abort any SQL statement running in the data store.

This function can be safely called from any thread (pending that the dataset object is still alive). Driver implementations will make sure that it can be called in a thread-safe way.

This might not be implemented by all drivers. At time of writing, only SQLite, GPKG and PG drivers implement it

This method is the same as the C method GDALDatasetAbortSQL()

Since
GDAL 3.2.0

◆ AddBand()

CPLErr GDALDataset::AddBand ( GDALDataType  eType,
char **  papszOptions = nullptr 
)
virtualinherited

Add a band to a dataset.

This method will add a new band to the dataset if the underlying format supports this action. Most formats do not.

Note that the new GDALRasterBand is not returned. It may be fetched after successful completion of the method by calling GDALDataset::GetRasterBand(GDALDataset::GetRasterCount()) as the newest band will always be the last band.

Parameters
eTypethe data type of the pixels in the new band.
papszOptionsa list of NAME=VALUE option strings. The supported options are format specific. NULL may be passed by default.
Returns
CE_None on success or CE_Failure on failure.

◆ AddFeatureGlobalFID()

virtual CPLErr GNMGenericNetwork::AddFeatureGlobalFID ( GNMGFID  nFID,
const char *  pszLayerName 
)
virtual

AddFeatureGlobalFID add the FID <-> Layer name link to fast access features by global FID.

Parameters
nFID- global FID
pszLayerName- layer name
Returns
CE_None on success

◆ AddFieldDomain()

bool GDALDataset::AddFieldDomain ( std::unique_ptr< OGRFieldDomain > &&  domain,
std::string &  failureReason 
)
virtualinherited

Add a field domain to the dataset.

Only a few drivers will support this operation, and some of them might only support it only for some types of field domains. At the time of writing (GDAL 3.3), only the Memory and GeoPackage drivers support this operation. A dataset having at least some support for this operation should report the ODsCAddFieldDomain dataset capability.

Anticipated failures will not be emitted through the CPLError() infrastructure, but will be reported in the failureReason output parameter.

Note
Drivers should make sure to update m_oMapFieldDomains in order for the default implementation of GetFieldDomainNames() to work correctly, or alternatively a specialized implementation of GetFieldDomainNames() should be implemented.
Parameters
domainThe domain definition.
failureReasonOutput parameter. Will contain an error message if an error occurs.
Returns
true in case of success.
Since
GDAL 3.3

◆ AddRelationship()

bool GDALDataset::AddRelationship ( std::unique_ptr< GDALRelationship > &&  relationship,
std::string &  failureReason 
)
virtualinherited

Add a relationship to the dataset.

Only a few drivers will support this operation, and some of them might only support it only for some types of relationships.

A dataset having at least some support for this operation should report the GDsCAddRelationship dataset capability.

Anticipated failures will not be emitted through the CPLError() infrastructure, but will be reported in the failureReason output parameter.

When adding a many-to-many relationship (GDALRelationshipCardinality::GRC_MANY_TO_MANY), it is possible to omit the mapping table name (see GDALRelationship::GetMappingTableName) to instruct the driver to create an appropriately named and structured mapping table. Some dataset formats require particular naming conventions and field structures for the mapping table, and delegating the construction of the mapping table to the driver will avoid these pitfalls.

Parameters
relationshipThe relationship definition.
failureReasonOutput parameter. Will contain an error message if an error occurs.
Returns
true in case of success.
Since
GDAL 3.6

◆ AdviseRead()

CPLErr GDALDataset::AdviseRead ( int  nXOff,
int  nYOff,
int  nXSize,
int  nYSize,
int  nBufXSize,
int  nBufYSize,
GDALDataType  eBufType,
int  nBandCount,
int *  panBandMap,
char **  papszOptions 
)
virtualinherited

Advise driver of upcoming read requests.

Some GDAL drivers operate more efficiently if they know in advance what set of upcoming read requests will be made. The AdviseRead() method allows an application to notify the driver of the region and bands of interest, and at what resolution the region will be read.

Many drivers just ignore the AdviseRead() call, but it can dramatically accelerate access via some drivers.

Depending on call paths, drivers might receive several calls to AdviseRead() with the same parameters.

Parameters
nXOffThe pixel offset to the top left corner of the region of the band to be accessed. This would be zero to start from the left side.
nYOffThe line offset to the top left corner of the region of the band to be accessed. This would be zero to start from the top.
nXSizeThe width of the region of the band to be accessed in pixels.
nYSizeThe height of the region of the band to be accessed in lines.
nBufXSizethe width of the buffer image into which the desired region is to be read, or from which it is to be written.
nBufYSizethe height of the buffer image into which the desired region is to be read, or from which it is to be written.
eBufTypethe type of the pixel values in the pData data buffer. The pixel values will automatically be translated to/from the GDALRasterBand data type as needed.
nBandCountthe number of bands being read or written.
panBandMapthe list of nBandCount band numbers being read/written. Note band numbers are 1 based. This may be NULL to select the first nBandCount bands.
papszOptionsa list of name=value strings with special control options. Normally this is NULL.
Returns
CE_Failure if the request is invalid and CE_None if it works or is ignored.

◆ BeginAsyncReader()

GDALAsyncReader * GDALDataset::BeginAsyncReader ( int  nXOff,
int  nYOff,
int  nXSize,
int  nYSize,
void *  pBuf,
int  nBufXSize,
int  nBufYSize,
GDALDataType  eBufType,
int  nBandCount,
int *  panBandMap,
int  nPixelSpace,
int  nLineSpace,
int  nBandSpace,
char **  papszOptions 
)
virtualinherited

Sets up an asynchronous data request.

This method establish an asynchronous raster read request for the indicated window on the dataset into the indicated buffer. The parameters for windowing, buffer size, buffer type and buffer organization are similar to those for GDALDataset::RasterIO(); however, this call only launches the request and filling the buffer is accomplished via calls to GetNextUpdatedRegion() on the return GDALAsyncReader session object.

Once all processing for the created session is complete, or if no further refinement of the request is required, the GDALAsyncReader object should be destroyed with the GDALDataset::EndAsyncReader() method.

Note that the data buffer (pData) will potentially continue to be updated as long as the session lives, but it is not deallocated when the session (GDALAsyncReader) is destroyed with EndAsyncReader(). It should be deallocated by the application at that point.

Additional information on asynchronous IO in GDAL may be found at: https://gdal.org/development/rfc/rfc24_progressive_data_support.html

This method is the same as the C GDALBeginAsyncReader() function.

Parameters
nXOffThe pixel offset to the top left corner of the region of the band to be accessed. This would be zero to start from the left side.
nYOffThe line offset to the top left corner of the region of the band to be accessed. This would be zero to start from the top.
nXSizeThe width of the region of the band to be accessed in pixels.
nYSizeThe height of the region of the band to be accessed in lines.
pBufThe buffer into which the data should be read. This buffer must contain at least nBufXSize * nBufYSize * nBandCount words of type eBufType. It is organized in left to right,top to bottom pixel order. Spacing is controlled by the nPixelSpace, and nLineSpace parameters.
nBufXSizethe width of the buffer image into which the desired region is to be read, or from which it is to be written.
nBufYSizethe height of the buffer image into which the desired region is to be read, or from which it is to be written.
eBufTypethe type of the pixel values in the pData data buffer. The pixel values will automatically be translated to/from the GDALRasterBand data type as needed.
nBandCountthe number of bands being read or written.
panBandMapthe list of nBandCount band numbers being read/written. Note band numbers are 1 based. This may be NULL to select the first nBandCount bands.
nPixelSpaceThe byte offset from the start of one pixel value in pData to the start of the next pixel value within a scanline. If defaulted (0) the size of the datatype eBufType is used.
nLineSpaceThe byte offset from the start of one scanline in pData to the start of the next. If defaulted the size of the datatype eBufType * nBufXSize is used.
nBandSpacethe byte offset from the start of one bands data to the start of the next. If defaulted (zero) the value will be nLineSpace * nBufYSize implying band sequential organization of the data buffer.
papszOptionsDriver specific control options in a string list or NULL. Consult driver documentation for options supported.
Returns
The GDALAsyncReader object representing the request.

◆ BuildMetadataDomainList()

char ** GDALMajorObject::BuildMetadataDomainList ( char **  papszList,
int  bCheckNonEmpty,
  ... 
)
protectedinherited

Helper function for custom implementations of GetMetadataDomainList()

Parameters
papszListinitial list of domains. May be NULL. Will become invalid after function call (use return value)
bCheckNonEmptyif TRUE, each candidate domain will be tested to be non empty
...NULL terminated variadic list of candidate domains.
Returns
NULL or a string list. Must be freed with CSLDestroy()
Since
GDAL 1.11

◆ BuildOverviews()

CPLErr GDALDataset::BuildOverviews ( const char *  pszResampling,
int  nOverviews,
int *  panOverviewList,
int  nListBands,
int *  panBandList,
GDALProgressFunc  pfnProgress,
void *  pProgressData 
)
inherited

Build raster overview(s)

If the operation is unsupported for the indicated dataset, then CE_Failure is returned, and CPLGetLastErrorNo() will return CPLE_NotSupported.

Depending on the actual file format, all overviews level can be also deleted by specifying nOverviews == 0. This works at least for external overviews (.ovr), TIFF internal overviews, etc.

Starting with GDAL 3.2, the GDAL_NUM_THREADS configuration option can be set to "ALL_CPUS" or a integer value to specify the number of threads to use for overview computation.

This method is the same as the C function GDALBuildOverviews().

Parameters
pszResamplingone of "AVERAGE", "AVERAGE_MAGPHASE", "RMS", "BILINEAR", "CUBIC", "CUBICSPLINE", "GAUSS", "LANCZOS", "MODE", "NEAREST", or "NONE" controlling the downsampling method applied.
nOverviewsnumber of overviews to build, or 0 to clean overviews.
panOverviewListthe list of overview decimation factors to build, or NULL if nOverviews == 0.
nListBandsnumber of bands to build overviews for in panBandList. Build for all bands if this is 0.
panBandListlist of band numbers.
pfnProgressa function to call to report progress, or NULL.
pProgressDataapplication data to pass to the progress function.
Returns
CE_None on success or CE_Failure if the operation doesn't work.

For example, to build overview level 2, 4 and 8 on all bands the following call could be made:

int anOverviewList[3] = { 2, 4, 8 };
poDataset->BuildOverviews( "NEAREST", 3, anOverviewList, 0, nullptr,
GDALDummyProgress, nullptr );
See also
GDALRegenerateOverviews()

◆ ChangeAllBlockState()

virtual CPLErr GNMGenericNetwork::ChangeAllBlockState ( bool  bIsBlock = false)
virtual

Change all vertices and edges block state.

This is mainly use for unblock all vertices and edges.

Parameters
bIsBlockBlock or unblock
Returns
CE_None on success

◆ ChangeBlockState()

virtual CPLErr GNMGenericNetwork::ChangeBlockState ( GNMGFID  nFID,
bool  bIsBlock 
)
virtual

Change the block state of edge or vertex.

Parameters
nFIDIdentificator
bIsBlockBlock or unblock
Returns
CE_None on success

◆ CheckLayerDriver()

virtual CPLErr GNMGenericNetwork::CheckLayerDriver ( const char *  pszDefaultDriverName,
char **  papszOptions 
)
protectedvirtual

Check or create layer OGR driver.

Parameters
pszDefaultDriverName- default driver name
papszOptions- create options
Returns
CE_None if driver is exist or CE_Failure

◆ CheckNetworkExist()

virtual int GNMNetwork::CheckNetworkExist ( const char *  pszFilename,
char **  papszOptions 
)
protectedpure virtualinherited

Check if network already exist.

Parameters
pszFilename- path to network (folder or database
papszOptions- create options
Returns
TRUE if exist and not overwrite or FALSE

◆ CheckStorageDriverSupport()

virtual bool GNMGenericNetwork::CheckStorageDriverSupport ( const char *  pszDriverName)
protectedpure virtual

Check if provided OGR driver accepted as storage for network data.

Parameters
pszDriverNameThe driver name
Returns
true if supported, else false

◆ CleanupPostFileClosing()

void GDALDataset::CleanupPostFileClosing ( )
protectedinherited

This method should be called by driver implementations in their destructor, after having closed all files, but before having freed resources that are needed for their GetFileList() implementation.

This is used to implement MarkSuppressOnClose behavior.

◆ ClearStatistics()

void GDALDataset::ClearStatistics ( )
virtualinherited

Clear statistics.

Only implemented for now in PAM supported datasets

This is the same as the C function GDALDatasetClearStatistics().

Since
GDAL 3.2

Reimplemented in GDALPamDataset.

◆ CloseDependentDatasets()

virtual int GNMGenericNetwork::CloseDependentDatasets ( )
overridevirtual

Drop references to any other datasets referenced by this dataset.

This method should release any reference to other datasets (e.g. a VRT dataset to its sources), but not close the current dataset itself.

If at least, one reference to a dependent dataset has been dropped, this method should return TRUE. Otherwise it should return FALSE. (Failure to return the proper value might result in infinite loop)

This method can be called several times on a given dataset. After the first time, it should not do anything and return FALSE.

The driver implementation may choose to destroy its raster bands, so be careful not to call any method on the raster bands afterwards.

Basically the only safe action you can do after calling CloseDependentDatasets() is to call the destructor.

Note: the only legitimate caller of CloseDependentDatasets() is GDALDriverManager::~GDALDriverManager()

Returns
TRUE if at least one reference to another dataset has been dropped.

Reimplemented from GDALDataset.

◆ CommitTransaction()

OGRErr GDALDataset::CommitTransaction ( )
virtualinherited

For datasources which support transactions, CommitTransaction commits a transaction.

If no transaction is active, or the commit fails, will return OGRERR_FAILURE. Datasources which do not support transactions will always return OGRERR_UNSUPPORTED_OPERATION.

Depending on drivers, this may or may not abort layer sequential readings that are active.

This function is the same as the C function GDALDatasetCommitTransaction().

Returns
OGRERR_NONE on success.
Since
GDAL 2.0

◆ ConnectFeatures()

virtual CPLErr GNMGenericNetwork::ConnectFeatures ( GNMGFID  nSrcFID,
GNMGFID  nTgtFID,
GNMGFID  nConFID = -1,
double  dfCost = 1,
double  dfInvCost = 1,
GNMDirection  eDir = GNM_EDGE_DIR_BOTH 
)
virtual

Connects two features via third feature (may be virtual, so the identificator should be -1).

The features may be at the same layer or different layers.

Parameters
nSrcFID- source feature identificator
nTgtFID- target feature identificator
nConFID- connection feature identificator (-1 for virtual connection)
dfCost- cost moving from source to target (default 1)
dfInvCost- cost moving from target to source (default 1)
eDir- direction, may be source to target, target to source or both. (default - both)
Returns
CE_None on success

◆ ConnectPointsByLines()

virtual CPLErr GNMGenericNetwork::ConnectPointsByLines ( char **  papszLayerList,
double  dfTolerance,
double  dfCost,
double  dfInvCost,
GNMDirection  eDir 
)
virtual

Attempts to build the network topology automatically.

The method simply gets point and line or multiline layers from the papszLayerList and searches for each line which connects two points: start and end, so it can be not so effective in performance when it is called on huge networks. Note, when passing your tolerance value: this value will depend of spatial reference system of the network, and especially of its 0,0 position because dfTolerance is just divided by 2 and added/subtracted to/from both sides of each line-feature end point forming thus the square area around it. The first point-feature occurred inside this area will be given as a start/end point for the current connection. So it is also desirable that at least two layers are passed in papszLayerList (one point and one line), and they are already connected "visually" ("geometrically").

Parameters
papszLayerListA list of layers to connect. The list should be freed via CSLDestroy.
dfToleranceSnapping tolerance.
dfCostDirect cost.
dfInvCostInverse cost.
eDirDirection.
Returns
CE_None on success

◆ CopyLayer()

virtual OGRLayer * GNMGenericNetwork::CopyLayer ( OGRLayer poSrcLayer,
const char *  pszNewName,
char **  papszOptions = nullptr 
)
overridevirtual

Duplicate an existing layer.

This method creates a new layer, duplicate the field definitions of the source layer and then duplicate each features of the source layer. The papszOptions argument can be used to control driver specific creation options. These options are normally documented in the format specific documentation. The source layer may come from another dataset.

This method is the same as the C function GDALDatasetCopyLayer() and the deprecated OGR_DS_CopyLayer().

In GDAL 1.X, this method used to be in the OGRDataSource class.

Parameters
poSrcLayersource layer.
pszNewNamethe name of the layer to create.
papszOptionsa StringList of name=value options. Options are driver specific. There is a common option to set output layer spatial reference: DST_SRSWKT. The option should be in WKT format.
Returns
a handle to the layer, or NULL if an error occurs.

Reimplemented from GDALDataset.

◆ Create()

virtual CPLErr GNMGenericNetwork::Create ( const char *  pszFilename,
char **  papszOptions 
)
overridepure virtual

Create network system layers.

Creates the connectivity (the "network path" of data) over the dataset and returns the resulting network. NOTE: This method does not create any connections among features but creates the necessary set of fields, layers, etc. NOTE: After the successful creation the passed dataset must not be modified outside (but can be read as usual). NOTE: For the common network format the creation is forbidden if the passed dataset already has network system layers and OVERWRITE creation option is FALSE.

Parameters
pszFilename- A path there the network folder (schema, etc.) will be created. The folder (schema, etc.) name get options.
papszOptions- create network options. The create options specific for gnm driver.
Returns
CE_None on success

Implements GNMNetwork.

◆ CreateLayer()

OGRLayer * GDALDataset::CreateLayer ( const char *  pszName,
OGRSpatialReference poSpatialRef = nullptr,
OGRwkbGeometryType  eGType = wkbUnknown,
char **  papszOptions = nullptr 
)
virtualinherited

This method attempts to create a new layer on the dataset with the indicated name, coordinate system, geometry type.

The papszOptions argument can be used to control driver specific creation options. These options are normally documented in the format specific documentation.

In GDAL 2.0, drivers should extend the ICreateLayer() method and not CreateLayer(). CreateLayer() adds validation of layer creation options, before delegating the actual work to ICreateLayer().

This method is the same as the C function GDALDatasetCreateLayer() and the deprecated OGR_DS_CreateLayer().

In GDAL 1.X, this method used to be in the OGRDataSource class.

Example:

#include "gdal.h"
#include "cpl_string.h"
...
OGRLayer *poLayer;
char **papszOptions;
if( !poDS->TestCapability( ODsCCreateLayer ) )
{
...
}
papszOptions = CSLSetNameValue( papszOptions, "DIM", "2" );
poLayer = poDS->CreateLayer( "NewLayer", nullptr, wkbUnknown,
papszOptions );
CSLDestroy( papszOptions );
if( poLayer == NULL )
{
...
}
This class represents a layer of simple features, with access methods.
Definition: ogrsf_frmts.h:73
Various convenience functions for working with strings and string lists.
void CSLDestroy(char **papszStrList)
Free string list.
Definition: cpl_string.cpp:202
char ** CSLSetNameValue(char **papszStrList, const char *pszName, const char *pszValue)
Assign value to name in StringList.
Definition: cpl_string.cpp:1898
Public (C callable) GDAL entry points.
@ wkbUnknown
unknown type, non-standard
Definition: ogr_core.h:370
#define ODsCCreateLayer
Dataset capability for layer creation.
Definition: ogr_core.h:895
Parameters
pszNamethe name for the new layer. This should ideally not match any existing layer on the datasource.
poSpatialRefthe coordinate system to use for the new layer, or NULL if no coordinate system is available. The driver might only increase the reference counter of the object to take ownership, and not make a full copy, so do not use OSRDestroySpatialReference(), but OSRRelease() instead when you are done with the object.
eGTypethe geometry type for the layer. Use wkbUnknown if there are no constraints on the types geometry to be written.
papszOptionsa StringList of name=value options. Options are driver specific.
Returns
NULL is returned on failure, or a new OGRLayer handle on success.

◆ CreateMaskBand()

CPLErr GDALDataset::CreateMaskBand ( int  nFlagsIn)
virtualinherited

Adds a mask band to the dataset.

The default implementation of the CreateMaskBand() method is implemented based on similar rules to the .ovr handling implemented using the GDALDefaultOverviews object. A TIFF file with the extension .msk will be created with the same basename as the original file, and it will have one band. The mask images will be deflate compressed tiled images with the same block size as the original image if possible. It will have INTERNAL_MASK_FLAGS_xx metadata items set at the dataset level, where xx matches the band number of a band of the main dataset. The value of those items will be the one of the nFlagsIn parameter.

Note that if you got a mask band with a previous call to GetMaskBand(), it might be invalidated by CreateMaskBand(). So you have to call GetMaskBand() again.

Since
GDAL 1.5.0
Parameters
nFlagsIn0 or combination of GMF_PER_DATASET / GMF_ALPHA. GMF_PER_DATASET will be always set, even if not explicitly specified.
Returns
CE_None on success or CE_Failure on an error.
See also
https://gdal.org/development/rfc/rfc15_nodatabitmask.html
GDALRasterBand::CreateMaskBand()

◆ CreateRule()

virtual CPLErr GNMGenericNetwork::CreateRule ( const char *  pszRuleStr)
virtual

Create network rule.

Creates the rule in the network according to the special syntax. These rules are declarative and make an effect for the network when they exist. Each rule for layer can be created only if the corresponding layer existed and removed when the layer is being deleted.

Rules syntax for the common network format in GNM contains the key words (words in capital letters or signs) and the modifiers which refers to the network objects. All the following combinations are available:

Notation: layer1, layer2, layer3 - a layer names (the corresponding layers must be exist; field1 - a field name (field must be exist); constant1 - any double constant; string1 - any string;

Rules describing which layer can be connected or not connected with each other, and (optional) which layer must serve as a connector. By default all connections are forbidden. But while network creation process the rule to allow any connection added. During the connection process each rule tested if this connection can be created.

"ALLOW CONNECTS ANY" "DENY CONNECTS ANY" "DENY CONNECTS layer1 WITH layer2" "ALLOW CONNECTS layer1 WITH layer2 VIA layer3"

Parameters
pszRuleStrRule string which will parsed. If the parsing was successful, the rule will start having effect immediately.
Returns
CE_None on success.

◆ Delete()

virtual CPLErr GNMGenericNetwork::Delete ( )
overridevirtual

Delete network.

Delete all dependent layers

Returns
CE_None on success

Implements GNMNetwork.

◆ DeleteAllRules()

virtual CPLErr GNMGenericNetwork::DeleteAllRules ( )
virtual

Delete all rules from network.

Returns
CE_None on success.

◆ DeleteFieldDomain()

bool GDALDataset::DeleteFieldDomain ( const std::string &  name,
std::string &  failureReason 
)
virtualinherited

Removes a field domain from the dataset.

Only a few drivers will support this operation.

At the time of writing (GDAL 3.5), only the Memory and GeoPackage drivers support this operation. A dataset having at least some support for this operation should report the ODsCDeleteFieldDomain dataset capability.

Anticipated failures will not be emitted through the CPLError() infrastructure, but will be reported in the failureReason output parameter.

Note
Drivers should make sure to update m_oMapFieldDomains in order for the default implementation of GetFieldDomainNames() to work correctly, or alternatively a specialized implementation of GetFieldDomainNames() should be implemented.
Parameters
nameThe domain name.
failureReasonOutput parameter. Will contain an error message if an error occurs.
Returns
true in case of success.
Since
GDAL 3.5

◆ DeleteLayer()

virtual OGRErr GNMGenericNetwork::DeleteLayer ( int  iLayer)
overridevirtual

Delete the indicated layer from the datasource.

If this method is supported the ODsCDeleteLayer capability will test TRUE on the GDALDataset.

This method is the same as the C function GDALDatasetDeleteLayer() and the deprecated OGR_DS_DeleteLayer().

In GDAL 1.X, this method used to be in the OGRDataSource class.

Parameters
iLayerthe index of the layer to delete.
Returns
OGRERR_NONE on success, or OGRERR_UNSUPPORTED_OPERATION if deleting layers is not supported for this datasource.

Reimplemented from GDALDataset.

◆ DeleteRelationship()

bool GDALDataset::DeleteRelationship ( const std::string &  name,
std::string &  failureReason 
)
virtualinherited

Removes a relationship from the dataset.

Only a few drivers will support this operation.

A dataset having at least some support for this operation should report the GDsCDeleteRelationship dataset capability.

Anticipated failures will not be emitted through the CPLError() infrastructure, but will be reported in the failureReason output parameter.

Parameters
nameThe relationship name.
failureReasonOutput parameter. Will contain an error message if an error occurs.
Returns
true in case of success.
Since
GDAL 3.6

◆ DeleteRule()

virtual CPLErr GNMGenericNetwork::DeleteRule ( const char *  pszRuleStr)
virtual

Delete the specified rule.

Parameters
pszRuleStr- the rule to delete
Returns
CE_None on success.

◆ Dereference()

int GDALDataset::Dereference ( )
inherited

Subtract one from dataset reference count.

The reference is one after instantiation. Generally when the reference count has dropped to zero the dataset may be safely deleted (closed).

This method is the same as the C GDALDereferenceDataset() function.

Returns
the post-decrement reference count.

◆ DisconnectAll()

virtual CPLErr GNMGenericNetwork::DisconnectAll ( )
overridevirtual

DisconnectAll method clears the network graph.

Returns
CE_None on success

Implements GNMNetwork.

◆ DisconnectFeatures()

virtual CPLErr GNMGenericNetwork::DisconnectFeatures ( GNMGFID  nSrcFID,
GNMGFID  nTgtFID,
GNMGFID  nConFID 
)
virtual

Remove features connection.

Parameters
nSrcFID- source feature identificator
nTgtFID- target feature identificator
nConFID- connection feature identificator
Returns
CE_None on success

◆ DisconnectFeaturesWithId()

virtual CPLErr GNMGenericNetwork::DisconnectFeaturesWithId ( GNMGFID  nFID)
virtual

Find the corresponding identificator in graph (source, target, connector) and remove such connections.

Parameters
nFID- identificator to find.
Returns
CE_None on success

◆ EndAsyncReader()

void GDALDataset::EndAsyncReader ( GDALAsyncReader poARIO)
virtualinherited

End asynchronous request.

This method destroys an asynchronous io request and recovers all resources associated with it.

This method is the same as the C function GDALEndAsyncReader().

Parameters
poARIOpointer to a GDALAsyncReader

◆ ExecuteSQL()

OGRLayer * GDALDataset::ExecuteSQL ( const char *  pszStatement,
OGRGeometry poSpatialFilter,
const char *  pszDialect 
)
virtualinherited

Execute an SQL statement against the data store.

The result of an SQL query is either NULL for statements that are in error, or that have no results set, or an OGRLayer pointer representing a results set from the query. Note that this OGRLayer is in addition to the layers in the data store and must be destroyed with ReleaseResultSet() before the dataset is closed (destroyed).

This method is the same as the C function GDALDatasetExecuteSQL() and the deprecated OGR_DS_ExecuteSQL().

For more information on the SQL dialect supported internally by OGR review the OGR SQL document. Some drivers (i.e. Oracle and PostGIS) pass the SQL directly through to the underlying RDBMS.

Starting with OGR 1.10, the SQLITE dialect can also be used.

In GDAL 1.X, this method used to be in the OGRDataSource class.

Parameters
pszStatementthe SQL statement to execute.
poSpatialFiltergeometry which represents a spatial filter. Can be NULL.
pszDialectallows control of the statement dialect. If set to NULL, the OGR SQL engine will be used, except for RDBMS drivers that will use their dedicated SQL engine, unless OGRSQL is explicitly passed as the dialect. Starting with OGR 1.10, the SQLITE dialect can also be used.
Returns
an OGRLayer containing the results of the query. Deallocate with ReleaseResultSet().

◆ FlushCache()

virtual void GNMGenericNetwork::FlushCache ( bool  bAtClosing)
overridevirtual

Flush all write cached data to disk.

Any raster (or other GDAL) data written via GDAL calls, but buffered internally will be written to disk.

The default implementation of this method just calls the FlushCache() method on each of the raster bands and the SyncToDisk() method on each of the layers. Conceptionally, calling FlushCache() on a dataset should include any work that might be accomplished by calling SyncToDisk() on layers in that dataset.

Using this method does not prevent use from calling GDALClose() to properly close a dataset and ensure that important data not addressed by FlushCache() is written in the file.

This method is the same as the C function GDALFlushCache().

Parameters
bAtClosingWhether this is called from a GDALDataset destructor

Reimplemented from GDALDataset.

◆ FromHandle()

static GDALDataset * GDALDataset::FromHandle ( GDALDatasetH  hDS)
inlinestaticinherited

Convert a GDALDatasetH to a GDALDataset*.

Since
GDAL 2.3

◆ GetAccess()

GDALAccess GDALDataset::GetAccess ( ) const
inlineinherited

Return access mode.

Returns
access mode.

◆ GetAlgorithmName()

virtual CPLString GNMGenericNetwork::GetAlgorithmName ( GNMDirection  eAlgorithm,
bool  bShortName 
)
virtual

Get the algorithm name.

Parameters
eAlgorithmGNM algorithm type
bShortNameIndicator which name to return - short or long
Returns
String with algorithm name

◆ GetBands()

GDALDataset::Bands GDALDataset::GetBands ( )
inherited

Function that returns an iterable object over GDALRasterBand in the dataset.

This is a C++ iterator friendly version of GetRasterBand().

Typical use is:

for( auto&& poBand: poDS->GetBands() )
{
std::cout << "Band << poBand->GetDescription() << std::endl;
}
See also
GetRasterBand()
Since
GDAL 2.3

◆ GetDescription()

const char * GDALMajorObject::GetDescription ( ) const
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().

Returns
non-null pointer to internal description string.

◆ GetDriver()

GDALDriver * GDALDataset::GetDriver ( void  )
virtualinherited

Fetch the driver to which this dataset relates.

This method is the same as the C GDALGetDatasetDriver() function.

Returns
the driver on which the dataset was created with GDALOpen() or GDALCreate().

◆ GetDriverName()

const char * GDALDataset::GetDriverName ( )
virtualinherited

Return driver name.

Returns
driver name.

◆ GetFeatureByGlobalFID()

virtual OGRFeature * GNMGenericNetwork::GetFeatureByGlobalFID ( GNMGFID  nGFID)
overridevirtual

GetFeatureByGlobalFID search all network layers for given feature identificator.

Parameters
nGFIDfeature identificator.
Returns
OGRFeature pointer or NULL. The pointer should be freed via OGRFeature::DestroyFeature().

Implements GNMNetwork.

◆ GetFeatures()

GDALDataset::Features GDALDataset::GetFeatures ( )
inherited

Function that return an iterable object over features in the dataset layer.

This is a C++ iterator friendly version of GetNextFeature().

Using this iterator for standard range-based loops is safe, but due to implementation limitations, you shouldn't try to access (dereference) more than one iterator step at a time, since the FeatureLayerPair reference which is returned is reused.

Typical use is:

for( auto&& oFeatureLayerPair: poDS->GetFeatures() )
{
std::cout << "Feature of layer " <<
oFeatureLayerPair.layer->GetName() << std::endl;
oFeatureLayerPair.feature->DumpReadable();
}
See also
GetNextFeature()
Since
GDAL 2.3

◆ GetFieldDomain()

const OGRFieldDomain * GDALDataset::GetFieldDomain ( const std::string &  name) const
virtualinherited

Get a field domain from its name.

Returns
the field domain, or nullptr if not found.
Since
GDAL 3.3

◆ GetFieldDomainNames()

std::vector< std::string > GDALDataset::GetFieldDomainNames ( CSLConstList  papszOptions = nullptr) const
virtualinherited

Returns a list of the names of all field domains stored in the dataset.

Note
The default implementation assumes that drivers fully populate m_oMapFieldDomains when opening a dataset. If this assumption is incorrect then a specialized implementation of GetFieldDomainNames() must be implemented.
Parameters
papszOptionsDriver specific options determining how attributes should be retrieved. Pass nullptr for default behavior.
Returns
list of field domain names
Since
GDAL 3.5

◆ GetFileList()

char ** GNMNetwork::GetFileList ( void  )
overridevirtualinherited

Fetch files forming dataset.

Returns a list of files believed to be part of this dataset. If it returns an empty list of files it means there is believed to be no local file system files associated with the dataset (for instance a virtual dataset). The returned file list is owned by the caller and should be deallocated with CSLDestroy().

The returned filenames will normally be relative or absolute paths depending on the path used to originally open the dataset. The strings will be UTF-8 encoded.

This method is the same as the C GDALGetFileList() function.

Returns
NULL or a NULL terminated array of file names.

Reimplemented from GDALDataset.

◆ GetGCPCount()

int GDALDataset::GetGCPCount ( )
virtualinherited

Get number of GCPs.

This method is the same as the C function GDALGetGCPCount().

Returns
number of GCPs for this dataset. Zero if there are none.

Reimplemented in GDALPamDataset.

◆ GetGCPProjection()

const char * GDALDataset::GetGCPProjection ( )
inherited

Get output projection for GCPs.

This method is the same as the C function GDALGetGCPProjection().

The projection string follows the normal rules from GetProjectionRef().

Note
Starting with GDAL 3.0, this is a compatibility layer around GetGCPSpatialRef()
Returns
internal projection string or "" if there are no GCPs. It should not be altered, freed or expected to last for long.

◆ GetGCPs()

const GDAL_GCP * GDALDataset::GetGCPs ( )
virtualinherited

Fetch GCPs.

This method is the same as the C function GDALGetGCPs().

Returns
pointer to internal GCP structure list. It should not be modified, and may change on the next GDAL call.

Reimplemented in GDALPamDataset.

◆ GetGCPSpatialRef()

const OGRSpatialReference * GDALDataset::GetGCPSpatialRef ( ) const
virtualinherited

Get output spatial reference system for GCPs.

Same as the C function GDALGetGCPSpatialRef().

When a SRS is not available, null is returned. If used on a dataset where there is a geotransform, and not GCPs, this method returns null. Use GetSpatialRef() instead.

Since
GDAL 3.0
Returns
a pointer to an internal object. It should not be altered or freed. Its lifetime will be the one of the dataset object, or until the next call to this method.

Reimplemented in GDALPamDataset.

◆ GetGeoTransform()

CPLErr GDALDataset::GetGeoTransform ( double *  padfTransform)
virtualinherited

Fetch the affine transformation coefficients.

Fetches the coefficients for transforming between pixel/line (P,L) raster space, and projection coordinates (Xp,Yp) space.

Xp = padfTransform[0] + P*padfTransform[1] + L*padfTransform[2];
Yp = padfTransform[3] + P*padfTransform[4] + L*padfTransform[5];

In a north up image, padfTransform[1] is the pixel width, and padfTransform[5] is the pixel height. The upper left corner of the upper left pixel is at position (padfTransform[0],padfTransform[3]).

The default transform is (0,1,0,0,0,1) and should be returned even when a CE_Failure error is returned, such as for formats that don't support transformation to projection coordinates.

This method does the same thing as the C GDALGetGeoTransform() function.

Parameters
padfTransforman existing six double buffer into which the transformation will be placed.
Returns
CE_None on success, or CE_Failure if no transform can be fetched.

Reimplemented in GDALPamDataset.

◆ GetInternalHandle()

void * GDALDataset::GetInternalHandle ( const char *  pszHandleName)
virtualinherited

Fetch a format specific internally meaningful handle.

This method is the same as the C GDALGetInternalHandle() method.

Parameters
pszHandleNamethe handle name desired. The meaningful names will be specific to the file format.
Returns
the desired handle value, or NULL if not recognized/supported.

◆ GetLayer()

virtual OGRLayer * GNMGenericNetwork::GetLayer ( int  iLayer)
overridevirtual

Fetch a layer by index.

The returned layer remains owned by the GDALDataset and should not be deleted by the application.

See GetLayers() for a C++ iterator version of this method.

This method is the same as the C function GDALDatasetGetLayer() and the deprecated OGR_DS_GetLayer().

In GDAL 1.X, this method used to be in the OGRDataSource class.

Parameters
iLayera layer number between 0 and GetLayerCount()-1.
Returns
the layer, or NULL if iLayer is out of range or an error occurs.
See also
GetLayers()

Reimplemented from GDALDataset.

◆ GetLayerByName()

OGRLayer * GDALDataset::GetLayerByName ( const char *  pszName)
virtualinherited

Fetch a layer by name.

The returned layer remains owned by the GDALDataset and should not be deleted by the application.

This method is the same as the C function GDALDatasetGetLayerByName() and the deprecated OGR_DS_GetLayerByName().

In GDAL 1.X, this method used to be in the OGRDataSource class.

Parameters
pszNamethe layer name of the layer to fetch.
Returns
the layer, or NULL if Layer is not found or an error occurs.

◆ GetLayerCount()

virtual int GNMGenericNetwork::GetLayerCount ( )
overridevirtual

Get the number of layers in this dataset.

This method is the same as the C function GDALDatasetGetLayerCount(), and the deprecated OGR_DS_GetLayerCount().

In GDAL 1.X, this method used to be in the OGRDataSource class.

Returns
layer count.

Reimplemented from GDALDataset.

◆ GetLayers()

GDALDataset::Layers GDALDataset::GetLayers ( )
inherited

Function that returns an iterable object over layers in the dataset.

This is a C++ iterator friendly version of GetLayer().

Typical use is:

for( auto&& poLayer: poDS->GetLayers() )
{
std::cout << "Layer << poLayer->GetName() << std::endl;
}
See also
GetLayer()
Since
GDAL 2.3

◆ GetMetadata()

char ** GDALDataset::GetMetadata ( const char *  pszDomain = "")
overridevirtualinherited

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().

Parameters
pszDomainthe domain of interest. Use "" or NULL for the default domain.
Returns
NULL or a string list.

Reimplemented from GDALMajorObject.

◆ GetMetadataDomainList()

char ** GDALDataset::GetMetadataDomainList ( )
overridevirtualinherited

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().

Returns
NULL or a string list. Must be freed with CSLDestroy()
Since
GDAL 1.11

Reimplemented from GDALMajorObject.

◆ GetMetadataItem()

const char * GDALMajorObject::GetMetadataItem ( const char *  pszName,
const char *  pszDomain = "" 
)
virtualinherited

Fetch single metadata item.

The C function GDALGetMetadataItem() does the same thing as this method.

Parameters
pszNamethe key for the metadata item to fetch.
pszDomainthe domain to fetch for, use NULL for the default domain.
Returns
NULL on failure to find the key, or a pointer to an internal copy of the value string on success.

Reimplemented in GDALPamDataset.

◆ GetMOFlags()

int GDALMajorObject::GetMOFlags ( ) const
inherited

Returns the GMO_ flags.

Returns
flags

◆ GetName()

const char * GNMNetwork::GetName ( ) const
virtualinherited

GetName - a network name.

The value provided to create function in GNM_MD_NAME key. While creation this value used to create the folder or db schema name. But can be changed after creation.

Returns
Network name string

◆ GetNewGlobalFID()

virtual GNMGFID GNMGenericNetwork::GetNewGlobalFID ( )
virtual

GetNewGlobalFID increase the global ID counter.

Returns
New global feature ID.

◆ GetNextFeature()

OGRFeature * GDALDataset::GetNextFeature ( OGRLayer **  ppoBelongingLayer,
double *  pdfProgressPct,
GDALProgressFunc  pfnProgress,
void *  pProgressData 
)
virtualinherited

Fetch the next available feature from this dataset.

This method is intended for the few drivers where OGRLayer::GetNextFeature() is not efficient, but in general OGRLayer::GetNextFeature() is a more natural API.

See GetFeatures() for a C++ iterator version of this method.

The returned feature becomes the responsibility of the caller to delete with OGRFeature::DestroyFeature().

Depending on the driver, this method may return features from layers in a non sequential way. This is what may happen when the ODsCRandomLayerRead capability is declared (for example for the OSM and GMLAS drivers). When datasets declare this capability, it is strongly advised to use GDALDataset::GetNextFeature() instead of OGRLayer::GetNextFeature(), as the later might have a slow, incomplete or stub implementation.

The default implementation, used by most drivers, will however iterate over each layer, and then over each feature within this layer.

This method takes into account spatial and attribute filters set on layers that will be iterated upon.

The ResetReading() method can be used to start at the beginning again.

Depending on drivers, this may also have the side effect of calling OGRLayer::GetNextFeature() on the layers of this dataset.

This method is the same as the C function GDALDatasetGetNextFeature().

Parameters
ppoBelongingLayera pointer to a OGRLayer* variable to receive the layer to which the object belongs to, or NULL. It is possible that the output of *ppoBelongingLayer to be NULL despite the feature not being NULL.
pdfProgressPcta pointer to a double variable to receive the percentage progress (in [0,1] range), or NULL. On return, the pointed value might be negative if determining the progress is not possible.
pfnProgressa progress callback to report progress (for GetNextFeature() calls that might have a long duration) and offer cancellation possibility, or NULL.
pProgressDatauser data provided to pfnProgress, or NULL
Returns
a feature, or NULL if no more features are available.
Since
GDAL 2.2
See also
GetFeatures()

◆ GetOpenDatasets()

GDALDataset ** GDALDataset::GetOpenDatasets ( int *  pnCount)
staticinherited

Fetch all open GDAL dataset handles.

This method is the same as the C function GDALGetOpenDatasets().

NOTE: This method is not thread safe. The returned list may change at any time and it should not be freed.

Parameters
pnCountinteger into which to place the count of dataset pointers being returned.
Returns
a pointer to an array of dataset handles.

◆ GetOpenOptions()

char ** GDALDataset::GetOpenOptions ( )
inlineinherited

Return open options.

Returns
open options.

◆ GetPath()

virtual OGRLayer * GNMGenericNetwork::GetPath ( GNMGFID  nStartFID,
GNMGFID  nEndFID,
GNMGraphAlgorithmType  eAlgorithm,
char **  papszOptions 
)
overridevirtual

Create path between start and end GFIDs.

Parameters
nStartFID- start identificator
nEndFID- end identificator
eAlgorithm- The algorithm to get path
papszOptions- algorithm specific options
Returns
In memory OGRLayer pointer with features constituting the shortest path (or paths). The caller have to free the pointer via
See also
ReleaseResultSet().

Implements GNMNetwork.

◆ GetProjectionRef()

const char * GDALDataset::GetProjectionRef ( void  ) const
inherited

Fetch the projection definition string for this dataset.

Same as the C function GDALGetProjectionRef().

The returned string defines the projection coordinate system of the image in OpenGIS WKT format. It should be suitable for use with the OGRSpatialReference class.

When a projection definition is not available an empty (but not NULL) string is returned.

Note
Startig with GDAL 3.0, this is a compatibility layer around GetSpatialRef()
Returns
a pointer to an internal projection reference string. It should not be altered, freed or expected to last for long.
See also
https://gdal.org/tutorials/osr_api_tut.html

◆ GetRasterBand()

GDALRasterBand * GDALDataset::GetRasterBand ( int  nBandId)
inherited

Fetch a band object for a dataset.

See GetBands() for a C++ iterator version of this method.

Equivalent of the C function GDALGetRasterBand().

Parameters
nBandIdthe index number of the band to fetch, from 1 to GetRasterCount().
Returns
the nBandId th band object

◆ GetRasterCount()

int GDALDataset::GetRasterCount ( )
inherited

Fetch the number of raster bands on this dataset.

Same as the C function GDALGetRasterCount().

Returns
the number of raster bands.

◆ GetRasterXSize()

int GDALDataset::GetRasterXSize ( )
inherited

Fetch raster width in pixels.

Equivalent of the C function GDALGetRasterXSize().

Returns
the width in pixels of raster bands in this GDALDataset.

◆ GetRasterYSize()

int GDALDataset::GetRasterYSize ( )
inherited

Fetch raster height in pixels.

Equivalent of the C function GDALGetRasterYSize().

Returns
the height in pixels of raster bands in this GDALDataset.

◆ GetRefCount()

int GDALDataset::GetRefCount ( ) const
inherited

Fetch reference count.

This method is the same as the C function OGR_DS_GetRefCount().

In GDAL 1.X, this method used to be in the OGRDataSource class.

Returns
the current reference count for the datasource object itself.

◆ GetRelationship()

const GDALRelationship * GDALDataset::GetRelationship ( const std::string &  name) const
virtualinherited

Get a relationship from its name.

Returns
the relationship, or nullptr if not found.
Since
GDAL 3.6

◆ GetRelationshipNames()

std::vector< std::string > GDALDataset::GetRelationshipNames ( CSLConstList  papszOptions = nullptr) const
virtualinherited

Returns a list of the names of all relationships stored in the dataset.

Parameters
papszOptionsDriver specific options determining how relationships should be retrieved. Pass nullptr for default behavior.
Returns
list of relationship names
Since
GDAL 3.6

◆ GetRootGroup()

std::shared_ptr< GDALGroup > GDALDataset::GetRootGroup ( ) const
virtualinherited

Return the root GDALGroup of this dataset.

Only valid for multidimensional datasets.

This is the same as the C function GDALDatasetGetRootGroup().

Since
GDAL 3.1

◆ GetRules()

virtual char ** GNMGenericNetwork::GetRules ( ) const
virtual

Get the rule list.

Returns
list of rule strings. The caller have to free the lis via CPLDestroy.

◆ GetShared()

int GDALDataset::GetShared ( ) const
inherited

Returns shared flag.

Returns
TRUE if the GDALDataset is available for sharing, or FALSE if not.

◆ GetSpatialRef()

const OGRSpatialReference * GNMNetwork::GetSpatialRef ( ) const
inlineoverridevirtualinherited

Fetch the spatial reference for this dataset.

Same as the C function GDALGetSpatialRef().

When a projection definition is not available, null is returned. If used on a dataset where there are GCPs and not a geotransform, this method returns null. Use GetGCPSpatialRef() instead.

Since
GDAL 3.0
Returns
a pointer to an internal object. It should not be altered or freed. Its lifetime will be the one of the dataset object, or until the next call to this method.
See also
https://gdal.org/tutorials/osr_api_tut.html

Reimplemented from GDALDataset.

◆ GetStyleTable()

OGRStyleTable * GDALDataset::GetStyleTable ( )
virtualinherited

Returns dataset style table.

This method is the same as the C function GDALDatasetGetStyleTable() and the deprecated OGR_DS_GetStyleTable().

In GDAL 1.X, this method used to be in the OGRDataSource class.

Returns
pointer to a style table which should not be modified or freed by the caller.

◆ GetSummaryRefCount()

int GDALDataset::GetSummaryRefCount ( ) const
inherited

Fetch reference count of datasource and all owned layers.

This method is the same as the C function OGR_DS_GetSummaryRefCount().

In GDAL 1.X, this method used to be in the OGRDataSource class.

Deprecated:
Returns
the current summary reference count for the datasource and its layers.

◆ GetVersion()

virtual int GNMGenericNetwork::GetVersion ( ) const
overridevirtual

GetVersion return the network version if applicable.

Returns
version value

Reimplemented from GNMNetwork.

◆ ICreateLayer()

OGRLayer * GDALDataset::ICreateLayer ( const char *  pszName,
OGRSpatialReference poSpatialRef = nullptr,
OGRwkbGeometryType  eGType = wkbUnknown,
char **  papszOptions = nullptr 
)
protectedvirtualinherited

This method attempts to create a new layer on the dataset with the indicated name, coordinate system, geometry type.

This method is reserved to implementation by drivers.

The papszOptions argument can be used to control driver specific creation options. These options are normally documented in the format specific documentation.

Parameters
pszNamethe name for the new layer. This should ideally not match any existing layer on the datasource.
poSpatialRefthe coordinate system to use for the new layer, or NULL if no coordinate system is available.
eGTypethe geometry type for the layer. Use wkbUnknown if there are no constraints on the types geometry to be written.
papszOptionsa StringList of name=value options. Options are driver specific.
Returns
NULL is returned on failure, or a new OGRLayer handle on success.
Since
GDAL 2.0

◆ IsLayerPrivate()

bool GDALDataset::IsLayerPrivate ( int  iLayer) const
virtualinherited

Returns true if the layer at the specified index is deemed a private or system table, or an internal detail only.

This method is the same as the C function GDALDatasetIsLayerPrivate().

Parameters
iLayera layer number between 0 and GetLayerCount()-1.
Returns
true if the layer is a private or system table.
Since
GDAL 3.4

◆ Open() [1/2]

static GDALDataset * GDALDataset::Open ( const char *  pszFilename,
unsigned int  nOpenFlags = 0,
const char *const *  papszAllowedDrivers = nullptr,
const char *const *  papszOpenOptions = nullptr,
const char *const *  papszSiblingFiles = nullptr 
)
inlinestaticinherited
See also
GDALOpenEx().
Since
GDAL 2.3

◆ Open() [2/2]

virtual CPLErr GNMNetwork::Open ( GDALOpenInfo poOpenInfo)
pure virtualinherited

Open a network.

Parameters
poOpenInfoGDALOpenInfo pointer
Returns
CE_None on success

◆ RasterIO()

CPLErr GDALDataset::RasterIO ( GDALRWFlag  eRWFlag,
int  nXOff,
int  nYOff,
int  nXSize,
int  nYSize,
void *  pData,
int  nBufXSize,
int  nBufYSize,
GDALDataType  eBufType,
int  nBandCount,
int *  panBandMap,
GSpacing  nPixelSpace,
GSpacing  nLineSpace,
GSpacing  nBandSpace,
GDALRasterIOExtraArg psExtraArg 
)
inherited

Read/write a region of image data from multiple bands.

This method allows reading a region of one or more GDALRasterBands from this dataset into a buffer, or writing data from a buffer into a region of the GDALRasterBands. It automatically takes care of data type translation if the data type (eBufType) of the buffer is different than that of the GDALRasterBand. The method also takes care of image decimation / replication if the buffer size (nBufXSize x nBufYSize) is different than the size of the region being accessed (nXSize x nYSize).

The nPixelSpace, nLineSpace and nBandSpace parameters allow reading into or writing from various organization of buffers.

For highest performance full resolution data access, read and write on "block boundaries" as returned by GetBlockSize(), or use the ReadBlock() and WriteBlock() methods.

This method is the same as the C GDALDatasetRasterIO() or GDALDatasetRasterIOEx() functions.

Parameters
eRWFlagEither GF_Read to read a region of data, or GF_Write to write a region of data.
nXOffThe pixel offset to the top left corner of the region of the band to be accessed. This would be zero to start from the left side.
nYOffThe line offset to the top left corner of the region of the band to be accessed. This would be zero to start from the top.
nXSizeThe width of the region of the band to be accessed in pixels.
nYSizeThe height of the region of the band to be accessed in lines.
pDataThe buffer into which the data should be read, or from which it should be written. This buffer must contain at least nBufXSize * nBufYSize * nBandCount words of type eBufType. It is organized in left to right,top to bottom pixel order. Spacing is controlled by the nPixelSpace, and nLineSpace parameters.
nBufXSizethe width of the buffer image into which the desired region is to be read, or from which it is to be written.
nBufYSizethe height of the buffer image into which the desired region is to be read, or from which it is to be written.
eBufTypethe type of the pixel values in the pData data buffer. The pixel values will automatically be translated to/from the GDALRasterBand data type as needed.
nBandCountthe number of bands being read or written.
panBandMapthe list of nBandCount band numbers being read/written. Note band numbers are 1 based. This may be NULL to select the first nBandCount bands.
nPixelSpaceThe byte offset from the start of one pixel value in pData to the start of the next pixel value within a scanline. If defaulted (0) the size of the datatype eBufType is used.
nLineSpaceThe byte offset from the start of one scanline in pData to the start of the next. If defaulted (0) the size of the datatype eBufType * nBufXSize is used.
nBandSpacethe byte offset from the start of one bands data to the start of the next. If defaulted (0) the value will be nLineSpace * nBufYSize implying band sequential organization of the data buffer.
psExtraArg(new in GDAL 2.0) pointer to a GDALRasterIOExtraArg structure with additional arguments to specify resampling and progress callback, or NULL for default behavior. The GDAL_RASTERIO_RESAMPLING configuration option can also be defined to override the default resampling to one of BILINEAR, CUBIC, CUBICSPLINE, LANCZOS, AVERAGE or MODE.
Returns
CE_Failure if the access fails, otherwise CE_None.

◆ ReconnectFeatures()

virtual CPLErr GNMGenericNetwork::ReconnectFeatures ( GNMGFID  nSrcFID,
GNMGFID  nTgtFID,
GNMGFID  nConFID,
double  dfCost = 1,
double  dfInvCost = 1,
GNMDirection  eDir = GNM_EDGE_DIR_BOTH 
)
virtual

Change connection attributes.

Search the connection by source feature identificator, target feature identificator and connection identificator.

Parameters
nSrcFID- source feature identificator
nTgtFID- target feature identificator
nConFID- connection feature identificator
dfCost- new cost moving from source to target
dfInvCost- new cost moving from target to source
eDir- new direction
Returns
CE_None on success

◆ Reference()

int GDALDataset::Reference ( )
inherited

Add one to dataset reference count.

The reference is one after instantiation.

This method is the same as the C GDALReferenceDataset() function.

Returns
the post-increment reference count.

◆ Release()

OGRErr GDALDataset::Release ( )
inherited

Drop a reference to this dataset, and if the reference count drops to one close (destroy) the dataset.

This method is the same as the C function OGRReleaseDataSource().

Deprecated:
. In GDAL 2, use GDALClose() instead
Returns
OGRERR_NONE on success or an error code.

◆ ReleaseRef()

int GDALDataset::ReleaseRef ( )
inherited

Drop a reference to this object, and destroy if no longer referenced.

Returns
TRUE if the object has been destroyed.
Since
GDAL 2.2

◆ ReleaseResultSet()

void GDALDataset::ReleaseResultSet ( OGRLayer poResultsSet)
virtualinherited

Release results of ExecuteSQL().

This method should only be used to deallocate OGRLayers resulting from an ExecuteSQL() call on the same GDALDataset. Failure to deallocate a results set before destroying the GDALDataset may cause errors.

This method is the same as the C function GDALDatasetReleaseResultSet() and the deprecated OGR_DS_ReleaseResultSet().

In GDAL 1.X, this method used to be in the OGRDataSource class.

Parameters
poResultsSetthe result of a previous ExecuteSQL() call.

◆ ReportError() [1/2]

void GDALDataset::ReportError ( const char *  pszDSName,
CPLErr  eErrClass,
CPLErrorNum  err_no,
const char *  fmt,
  ... 
)
staticinherited

Emits an error related to a dataset (static method)

This function is a wrapper for regular CPLError(). The only difference with CPLError() is that it prepends the error message with the dataset name.

Parameters
pszDSNamedataset name.
eErrClassone of CE_Warning, CE_Failure or CE_Fatal.
err_nothe error number (CPLE_*) from cpl_error.h.
fmta printf() style format string. Any additional arguments will be treated as arguments to fill in this format in a manner similar to printf().
Since
GDAL 3.2.0

◆ ReportError() [2/2]

void GDALDataset::ReportError ( CPLErr  eErrClass,
CPLErrorNum  err_no,
const char *  fmt,
  ... 
)
inherited

Emits an error related to a dataset.

This function is a wrapper for regular CPLError(). The only difference with CPLError() is that it prepends the error message with the dataset name.

Parameters
eErrClassone of CE_Warning, CE_Failure or CE_Fatal.
err_nothe error number (CPLE_*) from cpl_error.h.
fmta printf() style format string. Any additional arguments will be treated as arguments to fill in this format in a manner similar to printf().
Since
GDAL 1.9.0

◆ ResetReading()

void GDALDataset::ResetReading ( )
virtualinherited

Reset feature reading to start on the first feature.

This affects GetNextFeature().

Depending on drivers, this may also have the side effect of calling OGRLayer::ResetReading() on the layers of this dataset.

This method is the same as the C function GDALDatasetResetReading().

Since
GDAL 2.2

◆ RollbackTransaction()

OGRErr GDALDataset::RollbackTransaction ( )
virtualinherited

For datasources which support transactions, RollbackTransaction will roll back a datasource to its state before the start of the current transaction.

If no transaction is active, or the rollback fails, will return OGRERR_FAILURE. Datasources which do not support transactions will always return OGRERR_UNSUPPORTED_OPERATION.

This function is the same as the C function GDALDatasetRollbackTransaction().

Returns
OGRERR_NONE on success.
Since
GDAL 2.0

◆ SetDescription()

void GDALMajorObject::SetDescription ( const char *  pszNewDesc)
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.

◆ SetGCPs() [1/2]

CPLErr GDALDataset::SetGCPs ( int  nGCPCount,
const GDAL_GCP pasGCPList,
const char *  pszGCPProjection 
)
inherited

Assign GCPs.

This method is the same as the C function GDALSetGCPs().

This method assigns the passed set of GCPs to this dataset, as well as setting their coordinate system. Internally copies are made of the coordinate system and list of points, so the caller remains responsible for deallocating these arguments if appropriate.

Most formats do not support setting of GCPs, even formats that can handle GCPs. These formats will return CE_Failure.

Note
Startig with GDAL 3.0, this is a compatibility layer around SetGCPs(int, const GDAL_GCP*, const char*)
Parameters
nGCPCountnumber of GCPs being assigned.
pasGCPListarray of GCP structures being assign (nGCPCount in array).
pszGCPProjectionthe new OGC WKT coordinate system to assign for the GCP output coordinates. This parameter should be "" if no output coordinate system is known.
Returns
CE_None on success, CE_Failure on failure (including if action is not supported for this format).

◆ SetGCPs() [2/2]

CPLErr GDALDataset::SetGCPs ( int  nGCPCount,
const GDAL_GCP pasGCPList,
const OGRSpatialReference poGCP_SRS 
)
virtualinherited

Assign GCPs.

This method is the same as the C function GDALSetGCPs().

This method assigns the passed set of GCPs to this dataset, as well as setting their coordinate system. Internally copies are made of the coordinate system and list of points, so the caller remains responsible for deallocating these arguments if appropriate.

Most formats do not support setting of GCPs, even formats that can handle GCPs. These formats will return CE_Failure.

Since
GDAL 3.0
Parameters
nGCPCountnumber of GCPs being assigned.
pasGCPListarray of GCP structures being assign (nGCPCount in array).
poGCP_SRSthe new coordinate reference system to assign for the GCP output coordinates. This parameter should be null if no output coordinate system is known.
Returns
CE_None on success, CE_Failure on failure (including if action is not supported for this format).

Reimplemented in GDALPamDataset, and GDALPamDataset.

◆ SetGeoTransform()

CPLErr GDALDataset::SetGeoTransform ( double *  padfTransform)
virtualinherited

Set the affine transformation coefficients.

See GetGeoTransform() for details on the meaning of the padfTransform coefficients.

This method does the same thing as the C GDALSetGeoTransform() function.

Parameters
padfTransforma six double buffer containing the transformation coefficients to be written with the dataset.
Returns
CE_None on success, or CE_Failure if this transform cannot be written.

Reimplemented in GDALPamDataset.

◆ SetMetadata()

GDALDataset::SetMetadata ( char **  papszMetadata,
const char *  pszDomain 
)
overridevirtualinherited

Set metadata.

CAUTION: depending on the format, older values of the updated information might still be found in the file in a "ghost" state, even if no longer accessible through the GDAL API. This is for example the case of the GTiff format (this is not a exhaustive list)

The C function GDALSetMetadata() does the same thing as this method.

Parameters
papszMetadatathe metadata in name=value string list format to apply.
pszDomainthe domain of interest. Use "" or NULL for the default domain.
Returns
CE_None on success, CE_Failure on failure and CE_Warning if the metadata has been accepted, but is likely not maintained persistently by the underlying object between sessions.

Reimplemented from GDALMajorObject.

◆ SetMetadataItem()

GDALDataset::SetMetadataItem ( const char *  pszName,
const char *  pszValue,
const char *  pszDomain 
)
overridevirtualinherited

Set single metadata item.

CAUTION: depending on the format, older values of the updated information might still be found in the file in a "ghost" state, even if no longer accessible through the GDAL API. This is for example the case of the GTiff format (this is not a exhaustive list)

The C function GDALSetMetadataItem() does the same thing as this method.

Parameters
pszNamethe key for the metadata item to fetch.
pszValuethe value to assign to the key.
pszDomainthe domain to set within, use NULL for the default domain.
Returns
CE_None on success, or an error code on failure.

Reimplemented from GDALMajorObject.

◆ SetMOFlags()

void GDALMajorObject::SetMOFlags ( int  nNewFlags)
inherited

Assign GMO_flags.

Parameters
nNewFlagsnew flags.

◆ SetProjection()

CPLErr GDALDataset::SetProjection ( const char *  pszProjection)
inherited

Set the projection reference string for this dataset.

The string should be in OGC WKT or PROJ.4 format. An error may occur because of incorrectly specified projection strings, because the dataset is not writable, or because the dataset does not support the indicated projection. Many formats do not support writing projections.

This method is the same as the C GDALSetProjection() function.

Note
Startig with GDAL 3.0, this is a compatibility layer around SetSpatialRef()
Parameters
pszProjectionprojection reference string.
Returns
CE_Failure if an error occurs, otherwise CE_None.

◆ SetSpatialRef()

CPLErr GDALDataset::SetSpatialRef ( const OGRSpatialReference poSRS)
virtualinherited

Set the spatial reference system for this dataset.

An error may occur because the dataset is not writable, or because the dataset does not support the indicated projection. Many formats do not support writing projections.

This method is the same as the C GDALSetSpatialRef() function.

Since
GDAL 3.0
Parameters
poSRSspatial reference system object. nullptr can potentially be passed for drivers that support unsetting the SRS.
Returns
CE_Failure if an error occurs, otherwise CE_None.

Reimplemented in GDALPamDataset.

◆ SetStyleTable()

void GDALDataset::SetStyleTable ( OGRStyleTable poStyleTable)
virtualinherited

Set dataset style table.

This method operate exactly as SetStyleTableDirectly() except that it does not assume ownership of the passed table.

This method is the same as the C function GDALDatasetSetStyleTable() and the deprecated OGR_DS_SetStyleTable().

In GDAL 1.X, this method used to be in the OGRDataSource class.

Parameters
poStyleTablepointer to style table to set

◆ SetStyleTableDirectly()

void GDALDataset::SetStyleTableDirectly ( OGRStyleTable poStyleTable)
virtualinherited

Set dataset style table.

This method operate exactly as SetStyleTable() except that it assumes ownership of the passed table.

This method is the same as the C function GDALDatasetSetStyleTableDirectly() and the deprecated OGR_DS_SetStyleTableDirectly().

In GDAL 1.X, this method used to be in the OGRDataSource class.

Parameters
poStyleTablepointer to style table to set

◆ StartTransaction()

OGRErr GDALDataset::StartTransaction ( int  bForce = FALSE)
virtualinherited

For datasources which support transactions, StartTransaction creates a `transaction.

If starting the transaction fails, will return OGRERR_FAILURE. Datasources which do not support transactions will always return OGRERR_UNSUPPORTED_OPERATION.

Nested transactions are not supported.

All changes done after the start of the transaction are definitely applied in the datasource if CommitTransaction() is called. They may be canceled by calling RollbackTransaction() instead.

At the time of writing, transactions only apply on vector layers.

Datasets that support transactions will advertise the ODsCTransactions capability. Use of transactions at dataset level is generally preferred to transactions at layer level, whose scope is rarely limited to the layer from which it was started.

In case StartTransaction() fails, neither CommitTransaction() or RollbackTransaction() should be called.

If an error occurs after a successful StartTransaction(), the whole transaction may or may not be implicitly canceled, depending on drivers. (e.g. the PG driver will cancel it, SQLite/GPKG not). In any case, in the event of an error, an explicit call to RollbackTransaction() should be done to keep things balanced.

By default, when bForce is set to FALSE, only "efficient" transactions will be attempted. Some drivers may offer an emulation of transactions, but sometimes with significant overhead, in which case the user must explicitly allow for such an emulation by setting bForce to TRUE. Drivers that offer emulated transactions should advertise the ODsCEmulatedTransactions capability (and not ODsCTransactions).

This function is the same as the C function GDALDatasetStartTransaction().

Parameters
bForcecan be set to TRUE if an emulation, possibly slow, of a transaction mechanism is acceptable.
Returns
OGRERR_NONE on success.
Since
GDAL 2.0

◆ TestCapability()

virtual int GNMGenericNetwork::TestCapability ( const char *  pszCap)
overridevirtual

Test if capability is available.

One of the following dataset capability names can be passed into this method, and a TRUE or FALSE value will be returned indicating whether or not the capability is available for this object.

  • ODsCCreateLayer: True if this datasource can create new layers.

  • ODsCDeleteLayer: True if this datasource can delete existing layers.

  • ODsCCreateGeomFieldAfterCreateLayer: True if the layers of this datasource support CreateGeomField() just after layer creation.

  • ODsCCurveGeometries: True if this datasource supports curve geometries.

  • ODsCTransactions: True if this datasource supports (efficient) transactions.

  • ODsCEmulatedTransactions: True if this datasource supports transactions through emulation.

  • ODsCRandomLayerRead: True if this datasource has a dedicated GetNextFeature() implementation, potentially returning features from layers in a non sequential way.

  • ODsCRandomLayerWrite: True if this datasource supports calling CreateFeature() on layers in a non sequential way.

The #define macro forms of the capability names should be used in preference to the strings themselves to avoid misspelling.

This method is the same as the C function GDALDatasetTestCapability() and the deprecated OGR_DS_TestCapability().

In GDAL 1.X, this method used to be in the OGRDataSource class.

Parameters
pszCapthe capability to test.
Returns
TRUE if capability available otherwise FALSE.

Reimplemented from GDALDataset.

◆ ToHandle() [1/2]

static GDALDatasetH GDALDataset::ToHandle ( GDALDataset poDS)
inlinestaticinherited

Convert a GDALDataset* to a GDALDatasetH.

Since
GDAL 2.3

◆ ToHandle() [2/2]

static GDALMajorObjectH GDALMajorObject::ToHandle ( GDALMajorObject poMajorObject)
inlinestaticinherited

Convert a GDALMajorObject* to a GDALMajorObjectH.

Since
GDAL 2.3

◆ UpdateFieldDomain()

bool GDALDataset::UpdateFieldDomain ( std::unique_ptr< OGRFieldDomain > &&  domain,
std::string &  failureReason 
)
virtualinherited

Updates an existing field domain by replacing its definition.

The existing field domain with matching name will be replaced.

Only a few drivers will support this operation, and some of them might only support it only for some types of field domains. At the time of writing (GDAL 3.5), only the Memory driver supports this operation. A dataset having at least some support for this operation should report the ODsCUpdateFieldDomain dataset capability.

Anticipated failures will not be emitted through the CPLError() infrastructure, but will be reported in the failureReason output parameter.

Parameters
domainThe domain definition.
failureReasonOutput parameter. Will contain an error message if an error occurs.
Returns
true in case of success.
Since
GDAL 3.5

◆ UpdateRelationship()

bool GDALDataset::UpdateRelationship ( std::unique_ptr< GDALRelationship > &&  relationship,
std::string &  failureReason 
)
virtualinherited

Updates an existing relationship by replacing its definition.

The existing relationship with matching name will be replaced.

Only a few drivers will support this operation, and some of them might only support it only for some types of relationships. A dataset having at least some support for this operation should report the GDsCUpdateRelationship dataset capability.

Anticipated failures will not be emitted through the CPLError() infrastructure, but will be reported in the failureReason output parameter.

Parameters
relationshipThe relationship definition.
failureReasonOutput parameter. Will contain an error message if an error occurs.
Returns
true in case of success.
Since
GDAL 3.6

The documentation for this class was generated from the following file: