Python General API

Configuration Management

osgeo.gdal.GetCacheMax() GIntBig
osgeo.gdal.GetCacheUsed() GIntBig
osgeo.gdal.GetConfigOption(char const * pszKey, char const * pszDefault=None) char const *
osgeo.gdal.GetThreadLocalConfigOption(char const * pszKey, char const * pszDefault=None) char const *
osgeo.gdal.HasThreadSupport() int
osgeo.gdal.SetCacheMax(GIntBig nBytes)
osgeo.gdal.SetConfigOption(char const * pszKey, char const * pszValue)
osgeo.gdal.SetThreadLocalConfigOption(char const * pszKey, char const * pszValue)
osgeo.gdal.VersionInfo(char const * request="VERSION_NUM") char const *

Error Handling

osgeo.gdal.ConfigurePythonLogging(logger_name='gdal', enable_debug=False)

Configure GDAL to use Python's logging framework

osgeo.gdal.Debug(char const * msg_class, char const * message)
osgeo.gdal.DontUseExceptions()
osgeo.gdal.Error(CPLErr msg_class=CE_Failure, int err_code=0, char const * msg="error")
osgeo.gdal.ErrorReset()
osgeo.gdal.GetErrorCounter() unsigned int
osgeo.gdal.GetLastErrorMsg() char const *
osgeo.gdal.GetLastErrorNo() int
osgeo.gdal.GetLastErrorType() int
osgeo.gdal.GetUseExceptions() int
osgeo.gdal.PopErrorHandler()
osgeo.gdal.PushErrorHandler(CPLErrorHandler pfnErrorHandler=0) CPLErr
osgeo.gdal.SetCurrentErrorHandlerCatchDebug(int bCatchDebug)
osgeo.gdal.SetErrorHandler(CPLErrorHandler pfnErrorHandler=0) CPLErr
osgeo.gdal.UseExceptions()

File Management

osgeo.gdal_fsspec module

osgeo.gdal.VSIFile class

Low level functions

osgeo.gdal.CloseDir(VSIDIR * dir)
class osgeo.gdal.DirEntry(*args)

Proxy of C++ DirEntry class.

IsDirectory(DirEntry self) bool
property extra

p.p.char

Type:

extra

property mode

int

Type:

mode

property modeKnown

bool

Type:

modeKnown

property mtime

GIntBig

Type:

mtime

property mtimeKnown

bool

Type:

mtimeKnown

property name

p.char

Type:

name

property size

GIntBig

Type:

size

property sizeKnown

bool

Type:

sizeKnown

property thisown

The membership flag

osgeo.gdal.FileFromMemBuffer(char const * utf8_path, GIntBig nBytes)
osgeo.gdal.FindFile(char const * pszClass, char const * utf8_path) char const *
osgeo.gdal.GetFileMetadata(char const * utf8_path, char const * domain, char ** options=None) char **
osgeo.gdal.GetFileSystemOptions(char const * utf8_path) char const *
osgeo.gdal.GetFileSystemsPrefixes() char **
osgeo.gdal.Mkdir(char const * utf8_path, int mode) VSI_RETVAL
osgeo.gdal.MkdirRecursive(char const * utf8_path, int mode) VSI_RETVAL
osgeo.gdal.OpenDir(char const * utf8_path, int nRecurseDepth=-1, char ** options=None) VSIDIR *
osgeo.gdal.ReadDir(char const * utf8_path, int nMaxFiles=0) char **
osgeo.gdal.ReadDirRecursive(char const * utf8_path) char **
osgeo.gdal.Rename(char const * pszOld, char const * pszNew) VSI_RETVAL
osgeo.gdal.Rmdir(char const * utf8_path) VSI_RETVAL
osgeo.gdal.RmdirRecursive(char const * utf8_path) VSI_RETVAL
osgeo.gdal.SetFileMetadata(char const * utf8_path, char ** metadata, char const * domain, char ** options=None) bool
osgeo.gdal.UnlinkBatch(char ** files) bool