GDAL
Classes | Defines | Typedefs | Enumerations | Functions
gdal.h File Reference

Public (C callable) GDAL entry points. More...

Go to the source code of this file.

Classes

struct  GDAL_GCP
 Ground Control Point. More...
struct  GDALRPCInfo
struct  GDALColorEntry
 Color tuple. More...

Defines

#define GDALMD_AREA_OR_POINT   "AREA_OR_POINT"
#define GDALMD_AOP_AREA   "Area"
#define GDALMD_AOP_POINT   "Point"
#define CPLE_WrongFormat   200
#define GDAL_DMD_LONGNAME   "DMD_LONGNAME"
#define GDAL_DMD_HELPTOPIC   "DMD_HELPTOPIC"
#define GDAL_DMD_MIMETYPE   "DMD_MIMETYPE"
#define GDAL_DMD_EXTENSION   "DMD_EXTENSION"
#define GDAL_DMD_CREATIONOPTIONLIST   "DMD_CREATIONOPTIONLIST"
#define GDAL_DMD_CREATIONDATATYPES   "DMD_CREATIONDATATYPES"
#define GDAL_DMD_SUBDATASETS   "DMD_SUBDATASETS"
#define GDAL_DCAP_CREATE   "DCAP_CREATE"
#define GDAL_DCAP_CREATECOPY   "DCAP_CREATECOPY"
#define GDAL_DCAP_VIRTUALIO   "DCAP_VIRTUALIO"
#define SRCVAL(papoSource, eSrcType, ii)
 SRCVAL - Macro which may be used by pixel functions to obtain a pixel from a source buffer.
#define GMF_ALL_VALID   0x01
#define GMF_PER_DATASET   0x02
#define GMF_ALPHA   0x04
#define GMF_NODATA   0x08
#define GDAL_VERSION_INFO_DEFINED
#define GDAL_CHECK_VERSION(pszCallingComponentName)   GDALCheckVersion(GDAL_VERSION_MAJOR, GDAL_VERSION_MINOR, pszCallingComponentName)
 Helper macro for GDALCheckVersion()

Typedefs

typedef void * GDALMajorObjectH
 Opaque type used for the C bindings of the C++ GDALMajorObject class.
typedef void * GDALDatasetH
 Opaque type used for the C bindings of the C++ GDALDataset class.
typedef void * GDALRasterBandH
 Opaque type used for the C bindings of the C++ GDALRasterBand class.
typedef void * GDALDriverH
 Opaque type used for the C bindings of the C++ GDALDriver class.
typedef void * GDALColorTableH
 Opaque type used for the C bindings of the C++ GDALColorTable class.
typedef void * GDALRasterAttributeTableH
 Opaque type used for the C bindings of the C++ GDALRasterAttributeTable class.
typedef void * GDALAsyncReaderH
 Opaque type used for the C bindings of the C++ GDALAsyncReader class.
typedef CPLErr(* GDALDerivedPixelFunc )(void **papoSources, int nSources, void *pData, int nBufXSize, int nBufYSize, GDALDataType eSrcType, GDALDataType eBufType, int nPixelSpace, int nLineSpace)

Enumerations

enum  GDALDataType {
  GDT_Unknown = 0, GDT_Byte = 1, GDT_UInt16 = 2, GDT_Int16 = 3,
  GDT_UInt32 = 4, GDT_Int32 = 5, GDT_Float32 = 6, GDT_Float64 = 7,
  GDT_CInt16 = 8, GDT_CInt32 = 9, GDT_CFloat32 = 10, GDT_CFloat64 = 11,
  GDT_TypeCount = 12
}
enum  GDALAsyncStatusType {
  GARIO_PENDING = 0, GARIO_UPDATE = 1, GARIO_ERROR = 2, GARIO_COMPLETE = 3,
  GARIO_TypeCount = 4
}
 status of the asynchronous stream
enum  GDALAccess { GA_ReadOnly = 0, GA_Update = 1 }
enum  GDALRWFlag { GF_Read = 0, GF_Write = 1 }
enum  GDALColorInterp {
  GCI_Undefined = 0, GCI_GrayIndex = 1, GCI_PaletteIndex = 2, GCI_RedBand = 3,
  GCI_GreenBand = 4, GCI_BlueBand = 5, GCI_AlphaBand = 6, GCI_HueBand = 7,
  GCI_SaturationBand = 8, GCI_LightnessBand = 9, GCI_CyanBand = 10, GCI_MagentaBand = 11,
  GCI_YellowBand = 12, GCI_BlackBand = 13, GCI_YCbCr_YBand = 14, GCI_YCbCr_CbBand = 15,
  GCI_YCbCr_CrBand = 16, GCI_Max = 16
}
enum  GDALPaletteInterp { GPI_Gray = 0, GPI_RGB = 1, GPI_CMYK = 2, GPI_HLS = 3 }
enum  GDALRATFieldType { GFT_Integer, GFT_Real, GFT_String }
 Field type of raster attribute table. More...
enum  GDALRATFieldUsage {
  GFU_Generic = 0, GFU_PixelCount = 1, GFU_Name = 2, GFU_Min = 3,
  GFU_Max = 4, GFU_MinMax = 5, GFU_Red = 6, GFU_Green = 7,
  GFU_Blue = 8, GFU_Alpha = 9, GFU_RedMin = 10, GFU_GreenMin = 11,
  GFU_BlueMin = 12, GFU_AlphaMin = 13, GFU_RedMax = 14, GFU_GreenMax = 15,
  GFU_BlueMax = 16, GFU_AlphaMax = 17, GFU_MaxCount
}
 Field usage of raster attribute table. More...

Functions

int GDALGetDataTypeSize (GDALDataType)
 Get data type size in bits.
int GDALDataTypeIsComplex (GDALDataType)
 Is data type complex?
const char * GDALGetDataTypeName (GDALDataType)
 Get name of data type.
GDALDataType GDALGetDataTypeByName (const char *)
 Get data type by symbolic name.
GDALDataType GDALDataTypeUnion (GDALDataType, GDALDataType)
 Return the smallest data type that can fully express both input data types.
const char * GDALGetAsyncStatusTypeName (GDALAsyncStatusType)
 Get name of AsyncStatus data type.
GDALAsyncStatusType GDALGetAsyncStatusTypeByName (const char *)
 Get AsyncStatusType by symbolic name.
const char * GDALGetColorInterpretationName (GDALColorInterp)
 Get name of color interpretation.
GDALColorInterp GDALGetColorInterpretationByName (const char *pszName)
 Get color interpreation by symbolic name.
const char * GDALGetPaletteInterpretationName (GDALPaletteInterp)
 Get name of palette interpretation.
void GDALAllRegister (void)
 Register all known configured GDAL drivers.
GDALDatasetH GDALCreate (GDALDriverH hDriver, const char *, int, int, int, GDALDataType, char **) CPL_WARN_UNUSED_RESULT
 Create a new dataset with this driver.
GDALDatasetH GDALCreateCopy (GDALDriverH, const char *, GDALDatasetH, int, char **, GDALProgressFunc, void *) CPL_WARN_UNUSED_RESULT
 Create a copy of a dataset.
GDALDriverH GDALIdentifyDriver (const char *pszFilename, char **papszFileList)
 Identify the driver that can open a raster file.
GDALDatasetH GDALOpen (const char *pszFilename, GDALAccess eAccess) CPL_WARN_UNUSED_RESULT
 Open a raster file as a GDALDataset.
GDALDatasetH GDALOpenShared (const char *, GDALAccess) CPL_WARN_UNUSED_RESULT
 Open a raster file as a GDALDataset.
int GDALDumpOpenDatasets (FILE *)
 List open datasets.
GDALDriverH GDALGetDriverByName (const char *)
 Fetch a driver based on the short name.
int GDALGetDriverCount (void)
 Fetch the number of registered drivers.
GDALDriverH GDALGetDriver (int)
 Fetch driver by index.
void GDALDestroyDriver (GDALDriverH)
 Destroy a GDALDriver.
int GDALRegisterDriver (GDALDriverH)
 Register a driver for use.
void GDALDeregisterDriver (GDALDriverH)
 Deregister the passed driver.
void GDALDestroyDriverManager (void)
 Destroy the driver manager.
CPLErr GDALDeleteDataset (GDALDriverH, const char *)
 Delete named dataset.
CPLErr GDALRenameDataset (GDALDriverH, const char *pszNewName, const char *pszOldName)
 Rename a dataset.
CPLErr GDALCopyDatasetFiles (GDALDriverH, const char *pszNewName, const char *pszOldName)
 Copy the files of a dataset.
int GDALValidateCreationOptions (GDALDriverH, char **papszCreationOptions)
 Validate the list of creation options that are handled by a driver.
const char * GDALGetDriverShortName (GDALDriverH)
 Return the short name of a driver.
const char * GDALGetDriverLongName (GDALDriverH)
 Return the long name of a driver.
const char * GDALGetDriverHelpTopic (GDALDriverH)
 Return the URL to the help that describes the driver.
const char * GDALGetDriverCreationOptionList (GDALDriverH)
 Return the list of creation options of the driver.
void GDALInitGCPs (int, GDAL_GCP *)
void GDALDeinitGCPs (int, GDAL_GCP *)
GDAL_GCPGDALDuplicateGCPs (int, const GDAL_GCP *)
int GDALGCPsToGeoTransform (int nGCPCount, const GDAL_GCP *pasGCPs, double *padfGeoTransform, int bApproxOK)
 Generate Geotransform from GCPs.
int GDALInvGeoTransform (double *padfGeoTransformIn, double *padfInvGeoTransformOut)
 Invert Geotransform.
void GDALApplyGeoTransform (double *, double, double, double *, double *)
 Apply GeoTransform to x/y coordinate.
char ** GDALGetMetadata (GDALMajorObjectH, const char *)
 Fetch metadata.
CPLErr GDALSetMetadata (GDALMajorObjectH, char **, const char *)
 Set metadata.
const char * GDALGetMetadataItem (GDALMajorObjectH, const char *, const char *)
 Fetch single metadata item.
CPLErr GDALSetMetadataItem (GDALMajorObjectH, const char *, const char *, const char *)
 Set single metadata item.
const char * GDALGetDescription (GDALMajorObjectH)
 Fetch object description.
void GDALSetDescription (GDALMajorObjectH, const char *)
 Set object description.
GDALDriverH GDALGetDatasetDriver (GDALDatasetH)
 Fetch the driver to which this dataset relates.
char ** GDALGetFileList (GDALDatasetH)
 Fetch files forming dataset.
void GDALClose (GDALDatasetH)
 Close GDAL dataset.
int GDALGetRasterXSize (GDALDatasetH)
 Fetch raster width in pixels.
int GDALGetRasterYSize (GDALDatasetH)
 Fetch raster height in pixels.
