GDAL
|
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... | |
Macros | |
#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. More... | |
#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() More... | |
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) |
Functions | |
int | GDALGetDataTypeSize (GDALDataType) |
Get data type size in bits. More... | |
int | GDALDataTypeIsComplex (GDALDataType) |
Is data type complex? More... | |
const char * | GDALGetDataTypeName (GDALDataType) |
Get name of data type. More... | |
GDALDataType | GDALGetDataTypeByName (const char *) |
Get data type by symbolic name. More... | |
GDALDataType | GDALDataTypeUnion (GDALDataType, GDALDataType) |
Return the smallest data type that can fully express both input data types. More... | |
const char * | GDALGetAsyncStatusTypeName (GDALAsyncStatusType) |
Get name of AsyncStatus data type. More... | |
GDALAsyncStatusType | GDALGetAsyncStatusTypeByName (const char *) |
Get AsyncStatusType by symbolic name. More... | |
const char * | GDALGetColorInterpretationName (GDALColorInterp) |
Get name of color interpretation. More... | |
GDALColorInterp | GDALGetColorInterpretationByName (const char *pszName) |
Get color interpreation by symbolic name. More... | |
const char * | GDALGetPaletteInterpretationName (GDALPaletteInterp) |
Get name of palette interpretation. More... | |
void | GDALAllRegister (void) |
Register all known configured GDAL drivers. More... | |
GDALDatasetH | GDALCreate (GDALDriverH hDriver, const char *, int, int, int, GDALDataType, char **) CPL_WARN_UNUSED_RESULT |
Create a new dataset with this driver. More... | |
GDALDatasetH | GDALCreateCopy (GDALDriverH, const char *, GDALDatasetH, int, char **, GDALProgressFunc, void *) CPL_WARN_UNUSED_RESULT |
Create a copy of a dataset. More... | |
GDALDriverH | GDALIdentifyDriver (const char *pszFilename, char **papszFileList) |
Identify the driver that can open a raster file. More... | |
GDALDatasetH | GDALOpen (const char *pszFilename, GDALAccess eAccess) CPL_WARN_UNUSED_RESULT |
Open a raster file as a GDALDataset. More... | |
GDALDatasetH | GDALOpenShared (const char *, GDALAccess) CPL_WARN_UNUSED_RESULT |
Open a raster file as a GDALDataset. More... | |
int | GDALDumpOpenDatasets (FILE *) |
List open datasets. More... | |
GDALDriverH | GDALGetDriverByName (const char *) |
Fetch a driver based on the short name. More... | |
int | GDALGetDriverCount (void) |
Fetch the number of registered drivers. More... | |
GDALDriverH | GDALGetDriver (int) |
Fetch driver by index. More... | |
void | GDALDestroyDriver (GDALDriverH) |
Destroy a GDALDriver. More... | |
int | GDALRegisterDriver (GDALDriverH) |
Register a driver for use. More... | |
void | GDALDeregisterDriver (GDALDriverH) |
Deregister the passed driver. More... | |
void | GDALDestroyDriverManager (void) |
Destroy the driver manager. More... | |
CPLErr | GDALDeleteDataset (GDALDriverH, const char *) |
Delete named dataset. More... | |
CPLErr | GDALRenameDataset (GDALDriverH, const char *pszNewName, const char *pszOldName) |
Rename a dataset. More... | |
CPLErr | GDALCopyDatasetFiles (GDALDriverH, const char *pszNewName, const char *pszOldName) |
Copy the files of a dataset. More... | |
int | GDALValidateCreationOptions (GDALDriverH, char **papszCreationOptions) |
Validate the list of creation options that are handled by a driver. More... | |
const char * | GDALGetDriverShortName (GDALDriverH) |
Return the short name of a driver. More... | |
const char * | GDALGetDriverLongName (GDALDriverH) |
Return the long name of a driver. More... | |
const char * | GDALGetDriverHelpTopic (GDALDriverH) |
Return the URL to the help that describes the driver. More... | |
const char * | GDALGetDriverCreationOptionList (GDALDriverH) |
Return the list of creation options of the driver. More... | |
void | GDALInitGCPs (int, GDAL_GCP *) |
void | GDALDeinitGCPs (int, GDAL_GCP *) |
GDAL_GCP * | GDALDuplicateGCPs (int, const GDAL_GCP *) |
int | GDALGCPsToGeoTransform (int nGCPCount, const GDAL_GCP *pasGCPs, double *padfGeoTransform, int bApproxOK) CPL_WARN_UNUSED_RESULT |
Generate Geotransform from GCPs. More... | |
int | GDALInvGeoTransform (double *padfGeoTransformIn, double *padfInvGeoTransformOut) CPL_WARN_UNUSED_RESULT |
Invert Geotransform. More... | |
void | GDALApplyGeoTransform (double *, double, double, double *, double *) |
Apply GeoTransform to x/y coordinate. More... | |
void | GDALComposeGeoTransforms (const double *padfGeoTransform1, const double *padfGeoTransform2, double *padfGeoTransformOut) |
Compose two geotransforms. More... | |
char ** | GDALGetMetadataDomainList (GDALMajorObjectH hObject) |
Fetch list of metadata domains. More... | |
char ** | GDALGetMetadata (GDALMajorObjectH, const char *) |
Fetch metadata. More... | |
CPLErr | GDALSetMetadata (GDALMajorObjectH, char **, const char *) |
Set metadata. More... | |
const char * | GDALGetMetadataItem (GDALMajorObjectH, const char *, const char *) |
Fetch single metadata item. More... | |
CPLErr | GDALSetMetadataItem (GDALMajorObjectH, const char *, const char *, const char *) |
Set single metadata item. More... | |
const char * | GDALGetDescription (GDALMajorObjectH) |
Fetch object description. More... | |
void | GDALSetDescription (GDALMajorObjectH, const char *) |
Set object description. More... | |
GDALDriverH | GDALGetDatasetDriver (GDALDatasetH) |
Fetch the driver to which this dataset relates. More... | |
char ** | GDALGetFileList (GDALDatasetH) |
Fetch files forming dataset. More... | |
void | GDALClose (GDALDatasetH) |
Close GDAL dataset. More... | |
int | GDALGetRasterXSize (GDALDatasetH) |
Fetch raster width in pixels. More... | |
int | GDALGetRasterYSize (GDALDatasetH) |
Fetch raster height in pixels. More... | |
int | GDALGetRasterCount (GDALDatasetH) |
Fetch the number of raster bands on this dataset. More... | |
GDALRasterBandH | GDALGetRasterBand (GDALDatasetH, int) |
Fetch a band object for a dataset. More... | |
CPLErr | GDALAddBand (GDALDatasetH hDS, GDALDataType eType, char **papszOptions) |
Add a band to a dataset. More... | |
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. More... | |
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. More... | |
const char * | GDALGetProjectionRef (GDALDatasetH) |
Fetch the projection definition string for this dataset. More... | |
CPLErr | GDALSetProjection (GDALDatasetH, const char *) |
Set the projection reference string for this dataset. More... | |
CPLErr | GDALGetGeoTransform (GDALDatasetH, double *) |
Fetch the affine transformation coefficients. More... | |
CPLErr | GDALSetGeoTransform (GDALDatasetH, double *) |
int | GDALGetGCPCount (GDALDatasetH) |
Get number of GCPs. More... | |
const char * | GDALGetGCPProjection (GDALDatasetH) |
Get output projection for GCPs. More... | |
const GDAL_GCP * | GDALGetGCPs (GDALDatasetH) |
Fetch GCPs. More... | |
CPLErr | GDALSetGCPs (GDALDatasetH, int, const GDAL_GCP *, const char *) |
Assign GCPs. More... | |
void * | GDALGetInternalHandle (GDALDatasetH, const char *) |
Fetch a format specific internally meaningful handle. More... | |
int | GDALReferenceDataset (GDALDatasetH) |
Add one to dataset reference count. More... | |
int | GDALDereferenceDataset (GDALDatasetH) |
Subtract one from dataset reference count. More... | |
CPLErr | GDALBuildOverviews (GDALDatasetH, const char *, int, int *, int, int *, GDALProgressFunc, void *) |
Build raster overview(s) More... | |
void | GDALGetOpenDatasets (GDALDatasetH **hDS, int *pnCount) |
Fetch all open GDAL dataset handles. More... | |
int | GDALGetAccess (GDALDatasetH hDS) |
Return access flag. More... | |
void | GDALFlushCache (GDALDatasetH hDS) |
Flush all write cached data to disk. More... | |
CPLErr | GDALCreateDatasetMaskBand (GDALDatasetH hDS, int nFlags) |
Adds a mask band to the dataset. More... | |
CPLErr | GDALDatasetCopyWholeRaster (GDALDatasetH hSrcDS, GDALDatasetH hDstDS, char **papszOptions, GDALProgressFunc pfnProgress, void *pProgressData) |
Copy all dataset raster data. More... | |
CPLErr | GDALRasterBandCopyWholeRaster (GDALRasterBandH hSrcBand, GDALRasterBandH hDstBand, char **papszOptions, GDALProgressFunc pfnProgress, void *pProgressData) |
Copy all raster band raster data. More... | |
CPLErr | GDALRegenerateOverviews (GDALRasterBandH hSrcBand, int nOverviewCount, GDALRasterBandH *pahOverviewBands, const char *pszResampling, GDALProgressFunc pfnProgress, void *pProgressData) |
Generate downsampled overviews. More... | |
GDALDataType | GDALGetRasterDataType (GDALRasterBandH) |
Fetch the pixel data type for this band. More... | |
void | GDALGetBlockSize (GDALRasterBandH, int *pnXSize, int *pnYSize) |
Fetch the "natural" block size of this band. More... | |
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. More... | |
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. More... | |
CPLErr | GDALReadBlock (GDALRasterBandH, int, int, void *) |
Read a block of image data efficiently. More... | |
CPLErr | GDALWriteBlock (GDALRasterBandH, int, int, void *) |
Write a block of image data efficiently. More... | |
int | GDALGetRasterBandXSize (GDALRasterBandH) |
Fetch XSize of raster. More... | |
int | GDALGetRasterBandYSize (GDALRasterBandH) |
Fetch YSize of raster. More... | |
GDALAccess | GDALGetRasterAccess (GDALRasterBandH) |
Find out if we have update permission for this band. More... | |
int | GDALGetBandNumber (GDALRasterBandH) |
Fetch the band number. More... | |
GDALDatasetH | GDALGetBandDataset (GDALRasterBandH) |
Fetch the owning dataset handle. More... | |
GDALColorInterp | GDALGetRasterColorInterpretation (GDALRasterBandH) |
How should this band be interpreted as color? More... | |
CPLErr | GDALSetRasterColorInterpretation (GDALRasterBandH, GDALColorInterp) |
Set color interpretation of a band. More... | |
GDALColorTableH | GDALGetRasterColorTable (GDALRasterBandH) |
Fetch the color table associated with band. More... | |
CPLErr | GDALSetRasterColorTable (GDALRasterBandH, GDALColorTableH) |
Set the raster color table. More... | |
int | GDALHasArbitraryOverviews (GDALRasterBandH) |
Check for arbitrary overviews. More... | |
int | GDALGetOverviewCount (GDALRasterBandH) |
Return the number of overview layers available. More... | |
GDALRasterBandH | GDALGetOverview (GDALRasterBandH, int) |
Fetch overview raster band object. More... | |
double | GDALGetRasterNoDataValue (GDALRasterBandH, int *) |
Fetch the no data value for this band. More... | |
CPLErr | GDALSetRasterNoDataValue (GDALRasterBandH, double) |
Set the no data value for this band. More... | |
char ** | GDALGetRasterCategoryNames (GDALRasterBandH) |
Fetch the list of category names for this raster. More... | |
CPLErr | GDALSetRasterCategoryNames (GDALRasterBandH, char **) |
Set the category names for this band. More... | |
double | GDALGetRasterMinimum (GDALRasterBandH, int *pbSuccess) |
Fetch the minimum value for this band. More... | |
double | GDALGetRasterMaximum (GDALRasterBandH, int *pbSuccess) |
Fetch the maximum value for this band. More... | |
CPLErr | GDALGetRasterStatistics (GDALRasterBandH, int bApproxOK, int bForce, double *pdfMin, double *pdfMax, double *pdfMean, double *pdfStdDev) |
Fetch image statistics. More... | |
CPLErr | GDALComputeRasterStatistics (GDALRasterBandH, int bApproxOK, double *pdfMin, double *pdfMax, double *pdfMean, double *pdfStdDev, GDALProgressFunc pfnProgress, void *pProgressData) |
Compute image statistics. More... | |
CPLErr | GDALSetRasterStatistics (GDALRasterBandH hBand, double dfMin, double dfMax, double dfMean, double dfStdDev) |
Set statistics on band. More... | |
const char * | GDALGetRasterUnitType (GDALRasterBandH) |
Return raster unit type. More... | |
CPLErr | GDALSetRasterUnitType (GDALRasterBandH hBand, const char *pszNewValue) |
Set unit type. More... | |
double | GDALGetRasterOffset (GDALRasterBandH, int *pbSuccess) |
Fetch the raster value offset. More... | |
CPLErr | GDALSetRasterOffset (GDALRasterBandH hBand, double dfNewOffset) |
Set scaling offset. More... | |
double | GDALGetRasterScale (GDALRasterBandH, int *pbSuccess) |
Fetch the raster value scale. More... | |
CPLErr | GDALSetRasterScale (GDALRasterBandH hBand, double dfNewOffset) |
Set scaling ratio. More... | |
void | GDALComputeRasterMinMax (GDALRasterBandH hBand, int bApproxOK, double adfMinMax[2]) |
Compute the min/max values for a band. More... | |
CPLErr | GDALFlushRasterCache (GDALRasterBandH hBand) |
Flush raster data cache. More... | |
CPLErr | GDALGetRasterHistogram (GDALRasterBandH hBand, double dfMin, double dfMax, int nBuckets, int *panHistogram, int bIncludeOutOfRange, int bApproxOK, GDALProgressFunc pfnProgress, void *pProgressData) |
Compute raster histogram. More... | |
CPLErr | GDALGetDefaultHistogram (GDALRasterBandH hBand, double *pdfMin, double *pdfMax, int *pnBuckets, int **ppanHistogram, int bForce, GDALProgressFunc pfnProgress, void *pProgressData) |
Fetch default raster histogram. More... | |
CPLErr | GDALSetDefaultHistogram (GDALRasterBandH hBand, double dfMin, double dfMax, int nBuckets, int *panHistogram) |
Set default histogram. More... | |
int | GDALGetRandomRasterSample (GDALRasterBandH, int, float *) |
GDALRasterBandH | GDALGetRasterSampleOverview (GDALRasterBandH, int) |
Fetch best sampling overview. More... | |
CPLErr | GDALFillRaster (GDALRasterBandH hBand, double dfRealValue, double dfImaginaryValue) |
Fill this band with a constant value. More... | |
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. More... | |
CPLErr | GDALSetDefaultRAT (GDALRasterBandH, GDALRasterAttributeTableH) |
Set default Raster Attribute Table. More... | |
CPLErr | GDALAddDerivedBandPixelFunc (const char *pszName, GDALDerivedPixelFunc pfnPixelFunc) |
This adds a pixel function to the global list of available pixel functions for derived bands. More... | |
GDALRasterBandH | GDALGetMaskBand (GDALRasterBandH hBand) |
Return the mask band associated with the band. More... | |
int | GDALGetMaskFlags (GDALRasterBandH hBand) |
Return the status flags of the mask band associated with the band. More... | |
CPLErr | GDALCreateMaskBand (GDALRasterBandH hBand, int nFlags) |
Adds a mask band to the current band. More... | |
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. More... | |
void | GDALSwapWords (void *pData, int nWordSize, int nWordCount, int nWordSkip) |
Byte swap words in-place. More... | |
void | GDALCopyWords (void *pSrcData, GDALDataType eSrcType, int nSrcPixelOffset, void *pDstData, GDALDataType eDstType, int nDstPixelOffset, int nWordCount) |
Copy pixel words from buffer to buffer. More... | |
void | GDALCopyBits (const GByte *pabySrcData, int nSrcOffset, int nSrcStep, GByte *pabyDstData, int nDstOffset, int nDstStep, int nBitCount, int nStepCount) |
Bitwise word copying. More... | |
int | GDALLoadWorldFile (const char *, double *) |
Read ESRI world file. More... | |
int | GDALReadWorldFile (const char *, const char *, double *) |
Read ESRI world file. More... | |
int | GDALWriteWorldFile (const char *, const char *, double *) |
Write ESRI world file. More... | |
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. More... | |
double | GDALDecToPackedDMS (double) |
Convert decimal degrees into packed DMS value (DDDMMMSSS.SS). More... | |
const char * | GDALVersionInfo (const char *) |
Get runtime version information. More... | |
int | GDALCheckVersion (int nVersionMajor, int nVersionMinor, const char *pszCallingComponentName) |
Return TRUE if GDAL library version at runtime matches nVersionMajor.nVersionMinor. More... | |
int | GDALExtractRPCInfo (char **, GDALRPCInfo *) |
GDALColorTableH | GDALCreateColorTable (GDALPaletteInterp) |
Construct a new color table. More... | |
void | GDALDestroyColorTable (GDALColorTableH) |
Destroys a color table. More... | |
GDALColorTableH | GDALCloneColorTable (GDALColorTableH) |
Make a copy of a color table. More... | |
GDALPaletteInterp | GDALGetPaletteInterpretation (GDALColorTableH) |
Fetch palette interpretation. More... | |
int | GDALGetColorEntryCount (GDALColorTableH) |
Get number of color entries in table. More... | |
const GDALColorEntry * | GDALGetColorEntry (GDALColorTableH, int) |
Fetch a color entry from table. More... | |
int | GDALGetColorEntryAsRGB (GDALColorTableH, int, GDALColorEntry *) |
Fetch a table entry in RGB format. More... | |
void | GDALSetColorEntry (GDALColorTableH, int, const GDALColorEntry *) |
Set entry in color table. More... | |
void | GDALCreateColorRamp (GDALColorTableH hTable, int nStartIndex, const GDALColorEntry *psStartColor, int nEndIndex, const GDALColorEntry *psEndColor) |
Create color ramp. More... | |
GDALRasterAttributeTableH | GDALCreateRasterAttributeTable (void) |
Construct empty table. More... | |
void | GDALDestroyRasterAttributeTable (GDALRasterAttributeTableH) |
Destroys a RAT. More... | |
int | GDALRATGetColumnCount (GDALRasterAttributeTableH) |
Fetch table column count. More... | |
const char * | GDALRATGetNameOfCol (GDALRasterAttributeTableH, int) |
Fetch name of indicated column. More... | |
GDALRATFieldUsage | GDALRATGetUsageOfCol (GDALRasterAttributeTableH, int) |
Fetch column usage value. More... | |
GDALRATFieldType | GDALRATGetTypeOfCol (GDALRasterAttributeTableH, int) |
Fetch column type. More... | |
int | GDALRATGetColOfUsage (GDALRasterAttributeTableH, GDALRATFieldUsage) |
Fetch column index for given usage. More... | |
int | GDALRATGetRowCount (GDALRasterAttributeTableH) |
Fetch row count. More... | |
const char * | GDALRATGetValueAsString (GDALRasterAttributeTableH, int, int) |
Fetch field value as a string. More... | |
int | GDALRATGetValueAsInt (GDALRasterAttributeTableH, int, int) |
Fetch field value as a integer. More... | |
double | GDALRATGetValueAsDouble (GDALRasterAttributeTableH, int, int) |
Fetch field value as a double. More... | |
void | GDALRATSetValueAsString (GDALRasterAttributeTableH, int, int, const char *) |
Set field value from string. More... | |
void | GDALRATSetValueAsInt (GDALRasterAttributeTableH, int, int, int) |
Set field value from integer. More... | |
void | GDALRATSetValueAsDouble (GDALRasterAttributeTableH, int, int, double) |
Set field value from double. More... | |
int | GDALRATChangesAreWrittenToFile (GDALRasterAttributeTableH hRAT) |
Determine whether changes made to this RAT are reflected directly in the dataset. More... | |
CPLErr | GDALRATValuesIOAsDouble (GDALRasterAttributeTableH hRAT, GDALRWFlag eRWFlag, int iField, int iStartRow, int iLength, double *pdfData) |
Read or Write a block of doubles to/from the Attribute Table. More... | |
CPLErr | GDALRATValuesIOAsInteger (GDALRasterAttributeTableH hRAT, GDALRWFlag eRWFlag, int iField, int iStartRow, int iLength, int *pnData) |
Read or Write a block of ints to/from the Attribute Table. More... | |
CPLErr | GDALRATValuesIOAsString (GDALRasterAttributeTableH hRAT, GDALRWFlag eRWFlag, int iField, int iStartRow, int iLength, char **papszStrList) |
Read or Write a block of strings to/from the Attribute Table. More... | |
void | GDALRATSetRowCount (GDALRasterAttributeTableH, int) |
Set row count. More... | |
CPLErr | GDALRATCreateColumn (GDALRasterAttributeTableH, const char *, GDALRATFieldType, GDALRATFieldUsage) |
Create new column. More... | |
CPLErr | GDALRATSetLinearBinning (GDALRasterAttributeTableH, double, double) |
Set linear binning information. More... | |
int | GDALRATGetLinearBinning (GDALRasterAttributeTableH, double *, double *) |
Get linear binning information. More... | |
CPLErr | GDALRATInitializeFromColorTable (GDALRasterAttributeTableH, GDALColorTableH) |
Initialize from color table. More... | |
GDALColorTableH | GDALRATTranslateToColorTable (GDALRasterAttributeTableH, int nEntryCount) |
Translate to a color table. More... | |
void | GDALRATDumpReadable (GDALRasterAttributeTableH, FILE *) |
Dump RAT in readable form. More... | |
GDALRasterAttributeTableH | GDALRATClone (GDALRasterAttributeTableH) |
Copy Raster Attribute Table. More... | |
int | GDALRATGetRowOfValue (GDALRasterAttributeTableH, double) |
Get row for pixel value. More... | |
void | GDALSetCacheMax (int nBytes) |
Set maximum cache memory. More... | |
int | GDALGetCacheMax (void) |
Get maximum cache memory. More... | |
int | GDALGetCacheUsed (void) |
Get cache memory used. More... | |
void | GDALSetCacheMax64 (GIntBig nBytes) |
Set maximum cache memory. More... | |
GIntBig | GDALGetCacheMax64 (void) |
Get maximum cache memory. More... | |
GIntBig | GDALGetCacheUsed64 (void) |
Get cache memory used. More... | |
int | GDALFlushCacheBlock (void) |
Try to flush one cached raster block. More... | |
CPLVirtualMem * | GDALDatasetGetVirtualMem (GDALDatasetH hDS, GDALRWFlag eRWFlag, int nXOff, int nYOff, int nXSize, int nYSize, int nBufXSize, int nBufYSize, GDALDataType eBufType, int nBandCount, int *panBandMap, int nPixelSpace, GIntBig nLineSpace, GIntBig nBandSpace, size_t nCacheSize, size_t nPageSizeHint, int bSingleThreadUsage, char **papszOptions) |
Create a CPLVirtualMem object from a GDAL dataset object. More... | |
CPLVirtualMem * | GDALRasterBandGetVirtualMem (GDALRasterBandH hBand, GDALRWFlag eRWFlag, int nXOff, int nYOff, int nXSize, int nYSize, int nBufXSize, int nBufYSize, GDALDataType eBufType, int nPixelSpace, GIntBig nLineSpace, size_t nCacheSize, size_t nPageSizeHint, int bSingleThreadUsage, char **papszOptions) |
Create a CPLVirtualMem object from a GDAL raster band object. More... | |
CPLVirtualMem * | GDALGetVirtualMemAuto (GDALRasterBandH hBand, GDALRWFlag eRWFlag, int *pnPixelSpace, GIntBig *pnLineSpace, char **papszOptions) |
Create a CPLVirtualMem object from a GDAL raster band object. More... | |
CPLVirtualMem * | GDALDatasetGetTiledVirtualMem (GDALDatasetH hDS, GDALRWFlag eRWFlag, int nXOff, int nYOff, int nXSize, int nYSize, int nTileXSize, int nTileYSize, GDALDataType eBufType, int nBandCount, int *panBandMap, GDALTileOrganization eTileOrganization, size_t nCacheSize, int bSingleThreadUsage, char **papszOptions) |
Create a CPLVirtualMem object from a GDAL dataset object, with tiling organization. More... | |
CPLVirtualMem * | GDALRasterBandGetTiledVirtualMem (GDALRasterBandH hBand, GDALRWFlag eRWFlag, int nXOff, int nYOff, int nXSize, int nYSize, int nTileXSize, int nTileYSize, GDALDataType eBufType, size_t nCacheSize, int bSingleThreadUsage, char **papszOptions) |
Create a CPLVirtualMem object from a GDAL rasterband object, with tiling organization. More... | |
Public (C callable) GDAL entry points.
#define GDAL_CHECK_VERSION | ( | pszCallingComponentName | ) | GDALCheckVersion(GDAL_VERSION_MAJOR, GDAL_VERSION_MINOR, pszCallingComponentName) |
Helper macro for GDALCheckVersion()
#define SRCVAL | ( | papoSource, | |
eSrcType, | |||
ii | |||
) |
SRCVAL - Macro which may be used by pixel functions to obtain a pixel from a source buffer.
enum GDALAccess |
enum GDALColorInterp |
Types of color interpretation for raster bands.
enum GDALDataType |
Pixel data types
enum GDALPaletteInterp |
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) |
enum GDALRATFieldType |
enum GDALRATFieldUsage |
Field usage of raster attribute table.
enum GDALRWFlag |
enum GDALTileOrganization |
CPLErr GDALAddBand | ( | GDALDatasetH | hDataset, |
GDALDataType | eType, | ||
char ** | papszOptions | ||
) |
Add a band to a dataset.
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.
pszFuncName | Name used to access pixel function |
pfnNewFunction | Pixel function associated with name. An existing pixel function registered with the same name will be replaced with the new one. |
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):
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]
padfGeoTransform | Six coefficient GeoTransform to apply. |
dfPixel | Input pixel position. |
dfLine | Input line position. |
pdfGeoX | output location where geo_x (easting/longitude) location is placed. |
pdfGeoY | output 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)
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.
nVersionMajor | Major version to be tested against |
nVersionMinor | Minor version to be tested against |
pszCallingComponentName | If not NULL, in case of version mismatch, the method will issue a failure mentionning the name of the calling component. |
GDALColorTableH GDALCloneColorTable | ( | GDALColorTableH | hTable | ) |
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.
hDS | The dataset to close. May be cast from a "GDALDataset *". |
void GDALComposeGeoTransforms | ( | const double * | padfGT1, |
const double * | padfGT2, | ||
double * | padfGTOut | ||
) |
Compose two geotransforms.
The resulting geotransform is the equivelent to padfGT1 and then padfGT2 being applied to a point.
padfGT1 | the first geotransform, six values. |
padfGT2 | the second geotransform, six values. |
padfGTOut | the output geotransform, six values, may safely be the same array as padfGT1 or padfGT2. |
void GDALComputeRasterMinMax | ( | GDALRasterBandH | hBand, |
int | bApproxOK, | ||
double | adfMinMax[2] | ||
) |
Compute the min/max values for a band.
CPLErr GDALComputeRasterStatistics | ( | GDALRasterBandH | hBand, |
int | bApproxOK, | ||
double * | pdfMin, | ||
double * | pdfMax, | ||
double * | pdfMean, | ||
double * | pdfStdDev, | ||
GDALProgressFunc | pfnProgress, | ||
void * | pProgressData | ||
) |
Compute image statistics.
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.
pabySrcData | the source data buffer. |
nSrcOffset | the offset (in bits) in pabySrcData to the start of the first word to copy. |
nSrcStep | the offset in bits from the start one source word to the start of the next. |
pabyDstData | the destination data buffer. |
nDstOffset | the offset (in bits) in pabyDstData to the start of the first word to copy over. |
nDstStep | the offset in bits from the start one word to the start of the next. |
nBitCount | the number of bits in a word to be copied. |
nStepCount | the number of words to copy. |
CPLErr GDALCopyDatasetFiles | ( | GDALDriverH | hDriver, |
const char * | pszNewName, | ||
const char * | pszOldName | ||
) |
Copy the files of a dataset.
void GDALCopyWords | ( | void * | pSrcData, |
GDALDataType | eSrcType, | ||
int | nSrcPixelStride, | ||
void * | pDstData, | ||
GDALDataType | eDstType, | ||
int | nDstPixelStride, | ||
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.
pSrcData | Pointer to source data to be converted. |
eSrcType | the source data type (see GDALDataType enum) |
nSrcPixelStride | Source pixel stride (i.e. distance between 2 words), in bytes |
pDstData | Pointer to buffer where destination data should go |
eDstType | the destination data type (see GDALDataType enum) |
nDstPixelStride | Destination pixel stride (i.e. distance between 2 words), in bytes |
nWordCount | number of words to be copied |
GDALDatasetH GDALCreate | ( | GDALDriverH | hDriver, |
const char * | pszFilename, | ||
int | nXSize, | ||
int | nYSize, | ||
int | nBands, | ||
GDALDataType | eBandType, | ||
char ** | papszOptions | ||
) |
Create a new dataset with this driver.
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()
GDALColorTableH GDALCreateColorTable | ( | GDALPaletteInterp | eInterp | ) |
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.
CPLErr GDALCreateDatasetMaskBand | ( | GDALDatasetH | hDS, |
int | nFlags | ||
) |
Adds a mask band to the dataset.
CPLErr GDALCreateMaskBand | ( | GDALRasterBandH | hBand, |
int | nFlags | ||
) |
Adds a mask band to the current band.
GDALRasterAttributeTableH GDALCreateRasterAttributeTable | ( | void | ) |
Construct empty table.
This function is the same as the C++ method GDALDefaultRasterAttributeTable::GDALDefaultRasterAttributeTable()
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.
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.
hSrcDS | the source dataset |
hDstDS | the destination dataset |
papszOptions | transfer hints in "StringList" Name=Value format. |
pfnProgress | progress reporting function. |
pProgressData | callback data for progress function. |
CPLVirtualMem* GDALDatasetGetTiledVirtualMem | ( | GDALDatasetH | hDS, |
GDALRWFlag | eRWFlag, | ||
int | nXOff, | ||
int | nYOff, | ||
int | nXSize, | ||
int | nYSize, | ||
int | nTileXSize, | ||
int | nTileYSize, | ||
GDALDataType | eBufType, | ||
int | nBandCount, | ||
int * | panBandMap, | ||
GDALTileOrganization | eTileOrganization, | ||
size_t | nCacheSize, | ||
int | bSingleThreadUsage, | ||
char ** | papszOptions | ||
) |
Create a CPLVirtualMem object from a GDAL dataset object, with tiling organization.
Only supported on Linux for now.
This method allows creating a virtual memory object for a region of one or more GDALRasterBands from this dataset. The content of the virtual memory object is automatically filled from dataset content when a virtual memory page is first accessed, and it is released (or flushed in case of a "dirty" page) when the cache size limit has been reached.
Contrary to GDALDatasetGetVirtualMem(), pixels will be organized by tiles instead of scanlines. Different ways of organizing pixel within/accross tiles can be selected with the eTileOrganization parameter.
If nXSize is not a multiple of nTileXSize or nYSize is not a multiple of nTileYSize, partial tiles will exists at the right and/or bottom of the region of interest. Those partial tiles will also have nTileXSize * nTileYSize dimension, with padding pixels.
The pointer to access the virtual memory object is obtained with CPLVirtualMemGetAddr(). It remains valid until CPLVirtualMemFree() is called. CPLVirtualMemFree() must be called before the dataset object is destroyed.
If p is such a pointer and base_type the C type matching eBufType, for default values of spacing parameters, the element of image coordinates (x, y) (relative to xOff, yOff) for band b can be accessed with :
where nTilesPerRow = ceil(nXSize / nTileXSize) nTilesPerCol = ceil(nYSize / nTileYSize) nTilesCount = nTilesPerRow * nTilesPerCol tile_number(x,y) = (y / nTileYSize) * nTilesPerRow + (x / nTileXSize) offset_in_tile(x,y) = (y % nTileYSize) * nTileXSize + (x % nTileXSize) tile_size = nTileXSize * nTileYSize
Note that for a single band request, all tile organizations are equivalent.
Note that the mechanism used to transparently fill memory pages when they are accessed is the same (but in a controlled way) than what occurs when a memory error occurs in a program. Debugging software will generally interrupt program execution when that happens. If needed, CPLVirtualMemPin() can be used to avoid that by ensuring memory pages are allocated before being accessed.
The size of the region that can be mapped as a virtual memory object depends on hardware and operating system limitations. On Linux AMD64 platforms, the maximum value is 128 TB. On Linux x86 platforms, the maximum value is 2 GB.
Data type translation is automatically done if the data type (eBufType) of the buffer is different than that of the GDALRasterBand.
hDS | Dataset object |
eRWFlag | Either GF_Read to read a region of data, or GF_Write to write a region of data. |
nXOff | The 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. |
nYOff | The 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. |
nXSize | The width of the region of the band to be accessed in pixels. |
nYSize | The height of the region of the band to be accessed in lines. |
nTileXSize | the width of the tiles. |
nTileYSize | the height of the tiles. |
eBufType | the type of the pixel values in the data buffer. The pixel values will automatically be translated to/from the GDALRasterBand data type as needed. |
nBandCount | the number of bands being read or written. |
panBandMap | the list of nBandCount band numbers being read/written. Note band numbers are 1 based. This may be NULL to select the first nBandCount bands. |
eTileOrganization | tile organization. |
nCacheSize | size in bytes of the maximum memory that will be really allocated (must ideally fit into RAM) |
bSingleThreadUsage | set to TRUE if there will be no concurrent threads that will access the virtual memory mapping. This can optimize performance a bit. If set to FALSE, CPLVirtualMemDeclareThread() must be called. |
papszOptions | NULL terminated list of options. Unused for now. |
CPLVirtualMem* GDALDatasetGetVirtualMem | ( | GDALDatasetH | hDS, |
GDALRWFlag | eRWFlag, | ||
int | nXOff, | ||
int | nYOff, | ||
int | nXSize, | ||
int | nYSize, | ||
int | nBufXSize, | ||
int | nBufYSize, | ||
GDALDataType | eBufType, | ||
int | nBandCount, | ||
int * | panBandMap, | ||
int | nPixelSpace, | ||
GIntBig | nLineSpace, | ||
GIntBig | nBandSpace, | ||
size_t | nCacheSize, | ||
size_t | nPageSizeHint, | ||
int | bSingleThreadUsage, | ||
char ** | papszOptions | ||
) |
Create a CPLVirtualMem object from a GDAL dataset object.
Only supported on Linux for now.
This method allows creating a virtual memory object for a region of one or more GDALRasterBands from this dataset. The content of the virtual memory object is automatically filled from dataset content when a virtual memory page is first accessed, and it is released (or flushed in case of a "dirty" page) when the cache size limit has been reached.
The pointer to access the virtual memory object is obtained with CPLVirtualMemGetAddr(). It remains valid until CPLVirtualMemFree() is called. CPLVirtualMemFree() must be called before the dataset object is destroyed.
If p is such a pointer and base_type the C type matching eBufType, for default values of spacing parameters, the element of image coordinates (x, y) (relative to xOff, yOff) for band b can be accessed with ((base_type*)p)[x + y * nBufXSize + (b-1)*nBufXSize*nBufYSize].
Note that the mechanism used to transparently fill memory pages when they are accessed is the same (but in a controlled way) than what occurs when a memory error occurs in a program. Debugging software will generally interrupt program execution when that happens. If needed, CPLVirtualMemPin() can be used to avoid that by ensuring memory pages are allocated before being accessed.
The size of the region that can be mapped as a virtual memory object depends on hardware and operating system limitations. On Linux AMD64 platforms, the maximum value is 128 TB. On Linux x86 platforms, the maximum value is 2 GB.
Data type translation is automatically done if the data type (eBufType) of the buffer is different than that of the GDALRasterBand.
Image decimation / replication is currently not supported, i.e. if the size of the region being accessed (nXSize x nYSize) is different from the buffer size (nBufXSize x nBufYSize).
The nPixelSpace, nLineSpace and nBandSpace parameters allow reading into or writing from various organization of buffers. Arbitrary values for the spacing parameters are not supported. Those values must be multiple of the size of the buffer data type, and must be either band sequential organization (typically nPixelSpace = GDALGetDataTypeSize(eBufType) / 8, nLineSpace = nPixelSpace * nBufXSize, nBandSpace = nLineSpace * nBufYSize), or pixel-interleaved organization (typically nPixelSpace = nBandSpace * nBandCount, nLineSpace = nPixelSpace * nBufXSize, nBandSpace = GDALGetDataTypeSize(eBufType) / 8)
hDS | Dataset object |
eRWFlag | Either GF_Read to read a region of data, or GF_Write to write a region of data. |
nXOff | The 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. |
nYOff | The 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. |
nXSize | The width of the region of the band to be accessed in pixels. |
nYSize | The height of the region of the band to be accessed in lines. |
nBufXSize | the width of the buffer image into which the desired region is to be read, or from which it is to be written. |
nBufYSize | the height of the buffer image into which the desired region is to be read, or from which it is to be written. |
eBufType | the type of the pixel values in the data buffer. The pixel values will automatically be translated to/from the GDALRasterBand data type as needed. |
nBandCount | the number of bands being read or written. |
panBandMap | the list of nBandCount band numbers being read/written. Note band numbers are 1 based. This may be NULL to select the first nBandCount bands. |
nPixelSpace | The byte offset from the start of one pixel value in the buffer to the start of the next pixel value within a scanline. If defaulted (0) the size of the datatype eBufType is used. |
nLineSpace | The byte offset from the start of one scanline in the buffer to the start of the next. If defaulted (0) the size of the datatype eBufType * nBufXSize is used. |
nBandSpace | the 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. |
nCacheSize | size in bytes of the maximum memory that will be really allocated (must ideally fit into RAM) |
nPageSizeHint | hint for the page size. Must be a multiple of the system page size, returned by CPLGetPageSize(). Minimum value is generally 4096. Might be set to 0 to let the function determine a default page size. |
bSingleThreadUsage | set to TRUE if there will be no concurrent threads that will access the virtual memory mapping. This can optimize performance a bit. If set to FALSE, CPLVirtualMemDeclareThread() must be called. |
papszOptions | NULL terminated list of options. Unused for now. |
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.
int GDALDataTypeIsComplex | ( | GDALDataType | eDataType | ) |
Is data type complex?
GDALDataType GDALDataTypeUnion | ( | GDALDataType | eType1, |
GDALDataType | eType2 | ||
) |
Return the smallest data type that can fully express both input data types.
eType1 | first data type. |
eType2 | second data type. |
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.
int GDALDereferenceDataset | ( | GDALDatasetH | hDataset | ) |
Subtract one from dataset reference count.
void GDALDeregisterDriver | ( | GDALDriverH | hDriver | ) |
Deregister the passed driver.
void GDALDestroyColorTable | ( | GDALColorTableH | hTable | ) |
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.
hDriver | the 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.
void GDALDestroyRasterAttributeTable | ( | GDALRasterAttributeTableH | hRAT | ) |
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.
void GDALFlushCache | ( | GDALDatasetH | hDS | ) |
Flush all write cached data to disk.
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.
CPLErr GDALFlushRasterCache | ( | GDALRasterBandH | hBand | ) |
Flush raster data cache.
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.
nGCPCount | the number of GCPs being passed in. |
pasGCPs | the list of GCP structures. |
padfGeoTransform | the six double array in which the affine geotransformation will be returned. |
bApproxOK | If FALSE the function will fail if the geotransform is not essentially an exact fit (within 0.25 pixel) for all GCPs. |
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 );
nArgc | number of values in the argument list. |
ppapszArgv | pointer to the argument list array (will be updated in place). |
nOptions | unused for now. |
int GDALGetAccess | ( | GDALDatasetH | hDS | ) |
Return access flag.
GDALAsyncStatusType GDALGetAsyncStatusTypeByName | ( | const char * | pszName | ) |
Get AsyncStatusType by symbolic name.
Returns a data type corresponding to the given symbolic name. This function is opposite to the GDALGetAsyncStatusTypeName().
pszName | string containing the symbolic name of the 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.
eAsyncStatusType | type to get name of. |
GDALDatasetH GDALGetBandDataset | ( | GDALRasterBandH | hBand | ) |
Fetch the owning dataset handle.
int GDALGetBandNumber | ( | GDALRasterBandH | hBand | ) |
Fetch the band number.
void GDALGetBlockSize | ( | GDALRasterBandH | hBand, |
int * | pnXSize, | ||
int * | pnYSize | ||
) |
Fetch the "natural" block size of this band.
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.
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.
int GDALGetCacheUsed | ( | void | ) |
Get cache memory used.
GIntBig GDALGetCacheUsed64 | ( | void | ) |
Get cache memory used.
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()
int GDALGetColorEntryCount | ( | GDALColorTableH | hTable | ) |
Get number of color entries in table.
This function is the same as the C++ method GDALColorTable::GetColorEntryCount()
GDALColorInterp GDALGetColorInterpretationByName | ( | const char * | pszName | ) |
Get color interpreation by symbolic name.
Returns a color interpreation corresponding to the given symbolic name. This function is opposite to the GDALGetColorInterpretationName().
pszName | string containing the symbolic name of the color interpretation. |
const char* GDALGetColorInterpretationName | ( | GDALColorInterp | eInterp | ) |
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.
eInterp | color interpretation to get name of. |
GDALDriverH GDALGetDatasetDriver | ( | GDALDatasetH | hDataset | ) |
Fetch the driver to which this dataset relates.
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().
pszName | string containing the symbolic name of the 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.
eDataType | type to get name of. |
int GDALGetDataTypeSize | ( | GDALDataType | eDataType | ) |
Get data type size in bits.
Returns the size of a a GDT_* type in bits, not bytes!
eDataType | type, such as GDT_Byte. |
CPLErr GDALGetDefaultHistogram | ( | GDALRasterBandH | hBand, |
double * | pdfMin, | ||
double * | pdfMax, | ||
int * | pnBuckets, | ||
int ** | ppanHistogram, | ||
int | bForce, | ||
GDALProgressFunc | pfnProgress, | ||
void * | pProgressData | ||
) |
Fetch default raster histogram.
GDALRasterAttributeTableH GDALGetDefaultRAT | ( | GDALRasterBandH | hBand | ) |
Fetch default Raster Attribute Table.
const char* GDALGetDescription | ( | GDALMajorObjectH | hObject | ) |
Fetch object description.
GDALDriverH GDALGetDriver | ( | int | iDriver | ) |
Fetch driver by index.
GDALDriverH GDALGetDriverByName | ( | const char * | pszName | ) |
Fetch a driver based on the short name.
int GDALGetDriverCount | ( | void | ) |
Fetch the number of registered drivers.
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
hDriver | the handle of 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"
hDriver | the handle of the driver |
const char* GDALGetDriverLongName | ( | GDALDriverH | hDriver | ) |
Return the long name of a driver.
For the GeoTIFF driver, this is "GeoTIFF"
hDriver | the handle of 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"
hDriver | the handle of the driver |
char** GDALGetFileList | ( | GDALDatasetH | hDS | ) |
Fetch files forming dataset.
int GDALGetGCPCount | ( | GDALDatasetH | hDS | ) |
Get number of GCPs.
const char* GDALGetGCPProjection | ( | GDALDatasetH | hDS | ) |
Get output projection for GCPs.
const GDAL_GCP* GDALGetGCPs | ( | GDALDatasetH | hDS | ) |
Fetch GCPs.
CPLErr GDALGetGeoTransform | ( | GDALDatasetH | hDS, |
double * | padfTransform | ||
) |
Fetch the affine transformation coefficients.
void* GDALGetInternalHandle | ( | GDALDatasetH | hDS, |
const char * | pszRequest | ||
) |
Fetch a format specific internally meaningful handle.
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.
char** GDALGetMetadata | ( | GDALMajorObjectH | hObject, |
const char * | pszDomain | ||
) |
Fetch metadata.
char** GDALGetMetadataDomainList | ( | GDALMajorObjectH | hObject | ) |
const char* GDALGetMetadataItem | ( | GDALMajorObjectH | hObject, |
const char * | pszName, | ||
const char * | pszDomain | ||
) |
Fetch single metadata item.
void GDALGetOpenDatasets | ( | GDALDatasetH ** | ppahDSList, |
int * | pnCount | ||
) |
Fetch all open GDAL dataset handles.
GDALRasterBandH GDALGetOverview | ( | GDALRasterBandH | hBand, |
int | i | ||
) |
Fetch overview raster band object.
int GDALGetOverviewCount | ( | GDALRasterBandH | hBand | ) |
Return the number of overview layers available.
GDALPaletteInterp GDALGetPaletteInterpretation | ( | GDALColorTableH | hTable | ) |
Fetch palette interpretation.
This function is the same as the C++ method GDALColorTable::GetPaletteInterpretation()
const char* GDALGetPaletteInterpretationName | ( | GDALPaletteInterp | eInterp | ) |
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.
eInterp | palette interpretation to get name of. |
const char* GDALGetProjectionRef | ( | GDALDatasetH | hDS | ) |
Fetch the projection definition string for this dataset.
GDALAccess GDALGetRasterAccess | ( | GDALRasterBandH | hBand | ) |
Find out if we have update permission for this band.
GDALRasterBandH GDALGetRasterBand | ( | GDALDatasetH | hDS, |
int | nBandId | ||
) |
Fetch a band object for a dataset.
int GDALGetRasterBandXSize | ( | GDALRasterBandH | hBand | ) |
Fetch XSize of raster.
int GDALGetRasterBandYSize | ( | GDALRasterBandH | hBand | ) |
Fetch YSize of raster.
char** GDALGetRasterCategoryNames | ( | GDALRasterBandH | hBand | ) |
Fetch the list of category names for this raster.
GDALColorInterp GDALGetRasterColorInterpretation | ( | GDALRasterBandH | hBand | ) |
How should this band be interpreted as color?
GDALColorTableH GDALGetRasterColorTable | ( | GDALRasterBandH | hBand | ) |
Fetch the color table associated with band.
int GDALGetRasterCount | ( | GDALDatasetH | hDS | ) |
Fetch the number of raster bands on this dataset.
GDALDataType GDALGetRasterDataType | ( | GDALRasterBandH | hBand | ) |
Fetch the pixel data type for this band.
CPLErr GDALGetRasterHistogram | ( | GDALRasterBandH | hBand, |
double | dfMin, | ||
double | dfMax, | ||
int | nBuckets, | ||
int * | panHistogram, | ||
int | bIncludeOutOfRange, | ||
int | bApproxOK, | ||
GDALProgressFunc | pfnProgress, | ||
void * | pProgressData | ||
) |
Compute raster histogram.
double GDALGetRasterMaximum | ( | GDALRasterBandH | hBand, |
int * | pbSuccess | ||
) |
Fetch the maximum value for this band.
double GDALGetRasterMinimum | ( | GDALRasterBandH | hBand, |
int * | pbSuccess | ||
) |
Fetch the minimum value for this band.
double GDALGetRasterNoDataValue | ( | GDALRasterBandH | hBand, |
int * | pbSuccess | ||
) |
Fetch the no data value for this band.
double GDALGetRasterOffset | ( | GDALRasterBandH | hBand, |
int * | pbSuccess | ||
) |
Fetch the raster value offset.
GDALRasterBandH GDALGetRasterSampleOverview | ( | GDALRasterBandH | hBand, |
int | nDesiredSamples | ||
) |
Fetch best sampling overview.
double GDALGetRasterScale | ( | GDALRasterBandH | hBand, |
int * | pbSuccess | ||
) |
Fetch the raster value scale.
CPLErr GDALGetRasterStatistics | ( | GDALRasterBandH | hBand, |
int | bApproxOK, | ||
int | bForce, | ||
double * | pdfMin, | ||
double * | pdfMax, | ||
double * | pdfMean, | ||
double * | pdfStdDev | ||
) |
Fetch image statistics.
const char* GDALGetRasterUnitType | ( | GDALRasterBandH | hBand | ) |
Return raster unit type.
int GDALGetRasterXSize | ( | GDALDatasetH | hDataset | ) |
Fetch raster width in pixels.
int GDALGetRasterYSize | ( | GDALDatasetH | hDataset | ) |
Fetch raster height in pixels.
CPLVirtualMem* GDALGetVirtualMemAuto | ( | GDALRasterBandH | hBand, |
GDALRWFlag | eRWFlag, | ||
int * | pnPixelSpace, | ||
GIntBig * | pnLineSpace, | ||
char ** | papszOptions | ||
) |
Create a CPLVirtualMem object from a GDAL raster band object.
int GDALHasArbitraryOverviews | ( | GDALRasterBandH | hBand | ) |
Check for arbitrary overviews.
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.
pszFilename | the 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. |
papszFileList | an 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. |
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.
gt_in | Input geotransform (six doubles - unaltered). |
gt_out | Output geotransform (six doubles - updated). |
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.
pszFilename | the world file name. |
padfGeoTransform | the six double array into which the geotransformation should be placed. |
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 :
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.
pszFilename | the 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. |
eAccess | the desired access, either GA_Update or GA_ReadOnly. Many drivers support only read only access. |
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 explicitly 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.
pszFilename | the 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. |
eAccess | the desired access, either GA_Update or GA_ReadOnly. Many drivers support only read only access. |
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.
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.
hSrcBand | the source band |
hDstBand | the destination band |
papszOptions | transfer hints in "StringList" Name=Value format. |
pfnProgress | progress reporting function. |
pProgressData | callback data for progress function. |
CPLVirtualMem* GDALRasterBandGetTiledVirtualMem | ( | GDALRasterBandH | hBand, |
GDALRWFlag | eRWFlag, | ||
int | nXOff, | ||
int | nYOff, | ||
int | nXSize, | ||
int | nYSize, | ||
int | nTileXSize, | ||
int | nTileYSize, | ||
GDALDataType | eBufType, | ||
size_t | nCacheSize, | ||
int | bSingleThreadUsage, | ||
char ** | papszOptions | ||
) |
Create a CPLVirtualMem object from a GDAL rasterband object, with tiling organization.
Only supported on Linux for now.
This method allows creating a virtual memory object for a region of one GDALRasterBand. The content of the virtual memory object is automatically filled from dataset content when a virtual memory page is first accessed, and it is released (or flushed in case of a "dirty" page) when the cache size limit has been reached.
Contrary to GDALDatasetGetVirtualMem(), pixels will be organized by tiles instead of scanlines.
If nXSize is not a multiple of nTileXSize or nYSize is not a multiple of nTileYSize, partial tiles will exists at the right and/or bottom of the region of interest. Those partial tiles will also have nTileXSize * nTileYSize dimension, with padding pixels.
The pointer to access the virtual memory object is obtained with CPLVirtualMemGetAddr(). It remains valid until CPLVirtualMemFree() is called. CPLVirtualMemFree() must be called before the raster band object is destroyed.
If p is such a pointer and base_type the C type matching eBufType, for default values of spacing parameters, the element of image coordinates (x, y) (relative to xOff, yOff) can be accessed with : ((base_type*)p)[tile_number(x,y)*tile_size + offset_in_tile(x,y)].
where nTilesPerRow = ceil(nXSize / nTileXSize) nTilesCount = nTilesPerRow * nTilesPerCol tile_number(x,y) = (y / nTileYSize) * nTilesPerRow + (x / nTileXSize) offset_in_tile(x,y) = (y % nTileYSize) * nTileXSize + (x % nTileXSize) tile_size = nTileXSize * nTileYSize
Note that the mechanism used to transparently fill memory pages when they are accessed is the same (but in a controlled way) than what occurs when a memory error occurs in a program. Debugging software will generally interrupt program execution when that happens. If needed, CPLVirtualMemPin() can be used to avoid that by ensuring memory pages are allocated before being accessed.
The size of the region that can be mapped as a virtual memory object depends on hardware and operating system limitations. On Linux AMD64 platforms, the maximum value is 128 TB. On Linux x86 platforms, the maximum value is 2 GB.
Data type translation is automatically done if the data type (eBufType) of the buffer is different than that of the GDALRasterBand.
hBand | Rasterband object |
eRWFlag | Either GF_Read to read a region of data, or GF_Write to write a region of data. |
nXOff | The 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. |
nYOff | The 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. |
nXSize | The width of the region of the band to be accessed in pixels. |
nYSize | The height of the region of the band to be accessed in lines. |
nTileXSize | the width of the tiles. |
nTileYSize | the height of the tiles. |
eBufType | the type of the pixel values in the data buffer. The pixel values will automatically be translated to/from the GDALRasterBand data type as needed. |
nCacheSize | size in bytes of the maximum memory that will be really allocated (must ideally fit into RAM) |
bSingleThreadUsage | set to TRUE if there will be no concurrent threads that will access the virtual memory mapping. This can optimize performance a bit. If set to FALSE, CPLVirtualMemDeclareThread() must be called. |
papszOptions | NULL terminated list of options. Unused for now. |
CPLVirtualMem* GDALRasterBandGetVirtualMem | ( | GDALRasterBandH | hBand, |
GDALRWFlag | eRWFlag, | ||
int | nXOff, | ||
int | nYOff, | ||
int | nXSize, | ||
int | nYSize, | ||
int | nBufXSize, | ||
int | nBufYSize, | ||
GDALDataType | eBufType, | ||
int | nPixelSpace, | ||
GIntBig | nLineSpace, | ||
size_t | nCacheSize, | ||
size_t | nPageSizeHint, | ||
int | bSingleThreadUsage, | ||
char ** | papszOptions | ||
) |
Create a CPLVirtualMem object from a GDAL raster band object.
Only supported on Linux for now.
This method allows creating a virtual memory object for a region of a GDALRasterBand. The content of the virtual memory object is automatically filled from dataset content when a virtual memory page is first accessed, and it is released (or flushed in case of a "dirty" page) when the cache size limit has been reached.
The pointer to access the virtual memory object is obtained with CPLVirtualMemGetAddr(). It remains valid until CPLVirtualMemFree() is called. CPLVirtualMemFree() must be called before the raster band object is destroyed.
If p is such a pointer and base_type the C type matching eBufType, for default values of spacing parameters, the element of image coordinates (x, y) (relative to xOff, yOff) can be accessed with ((base_type*)p)[x + y * nBufXSize].
Note that the mechanism used to transparently fill memory pages when they are accessed is the same (but in a controlled way) than what occurs when a memory error occurs in a program. Debugging software will generally interrupt program execution when that happens. If needed, CPLVirtualMemPin() can be used to avoid that by ensuring memory pages are allocated before being accessed.
The size of the region that can be mapped as a virtual memory object depends on hardware and operating system limitations. On Linux AMD64 platforms, the maximum value is 128 TB. On Linux x86 platforms, the maximum value is 2 GB.
Data type translation is automatically done if the data type (eBufType) of the buffer is different than that of the GDALRasterBand.
Image decimation / replication is currently not supported, i.e. if the size of the region being accessed (nXSize x nYSize) is different from the buffer size (nBufXSize x nBufYSize).
The nPixelSpace and nLineSpace parameters allow reading into or writing from various organization of buffers. Arbitrary values for the spacing parameters are not supported. Those values must be multiple of the size of the buffer data type and must be such that nLineSpace >= nPixelSpace * nBufXSize.
hBand | Rasterband object |
eRWFlag | Either GF_Read to read a region of data, or GF_Write to write a region of data. |
nXOff | The 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. |
nYOff | The 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. |
nXSize | The width of the region of the band to be accessed in pixels. |
nYSize | The height of the region of the band to be accessed in lines. |
nBufXSize | the width of the buffer image into which the desired region is to be read, or from which it is to be written. |
nBufYSize | the height of the buffer image into which the desired region is to be read, or from which it is to be written. |
eBufType | the type of the pixel values in the data buffer. The pixel values will automatically be translated to/from the GDALRasterBand data type as needed. |
nPixelSpace | The byte offset from the start of one pixel value in the buffer to the start of the next pixel value within a scanline. If defaulted (0) the size of the datatype eBufType is used. |
nLineSpace | The byte offset from the start of one scanline in the buffer to the start of the next. If defaulted (0) the size of the datatype eBufType * nBufXSize is used. |
nCacheSize | size in bytes of the maximum memory that will be really allocated (must ideally fit into RAM) |
nPageSizeHint | hint for the page size. Must be a multiple of the system page size, returned by CPLGetPageSize(). Minimum value is generally 4096. Might be set to 0 to let the function determine a default page size. |
bSingleThreadUsage | set to TRUE if there will be no concurrent threads that will access the virtual memory mapping. This can optimize performance a bit. If set to FALSE, CPLVirtualMemDeclareThread() must be called. |
papszOptions | NULL terminated list of options. Unused for now. |
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.
int GDALRATChangesAreWrittenToFile | ( | GDALRasterAttributeTableH | hRAT | ) |
Determine whether changes made to this RAT are reflected directly in the dataset.
This function is the same as the C++ method GDALRasterAttributeTable::ChangesAreWrittenToFile()
GDALRasterAttributeTableH GDALRATClone | ( | GDALRasterAttributeTableH | hRAT | ) |
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()
int GDALRATGetColOfUsage | ( | GDALRasterAttributeTableH | hRAT, |
GDALRATFieldUsage | eUsage | ||
) |
Fetch column index for given usage.
This function is the same as the C++ method GDALRasterAttributeTable::GetColOfUsage()
int GDALRATGetColumnCount | ( | GDALRasterAttributeTableH | hRAT | ) |
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()
int GDALRATGetRowCount | ( | GDALRasterAttributeTableH | hRAT | ) |
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()
GDALRATFieldType GDALRATGetTypeOfCol | ( | GDALRasterAttributeTableH | hRAT, |
int | iCol | ||
) |
Fetch column type.
This function is the same as the C++ method GDALRasterAttributeTable::GetTypeOfCol()
GDALRATFieldUsage GDALRATGetUsageOfCol | ( | GDALRasterAttributeTableH | hRAT, |
int | iCol | ||
) |
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()
CPLErr GDALRATInitializeFromColorTable | ( | GDALRasterAttributeTableH | hRAT, |
GDALColorTableH | hCT | ||
) |
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()
GDALColorTableH GDALRATTranslateToColorTable | ( | GDALRasterAttributeTableH | hRAT, |
int | nEntryCount | ||
) |
Translate to a color table.
This function is the same as the C++ method GDALRasterAttributeTable::TranslateToColorTable()
CPLErr GDALRATValuesIOAsDouble | ( | GDALRasterAttributeTableH | hRAT, |
GDALRWFlag | eRWFlag, | ||
int | iField, | ||
int | iStartRow, | ||
int | iLength, | ||
double * | pdfData | ||
) |
Read or Write a block of doubles to/from the Attribute Table.
This function is the same as the C++ method GDALRasterAttributeTable::ValuesIO()
CPLErr GDALRATValuesIOAsInteger | ( | GDALRasterAttributeTableH | hRAT, |
GDALRWFlag | eRWFlag, | ||
int | iField, | ||
int | iStartRow, | ||
int | iLength, | ||
int * | pnData | ||
) |
Read or Write a block of ints to/from the Attribute Table.
This function is the same as the C++ method GDALRasterAttributeTable::ValuesIO()
CPLErr GDALRATValuesIOAsString | ( | GDALRasterAttributeTableH | hRAT, |
GDALRWFlag | eRWFlag, | ||
int | iField, | ||
int | iStartRow, | ||
int | iLength, | ||
char ** | papszStrList | ||
) |
Read or Write a block of strings to/from the Attribute Table.
This function is the same as the C++ method GDALRasterAttributeTable::ValuesIO()
CPLErr GDALReadBlock | ( | GDALRasterBandH | hBand, |
int | nXOff, | ||
int | nYOff, | ||
void * | pData | ||
) |
Read a block of image data efficiently.
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.
pszBaseFilename | the target raster file. |
pszExtension | the extension to use (ie. ".wld") or NULL to derive it from the pszBaseFilename |
padfGeoTransform | the six double array into which the geotransformation should be placed. |
int GDALReferenceDataset | ( | GDALDatasetH | hDataset | ) |
Add one to dataset reference count.
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.
hSrcBand | the source (base level) band. |
nOverviewCount | the number of downsampled bands being generated. |
pahOvrBands | the list of downsampled bands to be generated. |
pszResampling | Resampling algorithm (eg. "AVERAGE"). |
pfnProgress | progress report function. |
pProgressData | progress function callback data. |
int GDALRegisterDriver | ( | GDALDriverH | hDriver | ) |
Register a driver for use.
CPLErr GDALRenameDataset | ( | GDALDriverH | hDriver, |
const char * | pszNewName, | ||
const char * | pszOldName | ||
) |
Rename a dataset.
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.
nNewSizeInBytes | the 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.
nNewSizeInBytes | the maximum number of bytes for caching. |
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.
CPLErr GDALSetDefaultRAT | ( | GDALRasterBandH | hBand, |
GDALRasterAttributeTableH | hRAT | ||
) |
Set default Raster Attribute Table.
void GDALSetDescription | ( | GDALMajorObjectH | hObject, |
const char * | pszNewDesc | ||
) |
Set object description.
CPLErr GDALSetGCPs | ( | GDALDatasetH | hDS, |
int | nGCPCount, | ||
const GDAL_GCP * | pasGCPList, | ||
const char * | pszGCPProjection | ||
) |
Assign GCPs.
CPLErr GDALSetMetadata | ( | GDALMajorObjectH | hObject, |
char ** | papszMD, | ||
const char * | pszDomain | ||
) |
Set metadata.
CPLErr GDALSetMetadataItem | ( | GDALMajorObjectH | hObject, |
const char * | pszName, | ||
const char * | pszValue, | ||
const char * | pszDomain | ||
) |
Set single metadata item.
CPLErr GDALSetProjection | ( | GDALDatasetH | hDS, |
const char * | pszProjection | ||
) |
Set the projection reference string for this dataset.
CPLErr GDALSetRasterCategoryNames | ( | GDALRasterBandH | hBand, |
char ** | papszNames | ||
) |
Set the category names for this band.
CPLErr GDALSetRasterColorInterpretation | ( | GDALRasterBandH | hBand, |
GDALColorInterp | eColorInterp | ||
) |
Set color interpretation of a band.
CPLErr GDALSetRasterColorTable | ( | GDALRasterBandH | hBand, |
GDALColorTableH | hCT | ||
) |
Set the raster color table.
CPLErr GDALSetRasterNoDataValue | ( | GDALRasterBandH | hBand, |
double | dfValue | ||
) |
Set the no data value for this band.
CPLErr GDALSetRasterOffset | ( | GDALRasterBandH | hBand, |
double | dfNewOffset | ||
) |
Set scaling offset.
CPLErr GDALSetRasterScale | ( | GDALRasterBandH | hBand, |
double | dfNewOffset | ||
) |
Set scaling ratio.
CPLErr GDALSetRasterStatistics | ( | GDALRasterBandH | hBand, |
double | dfMin, | ||
double | dfMax, | ||
double | dfMean, | ||
double | dfStdDev | ||
) |
Set statistics on band.
CPLErr GDALSetRasterUnitType | ( | GDALRasterBandH | hBand, |
const char * | pszNewValue | ||
) |
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.
pData | pointer to start of data buffer. |
nWordSize | size of words being swapped in bytes. Normally 2, 4 or 8. |
nWordCount | the number of words to be swapped in this call. |
nWordSkip | the 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.
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.
hDriver | the handle of the driver with whom the lists of creation option must be validated |
papszCreationOptions | the list of creation options. An array of strings, whose last element is a NULL pointer |
const char* GDALVersionInfo | ( | const char * | pszRequest | ) |
Get runtime version information.
Available pszRequest values:
pszRequest | the type of version info desired, as listed above. |
CPLErr GDALWriteBlock | ( | GDALRasterBandH | hBand, |
int | nXOff, | ||
int | nYOff, | ||
void * | pData | ||
) |
Write a block of image data efficiently.
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.
pszBaseFilename | the target raster file. |
pszExtension | the extension to use (ie. ".wld"). Must not be NULL |
padfGeoTransform | the six double array from which the geotransformation should be read. |