int GDALGetRasterCount (GDALDatasetH)
 Fetch the number of raster bands on this dataset.
GDALRasterBandH GDALGetRasterBand (GDALDatasetH, int)
 Fetch a band object for a dataset.
CPLErr GDALAddBand (GDALDatasetH hDS, GDALDataType eType, char **papszOptions)
 Add a band to a dataset.
GDALAsyncReaderH GDALBeginAsyncReader (GDALDatasetH hDS, 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)
void GDALEndAsyncReader (GDALDatasetH hDS, GDALAsyncReaderH hAsynchReaderH)
CPLErr GDALDatasetRasterIO (GDALDatasetH hDS, GDALRWFlag eRWFlag, int nDSXOff, int nDSYOff, int nDSXSize, int nDSYSize, void *pBuffer, int nBXSize, int nBYSize, GDALDataType eBDataType, int nBandCount, int *panBandCount, int nPixelSpace, int nLineSpace, int nBandSpace)
 Read/write a region of image data from multiple bands.
CPLErr GDALDatasetAdviseRead (GDALDatasetH hDS, int nDSXOff, int nDSYOff, int nDSXSize, int nDSYSize, int nBXSize, int nBYSize, GDALDataType eBDataType, int nBandCount, int *panBandCount, char **papszOptions)
 Advise driver of upcoming read requests.
const char * GDALGetProjectionRef (GDALDatasetH)
 Fetch the projection definition string for this dataset.
CPLErr GDALSetProjection (GDALDatasetH, const char *)
 Set the projection reference string for this dataset.
CPLErr GDALGetGeoTransform (GDALDatasetH, double *)
 Fetch the affine transformation coefficients.
CPLErr GDALSetGeoTransform (GDALDatasetH, double *)
 Set the affine transformation coefficients.
int GDALGetGCPCount (GDALDatasetH)
 Get number of GCPs.
const char * GDALGetGCPProjection (GDALDatasetH)
 Get output projection for GCPs.
const GDAL_GCPGDALGetGCPs (GDALDatasetH)
 Fetch GCPs.
CPLErr GDALSetGCPs (GDALDatasetH, int, const GDAL_GCP *, const char *)
 Assign GCPs.
void * GDALGetInternalHandle (GDALDatasetH, const char *)
 Fetch a format specific internally meaningful handle.
int GDALReferenceDataset (GDALDatasetH)
 Add one to dataset reference count.
int GDALDereferenceDataset (GDALDatasetH)
 Subtract one from dataset reference count.
CPLErr GDALBuildOverviews (GDALDatasetH, const char *, int, int *, int, int *, GDALProgressFunc, void *)
 Build raster overview(s)
void GDALGetOpenDatasets (GDALDatasetH **hDS, int *pnCount)
 Fetch all open GDAL dataset handles.
int GDALGetAccess (GDALDatasetH hDS)
 Return access flag.
void GDALFlushCache (GDALDatasetH hDS)
 Flush all write cached data to disk.
CPLErr GDALCreateDatasetMaskBand (GDALDatasetH hDS, int nFlags)
 Adds a mask band to the dataset.
CPLErr GDALDatasetCopyWholeRaster (GDALDatasetH hSrcDS, GDALDatasetH hDstDS, char **papszOptions, GDALProgressFunc pfnProgress, void *pProgressData)
 Copy all dataset raster data.
CPLErr GDALRasterBandCopyWholeRaster (GDALRasterBandH hSrcBand, GDALRasterBandH hDstBand, char **papszOptions, GDALProgressFunc pfnProgress, void *pProgressData)
 Copy all raster band raster data.
CPLErr GDALRegenerateOverviews (GDALRasterBandH hSrcBand, int nOverviewCount, GDALRasterBandH *pahOverviewBands, const char *pszResampling, GDALProgressFunc pfnProgress, void *pProgressData)
 Generate downsampled overviews.
GDALDataType GDALGetRasterDataType (GDALRasterBandH)
 Fetch the pixel data type for this band.
void GDALGetBlockSize (GDALRasterBandH, int *pnXSize, int *pnYSize)
 Fetch the "natural" block size of this band.
CPLErr GDALRasterAdviseRead (GDALRasterBandH hRB, int nDSXOff, int nDSYOff, int nDSXSize, int nDSYSize, int nBXSize, int nBYSize, GDALDataType eBDataType, char **papszOptions)
 Advise driver of upcoming read requests.
CPLErr GDALRasterIO (GDALRasterBandH hRBand, GDALRWFlag eRWFlag, int nDSXOff, int nDSYOff, int nDSXSize, int nDSYSize, void *pBuffer, int nBXSize, int nBYSize, GDALDataType eBDataType, int nPixelSpace, int nLineSpace)
 Read/write a region of image data for this band.
CPLErr GDALReadBlock (GDALRasterBandH, int, int, void *)
 Read a block of image data efficiently.
CPLErr GDALWriteBlock (GDALRasterBandH, int, int, void *)
 Write a block of image data efficiently.
int GDALGetRasterBandXSize (GDALRasterBandH)
 Fetch XSize of raster.
int GDALGetRasterBandYSize (GDALRasterBandH)
 Fetch YSize of raster.
GDALAccess GDALGetRasterAccess (GDALRasterBandH)
 Find out if we have update permission for this band.
int GDALGetBandNumber (GDALRasterBandH)
 Fetch the band number.
GDALDatasetH GDALGetBandDataset (GDALRasterBandH)
 Fetch the owning dataset handle.
GDALColorInterp GDALGetRasterColorInterpretation (GDALRasterBandH)
 How should this band be interpreted as color?
CPLErr GDALSetRasterColorInterpretation (GDALRasterBandH, GDALColorInterp)
 Set color interpretation of a band.
GDALColorTableH GDALGetRasterColorTable (GDALRasterBandH)
 Fetch the color table associated with band.
CPLErr GDALSetRasterColorTable (GDALRasterBandH, GDALColorTableH)
 Set the raster color table.
int GDALHasArbitraryOverviews (GDALRasterBandH)
 Check for arbitrary overviews.
int GDALGetOverviewCount (GDALRasterBandH)
 Return the number of overview layers available.
GDALRasterBandH GDALGetOverview (GDALRasterBandH, int)
 Fetch overview raster band object.
double GDALGetRasterNoDataValue (GDALRasterBandH, int *)
 Fetch the no data value for this band.
CPLErr GDALSetRasterNoDataValue (GDALRasterBandH, double)
 Set the no data value for this band.
char ** GDALGetRasterCategoryNames (GDALRasterBandH)
 Fetch the list of category names for this raster.
CPLErr GDALSetRasterCategoryNames (GDALRasterBandH, char **)
 Set the category names for this band.
double GDALGetRasterMinimum (GDALRasterBandH, int *pbSuccess)
 Fetch the minimum value for this band.
double GDALGetRasterMaximum (GDALRasterBandH, int *pbSuccess)
 Fetch the maximum value for this band.
CPLErr GDALGetRasterStatistics (GDALRasterBandH, int bApproxOK, int bForce, double *pdfMin, double *pdfMax, double *pdfMean, double *pdfStdDev)
 Fetch image statistics.
CPLErr GDALComputeRasterStatistics (GDALRasterBandH, int bApproxOK, double *pdfMin, double *pdfMax, double *pdfMean, double *pdfStdDev, GDALProgressFunc pfnProgress, void *pProgressData)
 Compute image statistics.
CPLErr GDALSetRasterStatistics (GDALRasterBandH hBand, double dfMin, double dfMax, double dfMean, double dfStdDev)
 Set statistics on band.
const char * GDALGetRasterUnitType (GDALRasterBandH)
 Return raster unit type.
CPLErr GDALSetRasterUnitType (GDALRasterBandH hBand, const char *pszNewValue)
 Set unit type.
double GDALGetRasterOffset (GDALRasterBandH, int *pbSuccess)
 Fetch the raster value offset.
CPLErr GDALSetRasterOffset (GDALRasterBandH hBand, double dfNewOffset)
 Set scaling offset.
double GDALGetRasterScale (GDALRasterBandH, int *pbSuccess)
 Fetch the raster value scale.
CPLErr GDALSetRasterScale (GDALRasterBandH hBand, double dfNewOffset)
 Set scaling ratio.
void GDALComputeRasterMinMax (GDALRasterBandH hBand, int bApproxOK, double adfMinMax[2])
 Compute the min/max values for a band.
CPLErr GDALFlushRasterCache (GDALRasterBandH hBand)
 Flush raster data cache.
CPLErr GDALGetRasterHistogram (GDALRasterBandH hBand, double dfMin, double dfMax, int nBuckets, int *panHistogram, int bIncludeOutOfRange, int bApproxOK, GDALProgressFunc pfnProgress, void *pProgressData)
 Compute raster histogram.
CPLErr GDALGetDefaultHistogram (GDALRasterBandH hBand, double *pdfMin, double *pdfMax, int *pnBuckets, int **ppanHistogram, int bForce, GDALProgressFunc pfnProgress, void *pProgressData)
 Fetch default raster histogram.
CPLErr GDALSetDefaultHistogram (GDALRasterBandH hBand, double dfMin, double dfMax, int nBuckets, int *panHistogram)
 Set default histogram.
int GDALGetRandomRasterSample (GDALRasterBandH, int, float *)
GDALRasterBandH GDALGetRasterSampleOverview (GDALRasterBandH, int)
 Fetch best sampling overview.
CPLErr GDALFillRaster (GDALRasterBandH hBand, double dfRealValue, double dfImaginaryValue)
 Fill this band with a constant value.
CPLErr GDALComputeBandStats (GDALRasterBandH hBand, int nSampleStep, double *pdfMean, double *pdfStdDev, GDALProgressFunc pfnProgress, void *pProgressData)
CPLErr GDALOverviewMagnitudeCorrection (GDALRasterBandH hBaseBand, int nOverviewCount, GDALRasterBandH *pahOverviews, GDALProgressFunc pfnProgress, void *pProgressData)
GDALRasterAttributeTableH GDALGetDefaultRAT (GDALRasterBandH hBand)
 Fetch default Raster Attribute Table.
CPLErr GDALSetDefaultRAT (GDALRasterBandH, GDALRasterAttributeTableH)
 Set default Raster Attribute Table.
CPLErr GDALAddDerivedBandPixelFunc (const char *pszName, GDALDerivedPixelFunc pfnPixelFunc)
 This adds a pixel function to the global list of available pixel functions for derived bands.
GDALRasterBandH GDALGetMaskBand (GDALRasterBandH hBand)
 Return the mask band associated with the band.
int GDALGetMaskFlags (GDALRasterBandH hBand)
 Return the status flags of the mask band associated with the band.
CPLErr GDALCreateMaskBand (GDALRasterBandH hBand, int nFlags)
 Adds a mask band to the current band.
GDALAsyncStatusType GDALARGetNextUpdatedRegion (GDALAsyncReaderH hARIO, double dfTimeout, int *pnXBufOff, int *pnYBufOff, int *pnXBufSize, int *pnYBufSize)
int GDALARLockBuffer (GDALAsyncReaderH hARIO, double dfTimeout)
void GDALARUnlockBuffer (GDALAsyncReaderH hARIO)
int GDALGeneralCmdLineProcessor (int nArgc, char ***ppapszArgv, int nOptions)
 General utility option processing.
void GDALSwapWords (void *pData, int nWordSize, int nWordCount, int nWordSkip)
 Byte swap words in-place.
void GDALCopyWords (void *pSrcData, GDALDataType eSrcType, int nSrcPixelOffset, void *pDstData, GDALDataType eDstType, int nDstPixelOffset, int nWordCount)
 Copy pixel words from buffer to buffer.
void GDALCopyBits (const GByte *pabySrcData, int nSrcOffset, int nSrcStep, GByte *pabyDstData, int nDstOffset, int nDstStep, int nBitCount, int nStepCount)
 Bitwise word copying.
int GDALLoadWorldFile (const char *, double *)
 Read ESRI world file.
int GDALReadWorldFile (const char *, const char *, double *)
 Read ESRI world file.
int GDALWriteWorldFile (const char *, const char *, double *)
 Write ESRI world file.
int GDALLoadTabFile (const char *, double *, char **, int *, GDAL_GCP **)
int GDALReadTabFile (const char *, double *, char **, int *, GDAL_GCP **)
int GDALLoadOziMapFile (const char *, double *, char **, int *, GDAL_GCP **)
int GDALReadOziMapFile (const char *, double *, char **, int *, GDAL_GCP **)
char ** GDALLoadRPBFile (const char *pszFilename, char **papszSiblingFiles)
char ** GDALLoadRPCFile (const char *pszFilename, char **papszSiblingFiles)
CPLErr GDALWriteRPBFile (const char *pszFilename, char **papszMD)
char ** GDALLoadIMDFile (const char *pszFilename, char **papszSiblingFiles)
CPLErr GDALWriteIMDFile (const char *pszFilename, char **papszMD)
const char * GDALDecToDMS (double, const char *, int)
double GDALPackedDMSToDec (double)
 Convert a packed DMS value (DDDMMMSSS.SS) into decimal degrees.
double GDALDecToPackedDMS (double)
 Convert decimal degrees into packed DMS value (DDDMMMSSS.SS).
const char * GDALVersionInfo (const char *)
 Get runtime version information.
int GDALCheckVersion (int nVersionMajor, int nVersionMinor, const char *pszCallingComponentName)
 Return TRUE if GDAL library version at runtime matches nVersionMajor.nVersionMinor.
int GDALExtractRPCInfo (char **, GDALRPCInfo *)
GDALColorTableH GDALCreateColorTable (GDALPaletteInterp)
 Construct a new color table.
void GDALDestroyColorTable (GDALColorTableH)
 Destroys a color table.
GDALColorTableH GDALCloneColorTable (GDALColorTableH)
 Make a copy of a color table.
GDALPaletteInterp GDALGetPaletteInterpretation (GDALColorTableH)
 Fetch palette interpretation.
int GDALGetColorEntryCount (GDALColorTableH)
 Get number of color entries in table.
const GDALColorEntryGDALGetColorEntry (GDALColorTableH, int)
 Fetch a color entry from table.
int GDALGetColorEntryAsRGB (GDALColorTableH, int, GDALColorEntry *)
 Fetch a table entry in RGB format.
void GDALSetColorEntry (GDALColorTableH, int, const GDALColorEntry *)
 Set entry in color table.
void GDALCreateColorRamp (GDALColorTableH hTable, int nStartIndex, const GDALColorEntry *psStartColor, int nEndIndex, const GDALColorEntry *psEndColor)
 Create color ramp.
GDALRasterAttributeTableH GDALCreateRasterAttributeTable (void)
 Construct empty table.
void GDALDestroyRasterAttributeTable (GDALRasterAttributeTableH)
 Destroys a RAT.
int GDALRATGetColumnCount (GDALRasterAttributeTableH)
 Fetch table column count.
const char * GDALRATGetNameOfCol (GDALRasterAttributeTableH, int)
 Fetch name of indicated column.
GDALRATFieldUsage GDALRATGetUsageOfCol (GDALRasterAttributeTableH, int)
 Fetch column usage value.
GDALRATFieldType GDALRATGetTypeOfCol (GDALRasterAttributeTableH, int)
 Fetch column type.
int GDALRATGetColOfUsage (GDALRasterAttributeTableH, GDALRATFieldUsage)
 Fetch column index for given usage.
int GDALRATGetRowCount (GDALRasterAttributeTableH)
 Fetch row count.
const char * GDALRATGetValueAsString (GDALRasterAttributeTableH, int, int)
 Fetch field value as a string.
int GDALRATGetValueAsInt (GDALRasterAttributeTableH, int, int)
 Fetch field value as a integer.
double GDALRATGetValueAsDouble (GDALRasterAttributeTableH, int, int)
 Fetch field value as a double.
void GDALRATSetValueAsString (GDALRasterAttributeTableH, int, int, const char *)
 Set field value from string.
void GDALRATSetValueAsInt (GDALRasterAttributeTableH, int, int, int)
 Set field value from integer.
void GDALRATSetValueAsDouble (GDALRasterAttributeTableH, int, int, double)
 Set field value from double.
void GDALRATSetRowCount (GDALRasterAttributeTableH, int)
 Set row count.
CPLErr GDALRATCreateColumn (GDALRasterAttributeTableH, const char *, GDALRATFieldType, GDALRATFieldUsage)
 Create new column.
CPLErr GDALRATSetLinearBinning (GDALRasterAttributeTableH, double, double)
 Set linear binning information.
int GDALRATGetLinearBinning (GDALRasterAttributeTableH, double *, double *)
 Get linear binning information.
CPLErr GDALRATInitializeFromColorTable (GDALRasterAttributeTableH, GDALColorTableH)
 Initialize from color table.
GDALColorTableH GDALRATTranslateToColorTable (GDALRasterAttributeTableH, int nEntryCount)
 Translate to a color table.
void GDALRATDumpReadable (GDALRasterAttributeTableH, FILE *)
 Dump RAT in readable form.
GDALRasterAttributeTableH GDALRATClone (GDALRasterAttributeTableH)
 Copy Raster Attribute Table.
int GDALRATGetRowOfValue (GDALRasterAttributeTableH, double)
 Get row for pixel value.
void GDALSetCacheMax (int nBytes)
 Set maximum cache memory.
int GDALGetCacheMax (void)
 Get maximum cache memory.
int GDALGetCacheUsed (void)
 Get cache memory used.
void GDALSetCacheMax64 (GIntBig nBytes)
 Set maximum cache memory.
GIntBig GDALGetCacheMax64 (void)
 Get maximum cache memory.
GIntBig GDALGetCacheUsed64 (void)
 Get cache memory used.
int GDALFlushCacheBlock (void)
 Try to flush one cached raster block.

Detailed Description

Public (C callable) GDAL entry points.


Define Documentation

#define GDAL_CHECK_VERSION (   pszCallingComponentName)    GDALCheckVersion(GDAL_VERSION_MAJOR, GDAL_VERSION_MINOR, pszCallingComponentName)

Helper macro for GDALCheckVersion()

See also:
GDALCheckVersion()
#define SRCVAL (   papoSource,
  eSrcType,
  ii 
)
Value:
(eSrcType == GDT_Byte ? \
          ((GByte *)papoSource)[ii] : \
      (eSrcType == GDT_Float32 ? \
          ((float *)papoSource)[ii] : \
      (eSrcType == GDT_Float64 ? \
          ((double *)papoSource)[ii] : \
      (eSrcType == GDT_Int32 ? \
          ((GInt32 *)papoSource)[ii] : \
      (eSrcType == GDT_UInt16 ? \
          ((GUInt16 *)papoSource)[ii] : \
      (eSrcType == GDT_Int16 ? \
          ((GInt16 *)papoSource)[ii] : \
      (eSrcType == GDT_UInt32 ? \
          ((GUInt32 *)papoSource)[ii] : \
      (eSrcType == GDT_CInt16 ? \
          ((GInt16 *)papoSource)[ii * 2] : \
      (eSrcType == GDT_CInt32 ? \
          ((GInt32 *)papoSource)[ii * 2] : \
      (eSrcType == GDT_CFloat32 ? \
          ((float *)papoSource)[ii * 2] : \
      (eSrcType == GDT_CFloat64 ? \
          ((double *)papoSource)[ii * 2] : 0)))))))))))

SRCVAL - Macro which may be used by pixel functions to obtain a pixel from a source buffer.


Enumeration Type Documentation

enum GDALAccess

Flag indicating read/write, or read-only access to data.

Enumerator:
GA_ReadOnly 

Read only (no update) access

GA_Update 

Read/write access.

Types of color interpretation for raster bands.

Enumerator:
GCI_GrayIndex 

Greyscale

GCI_PaletteIndex 

Paletted (see associated color table)

GCI_RedBand 

Red band of RGBA image

GCI_GreenBand 

Green band of RGBA image

GCI_BlueBand 

Blue band of RGBA image

GCI_AlphaBand 

Alpha (0=transparent, 255=opaque)

GCI_HueBand 

Hue band of HLS image

GCI_SaturationBand 

Saturation band of HLS image

GCI_LightnessBand 

Lightness band of HLS image

GCI_CyanBand 

Cyan band of CMYK image

GCI_MagentaBand 

Magenta band of CMYK image

GCI_YellowBand 

Yellow band of CMYK image

GCI_BlackBand 

Black band of CMLY image

GCI_YCbCr_YBand 

Y Luminance

GCI_YCbCr_CbBand 

Cb Chroma

GCI_YCbCr_CrBand 

Cr Chroma

GCI_Max 

Max current value

Pixel data types

Enumerator:
GDT_Unknown 

Unknown or unspecified type

GDT_Byte 

Eight bit unsigned integer

GDT_UInt16 

Sixteen bit unsigned integer

GDT_Int16 

Sixteen bit signed integer

GDT_UInt32 

Thirty two bit unsigned integer

GDT_Int32 

Thirty two bit signed integer

GDT_Float32 

Thirty two bit floating point

GDT_Float64 

Sixty four bit floating point

GDT_CInt16 

Complex Int16

GDT_CInt32 

Complex Int32

GDT_CFloat32 

Complex Float32

GDT_CFloat64 

Complex Float64

Types of color interpretations for a GDALColorTable.

Enumerator:
GPI_Gray 

Grayscale (in GDALColorEntry.c1)

GPI_RGB 

Red, Green, Blue and Alpha in (in c1, c2, c3 and c4)

GPI_CMYK 

Cyan, Magenta, Yellow and Black (in c1, c2, c3 and c4)

GPI_HLS 

Hue, Lightness and Saturation (in c1, c2, and c3)

Field type of raster attribute table.

Enumerator:
GFT_Integer 

Integer field

GFT_Real 

Floating point (double) field

GFT_String 

String field

Field usage of raster attribute table.

Enumerator:
GFU_Generic 

General purpose field.

GFU_PixelCount 

Histogram pixel count

GFU_Name 

Class name

GFU_Min 

Class range minimum

GFU_Max 

Class range maximum

GFU_MinMax 

Class value (min=max)

GFU_Red 

Red class color (0-255)

GFU_Green 

Green class color (0-255)

GFU_Blue 

Blue class color (0-255)

GFU_Alpha 

Alpha (0=transparent,255=opaque)

GFU_RedMin 

Color Range Red Minimum

GFU_GreenMin 

Color Range Green Minimum

GFU_BlueMin 

Color Range Blue Minimum

GFU_AlphaMin 

Color Range Alpha Minimum

GFU_RedMax 

Color Range Red Maximum

GFU_GreenMax 

Color Range Green Maximum

GFU_BlueMax 

Color Range Blue Maximum

GFU_AlphaMax 

Color Range Alpha Maximum

GFU_MaxCount 

Maximum GFU value

enum GDALRWFlag

Read/Write flag for RasterIO() method

Enumerator:
GF_Read 

Read data

GF_Write 

Write data


Function Documentation

CPLErr GDALAddBand ( GDALDatasetH  hDataset,
GDALDataType  eType,
char **  papszOptions 
)

Add a band to a dataset.

See also:
GDALDataset::AddBand().
CPLErr GDALAddDerivedBandPixelFunc ( const char *  pszFuncName,
GDALDerivedPixelFunc  pfnNewFunction 
)

This adds a pixel function to the global list of available pixel functions for derived bands.

Pixel functions must be registered in this way before a derived band tries to access data.

Derived bands are stored with only the name of the pixel function that it will apply, and if a pixel function matching the name is not found the IRasterIO() call will do nothing.

Parameters:
pszFuncNameName used to access pixel function
pfnNewFunctionPixel function associated with name. An existing pixel function registered with the same name will be replaced with the new one.
Returns:
CE_None, invalid (NULL) parameters are currently ignored.
void GDALAllRegister ( void  )

Register all known configured GDAL drivers.

This function will drive any of the following that are configured into GDAL. Many others as well haven't been updated in this documentation (see full list):

  • GeoTIFF (GTiff)
  • Geosoft GXF (GXF)
  • Erdas Imagine (HFA)
  • CEOS (CEOS)
  • ELAS (ELAS)
  • Arc/Info Binary Grid (AIGrid)
  • SDTS Raster DEM (SDTS)
  • OGDI (OGDI)
  • ESRI Labelled BIL (EHdr)
  • PCI .aux Labelled Raw Raster (PAux)
  • HDF4 Hierachal Data Format Release 4
  • HDF5 Hierachal Data Format Release 5
  • GSAG Golden Software ASCII Grid
  • GSBG Golden Software Binary Grid

This function should generally be called once at the beginning of the application.

void GDALApplyGeoTransform ( double *  padfGeoTransform,
double  dfPixel,
double  dfLine,
double *  pdfGeoX,
double *  pdfGeoY 
)

Apply GeoTransform to x/y coordinate.

Applies the following computation, converting a (pixel,line) coordinate into a georeferenced (geo_x,geo_y) location.

*pdfGeoX = padfGeoTransform[0] + dfPixel * padfGeoTransform[1] + dfLine * padfGeoTransform[2]; *pdfGeoY = padfGeoTransform[3] + dfPixel * padfGeoTransform[4] + dfLine * padfGeoTransform[5];

Parameters:
padfGeoTransformSix coefficient GeoTransform to apply.
dfPixelInput pixel position.
dfLineInput line position.
pdfGeoXoutput location where geo_x (easting/longitude) location is placed.
pdfGeoYoutput location where geo_y (northing/latitude) location is placed.
CPLErr GDALBuildOverviews ( GDALDatasetH  hDataset,
const char *  pszResampling,
int  nOverviews,
int *  panOverviewList,
int  nListBands,
int *  panBandList,
GDALProgressFunc  pfnProgress,
void *  pProgressData 
)

Build raster overview(s)

See also:
GDALDataset::BuildOverviews()
int GDALCheckVersion ( int  nVersionMajor,
int  nVersionMinor,
const char *  pszCallingComponentName 
)

Return TRUE if GDAL library version at runtime matches nVersionMajor.nVersionMinor.

The purpose of this method is to ensure that calling code will run with the GDAL version it is compiled for. It is primarly intented for external plugins.

Parameters:
nVersionMajorMajor version to be tested against
nVersionMinorMinor version to be tested against
pszCallingComponentNameIf not NULL, in case of version mismatch, the method will issue a failure mentionning the name of the calling component.
Returns:
TRUE if GDAL library version at runtime matches nVersionMajor.nVersionMinor, FALSE otherwise.

Make a copy of a color table.

This function is the same as the C++ method GDALColorTable::Clone()

void GDALClose ( GDALDatasetH  hDS)

Close GDAL dataset.

For non-shared datasets (opened with GDALOpen()) the dataset is closed using the C++ "delete" operator, recovering all dataset related resources. For shared datasets (opened with GDALOpenShared()) the dataset is dereferenced, and closed only if the referenced count has dropped below 1.

Parameters:
hDSThe dataset to close. May be cast from a "GDALDataset *".
void GDALComputeRasterMinMax ( GDALRasterBandH  hBand,
int  bApproxOK,
double  adfMinMax[2] 
)

Compute the min/max values for a band.

See also:
GDALRasterBand::ComputeRasterMinMax()
CPLErr GDALComputeRasterStatistics ( GDALRasterBandH  hBand,
int  bApproxOK,
double *  pdfMin,
double *  pdfMax,
double *  pdfMean,
double *  pdfStdDev,
GDALProgressFunc  pfnProgress,
void *  pProgressData 
)

Compute image statistics.

See also:
GDALRasterBand::ComputeStatistics()
void GDALCopyBits ( const GByte *  pabySrcData,
int  nSrcOffset,
int  nSrcStep,
GByte *  pabyDstData,
int  nDstOffset,
int  nDstStep,
int  nBitCount,
int  nStepCount 
)

Bitwise word copying.

A function for moving sets of partial bytes around. Loosely speaking this is a bitswise analog to GDALCopyWords().

It copies nStepCount "words" where each word is nBitCount bits long. The nSrcStep and nDstStep are the number of bits from the start of one word to the next (same as nBitCount if they are packed). The nSrcOffset and nDstOffset are the offset into the source and destination buffers to start at, also measured in bits.

All bit offsets are assumed to start from the high order bit in a byte (ie. most significant bit first). Currently this function is not very optimized, but it may be improved for some common cases in the future as needed.

Parameters:
pabySrcDatathe source data buffer.
nSrcOffsetthe offset (in bits) in pabySrcData to the start of the first word to copy.
nSrcStepthe offset in bits from the start one source word to the start of the next.
pabyDstDatathe destination data buffer.
nDstOffsetthe offset (in bits) in pabyDstData to the start of the first word to copy over.
nDstStepthe offset in bits from the start one word to the start of the next.
nBitCountthe number of bits in a word to be copied.
nStepCountthe number of words to copy.
CPLErr GDALCopyDatasetFiles ( GDALDriverH  hDriver,
const char *  pszNewName,
const char *  pszOldName 
)

Copy the files of a dataset.

See also:
GDALDriver::CopyFiles()
void GDALCopyWords ( void *  pSrcData,
GDALDataType  eSrcType,
int  nSrcPixelOffset,
void *  pDstData,
GDALDataType  eDstType,
int  nDstPixelOffset,
int  nWordCount 
)

Copy pixel words from buffer to buffer.

This function is used to copy pixel word values from one memory buffer to another, with support for conversion between data types, and differing step factors. The data type conversion is done using the normal GDAL rules. Values assigned to a lower range integer type are clipped. For instance assigning GDT_Int16 values to a GDT_Byte buffer will cause values less the 0 to be set to 0, and values larger than 255 to be set to 255. Assignment from floating point to integer uses default C type casting semantics. Assignment from non-complex to complex will result in the imaginary part being set to zero on output. Assigment from complex to non-complex will result in the complex portion being lost and the real component being preserved (not magnitidue!).

No assumptions are made about the source or destination words occuring on word boundaries. It is assumed that all values are in native machine byte order.

Parameters:
pSrcDataPointer to source data to be converted.
eSrcTypethe source data type (see GDALDataType enum)
nSrcPixelOffsetSource pixel offset, in bytes
pDstDataPointer to buffer where destination data should go
eDstTypethe destination data type (see GDALDataType enum)
nDstPixelOffsetDestination pixel offset, in bytes
nWordCountnumber of words to be copied
Note:
When adding a new data type to GDAL, you must do the following to support it properly within the GDALCopyWords function: 1. Add the data type to the switch on eSrcType in GDALCopyWords. This should invoke the appropriate GDALCopyWordsFromT wrapper. 2. Add the data type to the switch on eDstType in GDALCopyWordsFromT. This should call the appropriate GDALCopyWordsT template. 3. If appropriate, overload the appropriate CopyWord template in the above namespace. This will ensure that any conversion issues are handled (cases like the float -> int32 case, where the min/max) values are subject to roundoff error.
GDALDatasetH GDALCreate ( GDALDriverH  hDriver,
const char *  pszFilename,
int  nXSize,
int  nYSize,
int  nBands,
GDALDataType  eBandType,
char **  papszOptions 
)

Create a new dataset with this driver.

See also:
GDALDriver::Create()
void GDALCreateColorRamp ( GDALColorTableH  hTable,
int  nStartIndex,
const GDALColorEntry psStartColor,
int  nEndIndex,
const GDALColorEntry psEndColor 
)

Create color ramp.

This function is the same as the C++ method GDALColorTable::CreateColorRamp()

Construct a new color table.

This function is the same as the C++ method GDALColorTable::GDALColorTable()

GDALDatasetH GDALCreateCopy ( GDALDriverH  hDriver,
const char *  pszFilename,
GDALDatasetH  hSrcDS,
int  bStrict,
char **  papszOptions,
GDALProgressFunc  pfnProgress,
void *  pProgressData 
)

Create a copy of a dataset.

See also:
GDALDriver::CreateCopy()
CPLErr GDALCreateDatasetMaskBand ( GDALDatasetH  hDS,
int  nFlags 
)

Adds a mask band to the dataset.

See also:
GDALDataset::CreateMaskBand()
CPLErr GDALCreateMaskBand ( GDALRasterBandH  hBand,
int  nFlags 
)

Adds a mask band to the current band.

See also:
GDALRasterBand::CreateMaskBand()

Construct empty table.

This function is the same as the C++ method GDALRasterAttributeTable::GDALRasterAttributeTable()

CPLErr GDALDatasetAdviseRead ( GDALDatasetH  hDS,
int  nXOff,
int  nYOff,
int  nXSize,
int  nYSize,
int  nBufXSize,
int  nBufYSize,
GDALDataType  eDT,
int  nBandCount,
int *  panBandMap,
char **  papszOptions 
)

Advise driver of upcoming read requests.

See also:
GDALDataset::AdviseRead()
CPLErr GDALDatasetCopyWholeRaster ( GDALDatasetH  hSrcDS,
GDALDatasetH  hDstDS,
char **  papszOptions,
GDALProgressFunc  pfnProgress,
void *  pProgressData 
)

Copy all dataset raster data.

This function copies the complete raster contents of one dataset to another similarly configured dataset. The source and destination dataset must have the same number of bands, and the same width and height. The bands do not have to have the same data type.

This function is primarily intended to support implementation of driver specific CreateCopy() functions. It implements efficient copying, in particular "chunking" the copy in substantial blocks and, if appropriate, performing the transfer in a pixel interleaved fashion.

Currently the only papszOptions value supported are : "INTERLEAVE=PIXEL" to force pixel interleaved operation and "COMPRESSED=YES" to force alignment on target dataset block sizes to achieve best compression. More options may be supported in the future.

Parameters:
hSrcDSthe source dataset
hDstDSthe destination dataset
papszOptionstransfer hints in "StringList" Name=Value format.
pfnProgressprogress reporting function.
pProgressDatacallback data for progress function.
Returns:
CE_None on success, or CE_Failure on failure.
CPLErr GDALDatasetRasterIO ( GDALDatasetH  hDS,
GDALRWFlag  eRWFlag,
int  nXOff,
int  nYOff,
int  nXSize,
int  nYSize,
void *  pData,
int  nBufXSize,
int  nBufYSize,
GDALDataType  eBufType,
int  nBandCount,
int *  panBandMap,
int  nPixelSpace,
int  nLineSpace,
int  nBandSpace 
)

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

See also:
GDALDataset::RasterIO()
int GDALDataTypeIsComplex ( GDALDataType  eDataType)

Is data type complex?

Returns:
TRUE if the passed type is complex (one of GDT_CInt16, GDT_CInt32, GDT_CFloat32 or GDT_CFloat64), that is it consists of a real and imaginary component.

Return the smallest data type that can fully express both input data types.

Parameters:
eType1first data type.
eType2second data type.
Returns:
a data type able to express eType1 and eType2.
double GDALDecToPackedDMS ( double  dfDec)

Convert decimal degrees into packed DMS value (DDDMMMSSS.SS).

See CPLDecToPackedDMS().

CPLErr GDALDeleteDataset ( GDALDriverH  hDriver,
const char *  pszFilename 
)

Delete named dataset.

See also:
GDALDriver::Delete()

Subtract one from dataset reference count.

See also:
GDALDataset::Dereference()
void GDALDeregisterDriver ( GDALDriverH  hDriver)

Deregister the passed driver.

See also:
GDALDriverManager::GetDeregisterDriver()

Destroys a color table.

This function is the same as the C++ method GDALColorTable::~GDALColorTable()

void GDALDestroyDriver ( GDALDriverH  hDriver)

Destroy a GDALDriver.

This is roughly equivelent to deleting the driver, but is guaranteed to take place in the GDAL heap. It is important this that function not be called on a driver that is registered with the GDALDriverManager.

Parameters:
hDriverthe driver to destroy.
void GDALDestroyDriverManager ( void  )

Destroy the driver manager.

Incidently unloads all managed drivers.

NOTE: This function is not thread safe. It should not be called while other threads are actively using GDAL.

Destroys a RAT.

This function is the same as the C++ method GDALRasterAttributeTable::~GDALRasterAttributeTable()

int GDALDumpOpenDatasets ( FILE *  fp)

List open datasets.

Dumps a list of all open datasets (shared or not) to the indicated text file (may be stdout or stderr). This function is primarily intended to assist in debugging "dataset leaks" and reference counting issues. The information reported includes the dataset name, referenced count, shared status, driver name, size, and band count.

CPLErr GDALFillRaster ( GDALRasterBandH  hBand,
double  dfRealValue,
double  dfImaginaryValue 
)

Fill this band with a constant value.

See also:
GDALRasterBand::Fill()

Flush all write cached data to disk.

See also:
GDALDataset::FlushCache().
int GDALFlushCacheBlock ( void  )

Try to flush one cached raster block.

This function will search the first unlocked raster block and will flush it to release the associated memory.

Returns:
TRUE if one block was flushed, FALSE if there are no cached blocks or if they are currently locked.

Flush raster data cache.

See also:
GDALRasterBand::FlushCache()
int GDALGCPsToGeoTransform ( int  nGCPCount,
const GDAL_GCP pasGCPs,
double *  padfGeoTransform,
int  bApproxOK 
)

Generate Geotransform from GCPs.

Given a set of GCPs perform first order fit as a geotransform.

Due to imprecision in the calculations the fit algorithm will often return non-zero rotational coefficients even if given perfectly non-rotated inputs. A special case has been implemented for corner corner coordinates given in TL, TR, BR, BL order. So when using this to get a geotransform from 4 corner coordinates, pass them in this order.

Parameters:
nGCPCountthe number of GCPs being passed in.
pasGCPsthe list of GCP structures.
padfGeoTransformthe six double array in which the affine geotransformation will be returned.
bApproxOKIf FALSE the function will fail if the geotransform is not essentially an exact fit (within 0.25 pixel) for all GCPs.
Returns:
TRUE on success or FALSE if there aren't enough points to prepare a geotransform, the pointers are ill-determined or if bApproxOK is FALSE and the fit is poor.
int GDALGeneralCmdLineProcessor ( int  nArgc,
char ***  ppapszArgv,
int  nOptions 
)

General utility option processing.

This function is intended to provide a variety of generic commandline options for all GDAL commandline utilities. It takes care of the following commandline options:

--version: report version of GDAL in use. --build: report build info about GDAL in use. --license: report GDAL license info. --formats: report all format drivers configured. --format [format]: report details of one format driver. --optfile filename: expand an option file into the argument list. --config key value: set system configuration option. --debug [on/off/value]: set debug level. --mempreload dir: preload directory contents into /vsimem --pause: Pause for user input (allows time to attach debugger) --locale [locale]: Install a locale using setlocale() (debugging) --help-general: report detailed help on general options.

The argument array is replaced "in place" and should be freed with CSLDestroy() when no longer needed. The typical usage looks something like the following. Note that the formats should be registered so that the --formats and --format options will work properly.

int main( int argc, char ** argv ) { GDALAllRegister();

argc = GDALGeneralCmdLineProcessor( argc, &argv, 0 ); if( argc < 1 ) exit( -argc );

Parameters:
nArgcnumber of values in the argument list.
ppapszArgvpointer to the argument list array (will be updated in place).
nOptionsunused for now.
Returns:
updated nArgc argument count. Return of 0 requests terminate without error, return of -1 requests exit with error code.

Return access flag.

See also:
GDALDataset::GetAccess()

Get AsyncStatusType by symbolic name.

Returns a data type corresponding to the given symbolic name. This function is opposite to the GDALGetAsyncStatusTypeName().

Parameters:
pszNamestring containing the symbolic name of the type.
Returns:
GDAL AsyncStatus type.
const char* GDALGetAsyncStatusTypeName ( GDALAsyncStatusType  eAsyncStatusType)

Get name of AsyncStatus data type.

Returns a symbolic name for the AsyncStatus data type. This is essentially the the enumerated item name with the GARIO_ prefix removed. So GARIO_COMPLETE returns "COMPLETE". The returned strings are static strings and should not be modified or freed by the application. These strings are useful for reporting datatypes in debug statements, errors and other user output.

Parameters:
eAsyncStatusTypetype to get name of.
Returns:
string corresponding to type.

Fetch the owning dataset handle.

See also:
GDALRasterBand::GetDataset()

Fetch the band number.

See also:
GDALRasterBand::GetBand()
void GDALGetBlockSize ( GDALRasterBandH  hBand,
int *  pnXSize,
int *  pnYSize 
)

Fetch the "natural" block size of this band.

See also:
GDALRasterBand::GetBlockSize()
int GDALGetCacheMax ( void  )

Get maximum cache memory.

Gets the maximum amount of memory available to the GDALRasterBlock caching system for caching GDAL read/write imagery.

The first type this function is called, it will read the GDAL_CACHEMAX configuation option to initialize the maximum cache memory.

This function cannot return a value higher than 2 GB. Use GDALGetCacheMax64() to get a non-truncated value.

Returns:
maximum in bytes.
GIntBig GDALGetCacheMax64 ( void  )

Get maximum cache memory.

Gets the maximum amount of memory available to the GDALRasterBlock caching system for caching GDAL read/write imagery.

The first type this function is called, it will read the GDAL_CACHEMAX configuation option to initialize the maximum cache memory.

Returns:
maximum in bytes.
Since:
GDAL 1.8.0
int GDALGetCacheUsed ( void  )

Get cache memory used.

Returns:
the number of bytes of memory currently in use by the GDALRasterBlock memory caching.
GIntBig GDALGetCacheUsed64 ( void  )

Get cache memory used.

Returns:
the number of bytes of memory currently in use by the GDALRasterBlock memory caching.
Since:
GDAL 1.8.0
const GDALColorEntry* GDALGetColorEntry ( GDALColorTableH  hTable,
int  i 
)

Fetch a color entry from table.

This function is the same as the C++ method GDALColorTable::GetColorEntry()

int GDALGetColorEntryAsRGB ( GDALColorTableH  hTable,
int  i,
GDALColorEntry poEntry 
)

Fetch a table entry in RGB format.

This function is the same as the C++ method GDALColorTable::GetColorEntryAsRGB()

Get number of color entries in table.

This function is the same as the C++ method GDALColorTable::GetColorEntryCount()

Get color interpreation by symbolic name.

Returns a color interpreation corresponding to the given symbolic name. This function is opposite to the GDALGetColorInterpretationName().

Parameters:
pszNamestring containing the symbolic name of the color interpretation.
Returns:
GDAL color interpretation.
Since:
GDAL 1.7.0

Get name of color interpretation.

Returns a symbolic name for the color interpretation. This is derived from the enumerated item name with the GCI_ prefix removed, but there are some variations. So GCI_GrayIndex returns "Gray" and GCI_RedBand returns "Red". The returned strings are static strings and should not be modified or freed by the application.

Parameters:
eInterpcolor interpretation to get name of.
Returns:
string corresponding to color interpretation or NULL pointer if invalid enumerator given.

Fetch the driver to which this dataset relates.

See also:
GDALDataset::GetDriver()
GDALDataType GDALGetDataTypeByName ( const char *  pszName)

Get data type by symbolic name.

Returns a data type corresponding to the given symbolic name. This function is opposite to the GDALGetDataTypeName().

Parameters:
pszNamestring containing the symbolic name of the type.
Returns:
GDAL data type.
const char* GDALGetDataTypeName ( GDALDataType  eDataType)

Get name of data type.

Returns a symbolic name for the data type. This is essentially the the enumerated item name with the GDT_ prefix removed. So GDT_Byte returns "Byte". The returned strings are static strings and should not be modified or freed by the application. These strings are useful for reporting datatypes in debug statements, errors and other user output.

Parameters:
eDataTypetype to get name of.
Returns:
string corresponding to existing data type or NULL pointer if invalid type given.
int GDALGetDataTypeSize ( GDALDataType  eDataType)

Get data type size in bits.

Returns the size of a a GDT_* type in bits, not bytes!

Parameters:
eDataTypetype, such as GDT_Byte.
Returns:
the number of bits or zero if it is not recognised.
CPLErr GDALGetDefaultHistogram ( GDALRasterBandH  hBand,
double *  pdfMin,
double *  pdfMax,
int *  pnBuckets,
int **  ppanHistogram,
int  bForce,
GDALProgressFunc  pfnProgress,
void *  pProgressData 
)

Fetch default raster histogram.

See also:
GDALRasterBand::GetDefaultHistogram()

Fetch default Raster Attribute Table.

See also:
GDALRasterBand::GetDefaultRAT()
const char* GDALGetDescription ( GDALMajorObjectH  hObject)

Fetch object description.

See also:
GDALMajorObject::GetDescription()
GDALDriverH GDALGetDriver ( int  iDriver)

Fetch driver by index.

See also:
GDALDriverManager::GetDriver()
GDALDriverH GDALGetDriverByName ( const char *  pszName)

Fetch a driver based on the short name.

See also:
GDALDriverManager::GetDriverByName()
int GDALGetDriverCount ( void  )

Fetch the number of registered drivers.

See also:
GDALDriverManager::GetDriverCount()
const char* GDALGetDriverCreationOptionList ( GDALDriverH  hDriver)

Return the list of creation options of the driver.

Return the list of creation options of the driver used by Create() and CreateCopy() as an XML string

Parameters:
hDriverthe handle of the driver
Returns:
an XML string that describes the list of creation options or empty string. The returned string should not be freed and is owned by the driver.
const char* GDALGetDriverHelpTopic ( GDALDriverH  hDriver)

Return the URL to the help that describes the driver.

That URL is relative to the GDAL documentation directory.

For the GeoTIFF driver, this is "frmt_gtiff.html"

Parameters:
hDriverthe handle of the driver
Returns:
the URL to the help that describes the driver or NULL. The returned string should not be freed and is owned by the driver.
const char* GDALGetDriverLongName ( GDALDriverH  hDriver)

Return the long name of a driver.

For the GeoTIFF driver, this is "GeoTIFF"

Parameters:
hDriverthe handle of the driver
Returns:
the long name of the driver or empty string. The returned string should not be freed and is owned by the driver.
const char* GDALGetDriverShortName ( GDALDriverH  hDriver)

Return the short name of a driver.

This is the string that can be passed to the GDALGetDriverByName() function.

For the GeoTIFF driver, this is "GTiff"

Parameters:
hDriverthe handle of the driver
Returns:
the short name of the driver. The returned string should not be freed and is owned by the driver.
char** GDALGetFileList ( GDALDatasetH  hDS)

Fetch files forming dataset.

See also:
GDALDataset::GetFileList()

Get number of GCPs.

See also:
GDALDataset::GetGCPCount()
const char* GDALGetGCPProjection ( GDALDatasetH  hDS)

Get output projection for GCPs.

See also:
GDALDataset::GetGCPProjection()

Fetch GCPs.

See also:
GDALDataset::GetGCPs()
CPLErr GDALGetGeoTransform ( GDALDatasetH  hDS,
double *  padfTransform 
)

Fetch the affine transformation coefficients.

See also:
GDALDataset::GetGeoTransform()
void* GDALGetInternalHandle ( GDALDatasetH  hDS,
const char *  pszRequest 
)

Fetch a format specific internally meaningful handle.

See also:
GDALDataset::GetInternalHandle()

Return the mask band associated with the band.

See also:
GDALRasterBand::GetMaskBand()

Return the status flags of the mask band associated with the band.

See also:
GDALRasterBand::GetMaskFlags()
char** GDALGetMetadata ( GDALMajorObjectH  hObject,
const char *  pszDomain 
)

Fetch metadata.

See also:
GDALMajorObject::GetMetadata()
const char* GDALGetMetadataItem ( GDALMajorObjectH  hObject,
const char *  pszName,
const char *  pszDomain 
)

Fetch single metadata item.

See also:
GDALMajorObject::GetMetadataItem()
void GDALGetOpenDatasets ( GDALDatasetH **  ppahDSList,
int *  pnCount 
)

Fetch all open GDAL dataset handles.

See also:
GDALDataset::GetOpenDatasets()

Fetch overview raster band object.

See also:
GDALRasterBand::GetOverview()

Return the number of overview layers available.

See also:
GDALRasterBand::GetOverviewCount()

Fetch palette interpretation.

This function is the same as the C++ method GDALColorTable::GetPaletteInterpretation()

Get name of palette interpretation.

Returns a symbolic name for the palette interpretation. This is the the enumerated item name with the GPI_ prefix removed. So GPI_Gray returns "Gray". The returned strings are static strings and should not be modified or freed by the application.

Parameters:
eInterppalette interpretation to get name of.
Returns:
string corresponding to palette interpretation.
const char* GDALGetProjectionRef ( GDALDatasetH  hDS)

Fetch the projection definition string for this dataset.

See also:
GDALDataset::GetProjectionRef()

Find out if we have update permission for this band.

See also:
GDALRasterBand::GetAccess()
GDALRasterBandH GDALGetRasterBand ( GDALDatasetH  hDS,
int  nBandId 
)

Fetch a band object for a dataset.

See also:
GDALDataset::GetRasterBand().

Fetch XSize of raster.

See also:
GDALRasterBand::GetXSize()

Fetch YSize of raster.

See also:
GDALRasterBand::GetYSize()

Fetch the list of category names for this raster.

See also:
GDALRasterBand::GetCategoryNames()

How should this band be interpreted as color?

See also:
GDALRasterBand::GetColorInterpretation()

Fetch the color table associated with band.

See also:
GDALRasterBand::GetColorTable()

Fetch the number of raster bands on this dataset.

See also:
GDALDataset::GetRasterCount().

Fetch the pixel data type for this band.

See also:
GDALRasterBand::GetRasterDataType()
CPLErr GDALGetRasterHistogram ( GDALRasterBandH  hBand,
double  dfMin,
double  dfMax,
int  nBuckets,
int *  panHistogram,
int  bIncludeOutOfRange,
int  bApproxOK,
GDALProgressFunc  pfnProgress,
void *  pProgressData 
)

Compute raster histogram.

See also:
GDALRasterBand::GetHistogram()
double GDALGetRasterMaximum ( GDALRasterBandH  hBand,
int *  pbSuccess 
)

Fetch the maximum value for this band.

See also:
GDALRasterBand::GetMaximum()
double GDALGetRasterMinimum ( GDALRasterBandH  hBand,
int *  pbSuccess 
)

Fetch the minimum value for this band.

See also:
GDALRasterBand::GetMinimum()
double GDALGetRasterNoDataValue ( GDALRasterBandH  hBand,
int *  pbSuccess 
)

Fetch the no data value for this band.

See also:
GDALRasterBand::GetNoDataValue()
double GDALGetRasterOffset ( GDALRasterBandH  hBand,
int *  pbSuccess 
)

Fetch the raster value offset.

See also:
GDALRasterBand::GetOffset()
GDALRasterBandH GDALGetRasterSampleOverview ( GDALRasterBandH  hBand,
int  nDesiredSamples 
)

Fetch best sampling overview.

See also:
GDALRasterBand::GetRasterSampleOverview()
double GDALGetRasterScale ( GDALRasterBandH  hBand,
int *  pbSuccess 
)

Fetch the raster value scale.

See also:
GDALRasterBand::GetScale()
CPLErr GDALGetRasterStatistics ( GDALRasterBandH  hBand,
int  bApproxOK,
int  bForce,
double *  pdfMin,
double *  pdfMax,
double *  pdfMean,
double *  pdfStdDev 
)

Fetch image statistics.

See also:
GDALRasterBand::GetStatistics()
const char* GDALGetRasterUnitType ( GDALRasterBandH  hBand)

Return raster unit type.

See also:
GDALRasterBand::GetUnitType()
int GDALGetRasterXSize ( GDALDatasetH  hDataset)

Fetch raster width in pixels.

See also:
GDALDataset::GetRasterXSize().
int GDALGetRasterYSize ( GDALDatasetH  hDataset)

Fetch raster height in pixels.

See also:
GDALDataset::GetRasterYSize().

Check for arbitrary overviews.

See also:
GDALRasterBand::HasArbitraryOverviews()
GDALDriverH GDALIdentifyDriver ( const char *  pszFilename,
char **  papszFileList 
)

Identify the driver that can open a raster file.

This function will try to identify the driver that can open the passed file name by invoking the Identify method of each registered GDALDriver in turn. The first driver that successful identifies the file name will be returned. If all drivers fail then NULL is returned.

In order to reduce the need for such searches touch the operating system file system machinery, it is possible to give an optional list of files. This is the list of all files at the same level in the file system as the target file, including the target file. The filenames will not include any path components, are an essentially just the output of CPLReadDir() on the parent directory. If the target object does not have filesystem semantics then the file list should be NULL.

Parameters:
pszFilenamethe name of the file to access. In the case of exotic drivers this may not refer to a physical file, but instead contain information for the driver on how to access a dataset.
papszFileListan array of strings, whose last element is the NULL pointer. These strings are filenames that are auxiliary to the main filename. The passed value may be NULL.
Returns:
A GDALDriverH handle or NULL on failure. For C++ applications this handle can be cast to a GDALDriver *.
int GDALInvGeoTransform ( double *  gt_in,
double *  gt_out 
)

Invert Geotransform.

This function will invert a standard 3x2 set of GeoTransform coefficients. This converts the equation from being pixel to geo to being geo to pixel.

Parameters:
gt_inInput geotransform (six doubles - unaltered).
gt_outOutput geotransform (six doubles - updated).
Returns:
TRUE on success or FALSE if the equation is uninvertable.
int GDALLoadWorldFile ( const char *  pszFilename,
double *  padfGeoTransform 
)

Read ESRI world file.

This function reads an ESRI style world file, and formats a geotransform from its contents.

The world file contains an affine transformation with the parameters in a different order than in a geotransform array.

  • geotransform[1] : width of pixel
  • geotransform[4] : rotational coefficient, zero for north up images.
  • geotransform[2] : rotational coefficient, zero for north up images.
  • geotransform[5] : height of pixel (but negative)
  • geotransform[0] + 0.5 * geotransform[1] + 0.5 * geotransform[2] : x offset to center of top left pixel.
  • geotransform[3] + 0.5 * geotransform[4] + 0.5 * geotransform[5] : y offset to center of top left pixel.
Parameters:
pszFilenamethe world file name.
padfGeoTransformthe six double array into which the geotransformation should be placed.
Returns:
TRUE on success or FALSE on failure.
GDALDatasetH GDALOpen ( const char *  pszFilename,
GDALAccess  eAccess 
)

Open a raster file as a GDALDataset.

This function will try to open the passed file, or virtual dataset name by invoking the Open method of each registered GDALDriver in turn. The first successful open will result in a returned dataset. If all drivers fail then NULL is returned and an error is issued.

Several recommendations :

  • If you open a dataset object with GA_Update access, it is not recommended to open a new dataset on the same underlying file.
  • The returned dataset should only be accessed by one thread at a time. If you want to use it from different threads, you must add all necessary code (mutexes, etc.) to avoid concurrent use of the object. (Some drivers, such as GeoTIFF, maintain internal state variables that are updated each time a new block is read, thus preventing concurrent use.)

For drivers supporting the VSI virtual file API, it is possible to open a file in a .zip archive (see VSIInstallZipFileHandler()), in a .tar/.tar.gz/.tgz archive (see VSIInstallTarFileHandler()) or on a HTTP / FTP server (see VSIInstallCurlFileHandler())

In some situations (dealing with unverified data), the datasets can be opened in another process through the GDAL API Proxy mechanism.

See also:
GDALOpenShared()
Parameters:
pszFilenamethe name of the file to access. In the case of exotic drivers this may not refer to a physical file, but instead contain information for the driver on how to access a dataset. It should be in UTF-8 encoding.
eAccessthe desired access, either GA_Update or GA_ReadOnly. Many drivers support only read only access.
Returns:
A GDALDatasetH handle or NULL on failure. For C++ applications this handle can be cast to a GDALDataset *.
GDALDatasetH GDALOpenShared ( const char *  pszFilename,
GDALAccess  eAccess 
)

Open a raster file as a GDALDataset.

This function works the same as GDALOpen(), but allows the sharing of GDALDataset handles for a dataset with other callers to GDALOpenShared().

In particular, GDALOpenShared() will first consult it's list of currently open and shared GDALDataset's, and if the GetDescription() name for one exactly matches the pszFilename passed to GDALOpenShared() it will be referenced and returned.

Starting with GDAL 1.6.0, if GDALOpenShared() is called on the same pszFilename from two different threads, a different GDALDataset object will be returned as it is not safe to use the same dataset from different threads, unless the user does explicitely use mutexes in its code.

For drivers supporting the VSI virtual file API, it is possible to open a file in a .zip archive (see VSIInstallZipFileHandler()), in a .tar/.tar.gz/.tgz archive (see VSIInstallTarFileHandler()) or on a HTTP / FTP server (see VSIInstallCurlFileHandler())

In some situations (dealing with unverified data), the datasets can be opened in another process through the GDAL API Proxy mechanism.

See also:
GDALOpen()
Parameters:
pszFilenamethe name of the file to access. In the case of exotic drivers this may not refer to a physical file, but instead contain information for the driver on how to access a dataset. It should be in UTF-8 encoding.
eAccessthe desired access, either GA_Update or GA_ReadOnly. Many drivers support only read only access.
Returns:
A GDALDatasetH handle or NULL on failure. For C++ applications this handle can be cast to a GDALDataset *.
double GDALPackedDMSToDec ( double  dfPacked)

Convert a packed DMS value (DDDMMMSSS.SS) into decimal degrees.

See CPLPackedDMSToDec().

CPLErr GDALRasterAdviseRead ( GDALRasterBandH  hBand,
int  nXOff,
int  nYOff,
int  nXSize,
int  nYSize,
int  nBufXSize,
int  nBufYSize,
GDALDataType  eDT,
char **  papszOptions 
)

Advise driver of upcoming read requests.

See also:
GDALRasterBand::AdviseRead()
CPLErr GDALRasterBandCopyWholeRaster ( GDALRasterBandH  hSrcBand,
GDALRasterBandH  hDstBand,
char **  papszOptions,
GDALProgressFunc  pfnProgress,
void *  pProgressData 
)

Copy all raster band raster data.

This function copies the complete raster contents of one band to another similarly configured band. The source and destination bands must have the same width and height. The bands do not have to have the same data type.

It implements efficient copying, in particular "chunking" the copy in substantial blocks.

Currently the only papszOptions value supported is : "COMPRESSED=YES" to force alignment on target dataset block sizes to achieve best compression. More options may be supported in the future.

Parameters:
hSrcBandthe source band
hDstBandthe destination band
papszOptionstransfer hints in "StringList" Name=Value format.
pfnProgressprogress reporting function.
pProgressDatacallback data for progress function.
Returns:
CE_None on success, or CE_Failure on failure.
CPLErr GDALRasterIO ( GDALRasterBandH  hBand,
GDALRWFlag  eRWFlag,
int  nXOff,
int  nYOff,
int  nXSize,
int  nYSize,
void *  pData,
int  nBufXSize,
int  nBufYSize,
GDALDataType  eBufType,
int  nPixelSpace,
int  nLineSpace 
)

Read/write a region of image data for this band.

See also:
GDALRasterBand::RasterIO()

Copy Raster Attribute Table.

This function is the same as the C++ method GDALRasterAttributeTable::Clone()

CPLErr GDALRATCreateColumn ( GDALRasterAttributeTableH  hRAT,
const char *  pszFieldName,
GDALRATFieldType  eFieldType,
GDALRATFieldUsage  eFieldUsage 
)

Create new column.

This function is the same as the C++ method GDALRasterAttributeTable::CreateColumn()

void GDALRATDumpReadable ( GDALRasterAttributeTableH  hRAT,
FILE *  fp 
)

Dump RAT in readable form.

This function is the same as the C++ method GDALRasterAttributeTable::DumpReadable()

Fetch column index for given usage.

This function is the same as the C++ method GDALRasterAttributeTable::GetColOfUsage()

Fetch table column count.

This function is the same as the C++ method GDALRasterAttributeTable::GetColumnCount()

int GDALRATGetLinearBinning ( GDALRasterAttributeTableH  hRAT,
double *  pdfRow0Min,
double *  pdfBinSize 
)

Get linear binning information.

This function is the same as the C++ method GDALRasterAttributeTable::GetLinearBinning()

const char* GDALRATGetNameOfCol ( GDALRasterAttributeTableH  hRAT,
int  iCol 
)

Fetch name of indicated column.

This function is the same as the C++ method GDALRasterAttributeTable::GetNameOfCol()

Fetch row count.

This function is the same as the C++ method GDALRasterAttributeTable::GetRowCount()

int GDALRATGetRowOfValue ( GDALRasterAttributeTableH  hRAT,
double  dfValue 
)

Get row for pixel value.

This function is the same as the C++ method GDALRasterAttributeTable::GetRowOfValue()

Fetch column type.

This function is the same as the C++ method GDALRasterAttributeTable::GetTypeOfCol()

Fetch column usage value.

This function is the same as the C++ method GDALRasterAttributeTable::GetUsageOfColetNameOfCol()

double GDALRATGetValueAsDouble ( GDALRasterAttributeTableH  hRAT,
int  iRow,
int  iField 
)

Fetch field value as a double.

This function is the same as the C++ method GDALRasterAttributeTable::GetValueAsDouble()

int GDALRATGetValueAsInt ( GDALRasterAttributeTableH  hRAT,
int  iRow,
int  iField 
)

Fetch field value as a integer.

This function is the same as the C++ method GDALRasterAttributeTable::GetValueAsInt()

const char* GDALRATGetValueAsString ( GDALRasterAttributeTableH  hRAT,
int  iRow,
int  iField 
)

Fetch field value as a string.

This function is the same as the C++ method GDALRasterAttributeTable::GetValueAsString()

Initialize from color table.

This function is the same as the C++ method GDALRasterAttributeTable::InitializeFromColorTable()

CPLErr GDALRATSetLinearBinning ( GDALRasterAttributeTableH  hRAT,
double  dfRow0Min,
double  dfBinSize 
)

Set linear binning information.

This function is the same as the C++ method GDALRasterAttributeTable::SetLinearBinning()

void GDALRATSetRowCount ( GDALRasterAttributeTableH  hRAT,
int  nNewCount 
)

Set row count.

This function is the same as the C++ method GDALRasterAttributeTable::SetRowCount()

void GDALRATSetValueAsDouble ( GDALRasterAttributeTableH  hRAT,
int  iRow,
int  iField,
double  dfValue 
)

Set field value from double.

This function is the same as the C++ method GDALRasterAttributeTable::SetValue()

void GDALRATSetValueAsInt ( GDALRasterAttributeTableH  hRAT,
int  iRow,
int  iField,
int  nValue 
)

Set field value from integer.

This function is the same as the C++ method GDALRasterAttributeTable::SetValue()

void GDALRATSetValueAsString ( GDALRasterAttributeTableH  hRAT,
int  iRow,
int  iField,
const char *  pszValue 
)

Set field value from string.

This function is the same as the C++ method GDALRasterAttributeTable::SetValue()

Translate to a color table.

This function is the same as the C++ method GDALRasterAttributeTable::TranslateToColorTable()

CPLErr GDALReadBlock ( GDALRasterBandH  hBand,
int  nXOff,
int  nYOff,
void *  pData 
)

Read a block of image data efficiently.

See also:
GDALRasterBand::ReadBlock()
int GDALReadWorldFile ( const char *  pszBaseFilename,
const char *  pszExtension,
double *  padfGeoTransform 
)

Read ESRI world file.

This function reads an ESRI style world file, and formats a geotransform from its contents. It does the same as GDALLoadWorldFile() function, but it will form the filename for the worldfile from the filename of the raster file referred and the suggested extension. If no extension is provided, the code will internally try the unix style and windows style world file extensions (eg. for .tif these would be .tfw and .tifw).

The world file contains an affine transformation with the parameters in a different order than in a geotransform array.

  • geotransform[1] : width of pixel
  • geotransform[4] : rotational coefficient, zero for north up images.
  • geotransform[2] : rotational coefficient, zero for north up images.
  • geotransform[5] : height of pixel (but negative)
  • geotransform[0] + 0.5 * geotransform[1] + 0.5 * geotransform[2] : x offset to center of top left pixel.
  • geotransform[3] + 0.5 * geotransform[4] + 0.5 * geotransform[5] : y offset to center of top left pixel.
Parameters:
pszBaseFilenamethe target raster file.
pszExtensionthe extension to use (ie. ".wld") or NULL to derive it from the pszBaseFilename
padfGeoTransformthe six double array into which the geotransformation should be placed.
Returns:
TRUE on success or FALSE on failure.

Add one to dataset reference count.

See also:
GDALDataset::Reference()
CPLErr GDALRegenerateOverviews ( GDALRasterBandH  hSrcBand,
int  nOverviewCount,
GDALRasterBandH pahOvrBands,
const char *  pszResampling,
GDALProgressFunc  pfnProgress,
void *  pProgressData 
)

Generate downsampled overviews.

This function will generate one or more overview images from a base image using the requested downsampling algorithm. It's primary use is for generating overviews via GDALDataset::BuildOverviews(), but it can also be used to generate downsampled images in one file from another outside the overview architecture.

The output bands need to exist in advance.

The full set of resampling algorithms is documented in GDALDataset::BuildOverviews().

This function will honour properly NODATA_VALUES tuples (special dataset metadata) so that only a given RGB triplet (in case of a RGB image) will be considered as the nodata value and not each value of the triplet independantly per band.

Parameters:
hSrcBandthe source (base level) band.
nOverviewCountthe number of downsampled bands being generated.
pahOvrBandsthe list of downsampled bands to be generated.
pszResamplingResampling algorithm (eg. "AVERAGE").
pfnProgressprogress report function.
pProgressDataprogress function callback data.
Returns:
CE_None on success or CE_Failure on failure.
int GDALRegisterDriver ( GDALDriverH  hDriver)

Register a driver for use.

See also:
GDALDriverManager::GetRegisterDriver()
CPLErr GDALRenameDataset ( GDALDriverH  hDriver,
const char *  pszNewName,
const char *  pszOldName 
)

Rename a dataset.

See also:
GDALDriver::Rename()
void GDALSetCacheMax ( int  nNewSizeInBytes)

Set maximum cache memory.

This function sets the maximum amount of memory that GDAL is permitted to use for GDALRasterBlock caching. The unit of the value is bytes.

The maximum value is 2GB, due to the use of a signed 32 bit integer. Use GDALSetCacheMax64() to be able to set a higher value.

Parameters:
nNewSizeInBytesthe maximum number of bytes for caching.
void GDALSetCacheMax64 ( GIntBig  nNewSizeInBytes)

Set maximum cache memory.

This function sets the maximum amount of memory that GDAL is permitted to use for GDALRasterBlock caching. The unit of the value is bytes.

Note: On 32 bit platforms, the maximum amount of memory that can be addressed by a process might be 2 GB or 3 GB, depending on the operating system capabilities. This function will not make any attempt to check the consistency of the passed value with the effective capabilities of the OS.

Parameters:
nNewSizeInBytesthe maximum number of bytes for caching.
Since:
GDAL 1.8.0
void GDALSetColorEntry ( GDALColorTableH  hTable,
int  i,
const GDALColorEntry poEntry 
)

Set entry in color table.

This function is the same as the C++ method GDALColorTable::SetColorEntry()

CPLErr GDALSetDefaultHistogram ( GDALRasterBandH  hBand,
double  dfMin,
double  dfMax,
int  nBuckets,
int *  panHistogram 
)

Set default histogram.

See also:
GDALRasterBand::SetDefaultHistogram()

Set default Raster Attribute Table.

See also:
GDALRasterBand::GDALSetDefaultRAT()
void GDALSetDescription ( GDALMajorObjectH  hObject,
const char *  pszNewDesc 
)

Set object description.

See also:
GDALMajorObject::SetDescription()
CPLErr GDALSetGCPs ( GDALDatasetH  hDS,
int  nGCPCount,
const GDAL_GCP pasGCPList,
const char *  pszGCPProjection 
)

Assign GCPs.

See also:
GDALDataset::SetGCPs()
CPLErr GDALSetGeoTransform ( GDALDatasetH  hDS,
double *  padfTransform 
)

Set the affine transformation coefficients.

See also:
GDALDataset::SetGeoTransform()
CPLErr GDALSetMetadata ( GDALMajorObjectH  hObject,
char **  papszMD,
const char *  pszDomain 
)

Set metadata.

See also:
GDALMajorObject::SetMetadata()
CPLErr GDALSetMetadataItem ( GDALMajorObjectH  hObject,
const char *  pszName,
const char *  pszValue,
const char *  pszDomain 
)

Set single metadata item.

See also:
GDALMajorObject::SetMetadataItem()
CPLErr GDALSetProjection ( GDALDatasetH  hDS,
const char *  pszProjection 
)

Set the projection reference string for this dataset.

See also:
GDALDataset::SetProjection()
CPLErr GDALSetRasterCategoryNames ( GDALRasterBandH  hBand,
char **  papszNames 
)

Set the category names for this band.

See also:
GDALRasterBand::SetCategoryNames()

Set color interpretation of a band.

See also:
GDALRasterBand::SetColorInterpretation()

Set the raster color table.

See also:
GDALRasterBand::SetColorTable()
CPLErr GDALSetRasterNoDataValue ( GDALRasterBandH  hBand,
double  dfValue 
)

Set the no data value for this band.

See also:
GDALRasterBand::SetNoDataValue()
CPLErr GDALSetRasterOffset ( GDALRasterBandH  hBand,
double  dfNewOffset 
)

Set scaling offset.

See also:
GDALRasterBand::SetOffset()
CPLErr GDALSetRasterScale ( GDALRasterBandH  hBand,
double  dfNewOffset 
)

Set scaling ratio.

See also:
GDALRasterBand::SetScale()
CPLErr GDALSetRasterStatistics ( GDALRasterBandH  hBand,
double  dfMin,
double  dfMax,
double  dfMean,
double  dfStdDev 
)

Set statistics on band.

See also:
GDALRasterBand::SetStatistics()
CPLErr GDALSetRasterUnitType ( GDALRasterBandH  hBand,
const char *  pszNewValue 
)

Set unit type.

See also:
GDALRasterBand::SetUnitType()
Since:
GDAL 1.8.0
void GDALSwapWords ( void *  pData,
int  nWordSize,
int  nWordCount,
int  nWordSkip 
)

Byte swap words in-place.

This function will byte swap a set of 2, 4 or 8 byte words "in place" in a memory array. No assumption is made that the words being swapped are word aligned in memory. Use the CPL_LSB and CPL_MSB macros from cpl_port.h to determine if the current platform is big endian or little endian. Use The macros like CPL_SWAP32() to byte swap single values without the overhead of a function call.

Parameters:
pDatapointer to start of data buffer.
nWordSizesize of words being swapped in bytes. Normally 2, 4 or 8.
nWordCountthe number of words to be swapped in this call.
nWordSkipthe byte offset from the start of one word to the start of the next. For packed buffers this is the same as nWordSize.
int GDALValidateCreationOptions ( GDALDriverH  hDriver,
char **  papszCreationOptions 
)

Validate the list of creation options that are handled by a driver.

This is a helper method primarily used by Create() and CreateCopy() to validate that the passed in list of creation options is compatible with the GDAL_DMD_CREATIONOPTIONLIST metadata item defined by some drivers.

See also:
GDALGetDriverCreationOptionList()

If the GDAL_DMD_CREATIONOPTIONLIST metadata item is not defined, this function will return TRUE. Otherwise it will check that the keys and values in the list of creation options are compatible with the capabilities declared by the GDAL_DMD_CREATIONOPTIONLIST metadata item. In case of incompatibility a (non fatal) warning will be emited and FALSE will be returned.

Parameters:
hDriverthe handle of the driver with whom the lists of creation option must be validated
papszCreationOptionsthe list of creation options. An array of strings, whose last element is a NULL pointer
Returns:
TRUE if the list of creation options is compatible with the Create() and CreateCopy() method of the driver, FALSE otherwise.
const char* GDALVersionInfo ( const char *  pszRequest)

Get runtime version information.

Available pszRequest values:

  • "VERSION_NUM": Returns GDAL_VERSION_NUM formatted as a string. ie. "1170" Note: starting with GDAL 1.10, this string will be longer than 4 characters.
  • "RELEASE_DATE": Returns GDAL_RELEASE_DATE formatted as a string. ie. "20020416".
  • "RELEASE_NAME": Returns the GDAL_RELEASE_NAME. ie. "1.1.7"
  • "--version": Returns one line version message suitable for use in response to --version requests. ie. "GDAL 1.1.7, released 2002/04/16"
  • "LICENSE": Returns the content of the LICENSE.TXT file from the GDAL_DATA directory. Before GDAL 1.7.0, the returned string was leaking memory but this is now resolved. So the result should not been freed by the caller.
  • "BUILD_INFO": List of NAME=VALUE pairs separated by newlines with information on build time options.
Parameters:
pszRequestthe type of version info desired, as listed above.
Returns:
an internal string containing the requested information.
CPLErr GDALWriteBlock ( GDALRasterBandH  hBand,
int  nXOff,
int  nYOff,
void *  pData 
)

Write a block of image data efficiently.

See also:
GDALRasterBand::WriteBlock()
int GDALWriteWorldFile ( const char *  pszBaseFilename,
const char *  pszExtension,
double *  padfGeoTransform 
)

Write ESRI world file.

This function writes an ESRI style world file from the passed geotransform.

The world file contains an affine transformation with the parameters in a different order than in a geotransform array.

  • geotransform[1] : width of pixel
  • geotransform[4] : rotational coefficient, zero for north up images.
  • geotransform[2] : rotational coefficient, zero for north up images.
  • geotransform[5] : height of pixel (but negative)
  • geotransform[0] + 0.5 * geotransform[1] + 0.5 * geotransform[2] : x offset to center of top left pixel.
  • geotransform[3] + 0.5 * geotransform[4] + 0.5 * geotransform[5] : y offset to center of top left pixel.
Parameters:
pszBaseFilenamethe target raster file.
pszExtensionthe extension to use (ie. ".wld"). Must not be NULL
padfGeoTransformthe six double array from which the geotransformation should be read.
Returns:
TRUE on success or FALSE on failure.

Generated for GDAL by doxygen 1.7.6.1.