GDAL.ArrowArray
— TypeData type for a Arrow C array. Include ogr\_recordbatch.h to get the definition
GDAL.ArrowArrayStream
— TypeData type for a Arrow C stream. Include ogr\_recordbatch.h to get the definition
GDAL.ArrowSchema
— TypeData type for a Arrow C schema. Include ogr\_recordbatch.h to get the definition
GDAL.CPLErr
— TypeCPLErr
Error category
GDAL.CPLErrorHandler
— TypeCallback for a custom error handler
GDAL.CPLErrorNum
— TypeError number
GDAL.CPLFileFinder
— TypeCallback for CPLPushFileFinder
GDAL.CPLSetConfigOptionSubscriber
— TypeCallback for CPLSubscribeToSetConfigOption
()
GDAL.CPLSharedFileInfo
— TypeCPLSharedFileInfo
Information on a shared file
Field | Note |
---|---|
fp | File pointer |
nRefCount | Reference counter |
bLarge | Whether fp must be interpreted as VSIFILE* |
pszFilename | Filename |
pszAccess | Access mode |
GDAL.CPLVirtualMemAccessMode
— TypeCPLVirtualMemAccessMode
Access mode of a virtual memory mapping.
Enumerator | Note |
---|---|
VIRTUALMEM_READONLY | The mapping is meant at being read-only, but writes will not be prevented. Note that any content written will be lost. |
VIRTUALMEM_READONLY_ENFORCED | The mapping is meant at being read-only, and this will be enforced through the operating system page protection mechanism. |
VIRTUALMEM_READWRITE | The mapping is meant at being read-write, and modified pages can be saved thanks to the pfnUnCachePage callback |
GDAL.CPLVirtualMemCachePageCbk
— TypeCallback triggered when a still unmapped page of virtual memory is accessed. The callback has the responsibility of filling the page with relevant values
Arguments
ctxt
: virtual memory handle.nOffset
: offset of the page in the memory mapping.pPageToFill
: address of the page to fill. Note that the address might be a temporary location, and not atCPLVirtualMemGetAddr
() + nOffset.nToFill
: number of bytes of the page.pUserData
: user data that was passed toCPLVirtualMemNew
().
GDAL.CPLVirtualMemFreeUserData
— TypeCallback triggered when a virtual memory mapping is destroyed.
Arguments
pUserData
: user data that was passed toCPLVirtualMemNew
().
GDAL.CPLVirtualMemUnCachePageCbk
— TypeCallback triggered when a dirty mapped page is going to be freed. (saturation of cache, or termination of the virtual memory mapping).
Arguments
ctxt
: virtual memory handle.nOffset
: offset of the page in the memory mapping.pPageToBeEvicted
: address of the page that will be flushed. Note that the address might be a temporary location, and not atCPLVirtualMemGetAddr
() + nOffset.nToBeEvicted
: number of bytes of the page.pUserData
: user data that was passed toCPLVirtualMemNew
().
GDAL.CPLXMLNode
— TypeCPLXMLNode
Document node structure.
This C structure is used to hold a single text fragment representing a component of the document when parsed. It should be allocated with the appropriate CPL function, and freed with CPLDestroyXMLNode
(). The structure contents should not normally be altered by application code, but may be freely examined by application code.
Using the psChild and psNext pointers, a hierarchical tree structure for a document can be represented as a tree of CPLXMLNode
structures.
Field | Note |
---|---|
eType | Node type One of CXT_Element, CXT_Text, CXT_Attribute, CXT_Comment, or CXT_Literal. |
pszValue | Node value For CXT_Element this is the name of the element, without the angle brackets. Note there is a single CXT_Element even when the document contains a start and end element tag. The node represents the pair. All text or other elements between the start and end tag will appear as children nodes of this CXT_Element node. For CXT_Attribute the pszValue is the attribute name. The value of the attribute will be a CXT_Text child. For CXT_Text this is the text itself (value of an attribute, or a text fragment between an element start and end tags. For CXT_Literal it is all the literal text. Currently this is just used for !DOCTYPE lines, and the value would be the entire line. For CXT_Comment the value is all the literal text within the comment, but not including the comment start/end indicators ("<–" and "–>"). |
psNext | Next sibling. Pointer to next sibling, that is the next node appearing after this one that has the same parent as this node. NULL if this node is the last child of the parent element. |
psChild | Child node. Pointer to first child node, if any. Only CXT_Element and CXT_Attribute nodes should have children. For CXT_Attribute it should be a single CXT_Text value node, while CXT_Element can have any kind of child. The full list of children for a node are identified by walking the psNext's starting with the psChild node. |
GDAL.CPLXMLNodeType
— TypeCPLXMLNodeType
XML node type
Enumerator | Note |
---|---|
CXT_Element | Node is an element |
CXT_Text | Node is a raw text value |
CXT_Attribute | Node is attribute |
CXT_Comment | Node is an XML comment. |
CXT_Literal | Node is a special literal |
GDAL.CSLConstList
— TypeType of a constant null-terminated list of nul terminated strings. Seen as char** from C and const char* const* from C++
GDAL.GBool
— TypeType for boolean values (alias to int)
GDAL.GByte
— TypeUnsigned byte type
GDAL.GDALAccess
— TypeGDALAccess
Flag indicating read/write, or read-only access to data.
Enumerator | Note |
---|---|
GA_ReadOnly | Read only (no update) access |
GA_Update | Read/write access. |
GDAL.GDALAsyncReaderH
— TypeOpaque type used for the C bindings of the C++ GDALAsyncReader class
GDAL.GDALAsyncStatusType
— TypeGDALAsyncStatusType
status of the asynchronous stream
GDAL.GDALAttributeH
— TypeOpaque type for C++ GDALAttribute
GDAL.GDALColorEntry
— TypeGDALColorEntry
Color tuple
Field | Note |
---|---|
c1 | gray, red, cyan or hue |
c2 | green, magenta, or lightness |
c3 | blue, yellow, or saturation |
c4 | alpha or blackband |
GDAL.GDALColorInterp
— TypeGDALColorInterp
Types of color interpretation for raster bands.
Enumerator | Note |
---|---|
GCI_Undefined | Undefined |
GCI_GrayIndex | Greyscale |
GCI_PaletteIndex | Paletted (see associated color table) |
GCI_RedBand | Red band of RGBA image |
GCI_GreenBand | Green band of RGBA image |
GCI_BlueBand | Blue band of RGBA image |
GCI_AlphaBand | Alpha (0=transparent, 255=opaque) |
GCI_HueBand | Hue band of HLS image |
GCI_SaturationBand | Saturation band of HLS image |
GCI_LightnessBand | Lightness band of HLS image |
GCI_CyanBand | Cyan band of CMYK image |
GCI_MagentaBand | Magenta band of CMYK image |
GCI_YellowBand | Yellow band of CMYK image |
GCI_BlackBand | Black band of CMYK image |
GCI_YCbCr_YBand | Y Luminance |
GCI_YCbCr_CbBand | Cb Chroma |
GCI_YCbCr_CrBand | Cr Chroma |
GCI_Max | Max current value (equals to GCI_YCbCr_CrBand currently) |
GDAL.GDALColorTableH
— TypeOpaque type used for the C bindings of the C++ GDALColorTable class
GDAL.GDALContourGeneratorH
— TypeContour generator opaque type
GDAL.GDALContourWriter
— TypeContour writer callback type
GDAL.GDALDataType
— TypeGDALDataType
Pixel data types
Enumerator | Note |
---|---|
GDT_Unknown | Unknown or unspecified type |
GDT_Byte | Eight bit unsigned integer |
GDT_Int8 | 8-bit signed integer (GDAL >= 3.7) |
GDT_UInt16 | Sixteen bit unsigned integer |
GDT_Int16 | Sixteen bit signed integer |
GDT_UInt32 | Thirty two bit unsigned integer |
GDT_Int32 | Thirty two bit signed integer |
GDT_UInt64 | 64 bit unsigned integer (GDAL >= 3.5) |
GDT_Int64 | 64 bit signed integer (GDAL >= 3.5) |
GDT_Float32 | Thirty two bit floating point |
GDT_Float64 | Sixty four bit floating point |
GDT_CInt16 | Complex Int16 |
GDT_CInt32 | Complex Int32 |
GDT_CFloat32 | Complex Float32 |
GDT_CFloat64 | Complex Float64 |
GDT_TypeCount |
GDAL.GDALDatasetH
— TypeOpaque type used for the C bindings of the C++ GDALDataset class
GDAL.GDALDerivedPixelFunc
— TypeType of functions to pass to GDALAddDerivedBandPixelFunc
.
\since GDAL 2.2
GDAL.GDALDerivedPixelFuncWithArgs
— TypeType of functions to pass to GDALAddDerivedBandPixelFuncWithArgs
.
\since GDAL 3.4
GDAL.GDALDimensionH
— TypeOpaque type for C++ GDALDimension
GDAL.GDALDriverH
— TypeOpaque type used for the C bindings of the C++ GDALDriver class
GDAL.GDALEDTComponentH
— TypeOpaque type for C++ GDALEDTComponent
GDAL.GDALExtendedDataTypeClass
— TypeGDALExtendedDataTypeClass
Enumeration giving the class of a GDALExtendedDataType.
\since GDAL 3.1
Enumerator | Note |
---|---|
GEDTC_NUMERIC | Numeric value. Based on GDALDataType enumeration |
GEDTC_STRING | String value. |
GEDTC_COMPOUND | Compound data type. |
GDAL.GDALExtendedDataTypeH
— TypeOpaque type for C++ GDALExtendedDataType
GDAL.GDALExtendedDataTypeSubType
— TypeGDALExtendedDataTypeSubType
Enumeration giving the subtype of a GDALExtendedDataType.
\since GDAL 3.4
Enumerator | Note |
---|---|
GEDTST_NONE | None. |
GEDTST_JSON | JSon. Only applies to GEDTC_STRING |
GDAL.GDALGridAlgorithm
— TypeGDALGridAlgorithm
Gridding Algorithms
Enumerator | Note |
---|---|
GGA_InverseDistanceToAPower | Inverse distance to a power |
GGA_MovingAverage | Moving Average |
GGA_NearestNeighbor | Nearest Neighbor |
GGA_MetricMinimum | Minimum Value (Data Metric) |
GGA_MetricMaximum | Maximum Value (Data Metric) |
GGA_MetricRange | Data Range (Data Metric) |
GGA_MetricCount | Number of Points (Data Metric) |
GGA_MetricAverageDistance | Average Distance (Data Metric) |
GGA_MetricAverageDistancePts | Average Distance Between Data Points (Data Metric) |
GGA_Linear | Linear interpolation (from Delaunay triangulation. Since GDAL 2.1 |
GGA_InverseDistanceToAPowerNearestNeighbor | Inverse distance to a power with nearest neighbor search for max points |
GDAL.GDALGridDataMetricsOptions
— TypeGDALGridDataMetricsOptions
Data metrics method control options
Field | Note |
---|---|
nSizeOfStructure | Added in GDAL 3.6 to detect potential ABI issues. Should be set to sizeof(GDALGridDataMetricsOptions ) |
dfRadius1 | The first radius (X axis if rotation angle is 0) of search ellipse. |
dfRadius2 | The second radius (Y axis if rotation angle is 0) of search ellipse. |
dfAngle | Angle of ellipse rotation in degrees. Ellipse rotated counter clockwise. |
nMinPoints | Minimum number of data points to average. If less amount of points found the grid node considered empty and will be filled with NODATA marker. |
dfNoDataValue | No data marker to fill empty points. |
nMaxPointsPerQuadrant | Maximum number of data points to use for each of the 4 quadrants. Do not search for more points than this number. |
nMinPointsPerQuadrant | Minimum number of data points to use for each of the 4 quadrants. If less amount of points found the grid node considered empty and will be filled with NODATA marker. |
GDAL.GDALGridInverseDistanceToAPowerNearestNeighborOptions
— TypeGDALGridInverseDistanceToAPowerNearestNeighborOptions
Inverse distance to a power, with nearest neighbour search, control options
Field | Note |
---|---|
nSizeOfStructure | Added in GDAL 3.6 to detect potential ABI issues. Should be set to sizeof(GDALGridInverseDistanceToAPowerNearestNeighborOptions ) |
dfPower | Weighting power. |
dfRadius | The radius of search circle. |
dfSmoothing | Smoothing parameter. |
nMaxPoints | Maximum number of data points to use. Do not search for more points than this number. |
nMinPoints | Minimum number of data points to use. If less amount of points found the grid node considered empty and will be filled with NODATA marker. |
dfNoDataValue | No data marker to fill empty points. |
nMaxPointsPerQuadrant | Maximum number of data points to use for each of the 4 quadrants. Do not search for more points than this number. |
nMinPointsPerQuadrant | Minimum number of data points to use for each of the 4 quadrants. If less amount of points found the grid node considered empty and will be filled with NODATA marker. |
GDAL.GDALGridInverseDistanceToAPowerOptions
— TypeGDALGridInverseDistanceToAPowerOptions
Inverse distance to a power method control options
Field | Note |
---|---|
nSizeOfStructure | Added in GDAL 3.6 to detect potential ABI issues. Should be set to sizeof(GDALGridInverseDistanceToAPowerOptions ) |
dfPower | Weighting power. |
dfSmoothing | Smoothing parameter. |
dfAnisotropyRatio | Reserved for future use. |
dfAnisotropyAngle | |
dfRadius1 | The first radius (X axis if rotation angle is 0) of search ellipse. |
dfRadius2 | The second radius (Y axis if rotation angle is 0) of search ellipse. |
dfAngle | Angle of ellipse rotation in degrees. Ellipse rotated counter clockwise. |
nMaxPoints | Maximum number of data points to use. Do not search for more points than this number. |
nMinPoints | Minimum number of data points to use. If less amount of points found the grid node considered empty and will be filled with NODATA marker. |
dfNoDataValue | No data marker to fill empty points. |
GDAL.GDALGridLinearOptions
— TypeGDALGridLinearOptions
Linear method control options
Field | Note |
---|---|
nSizeOfStructure | Added in GDAL 3.6 to detect potential ABI issues. Should be set to sizeof(GDALGridLinearOptions ) |
dfRadius | In case the point to be interpolated does not fit into a triangle of the Delaunay triangulation, use that maximum distance to search a nearest neighbour, or use nodata otherwise. If set to -1, the search distance is infinite. If set to 0, nodata value will be always used. |
dfNoDataValue | No data marker to fill empty points. |
GDAL.GDALGridMovingAverageOptions
— TypeGDALGridMovingAverageOptions
Moving average method control options
Field | Note |
---|---|
nSizeOfStructure | Added in GDAL 3.6 to detect potential ABI issues. Should be set to sizeof(GDALGridMovingAverageOptions ) |
dfRadius1 | The first radius (X axis if rotation angle is 0) of search ellipse. |
dfRadius2 | The second radius (Y axis if rotation angle is 0) of search ellipse. |
dfAngle | Angle of ellipse rotation in degrees. Ellipse rotated counter clockwise. |
nMaxPoints | Maximum number of data points to use. Do not search for more points than this number. |
nMinPoints | Minimum number of data points to average. If less amount of points found the grid node considered empty and will be filled with NODATA marker. |
dfNoDataValue | No data marker to fill empty points. |
nMaxPointsPerQuadrant | Maximum number of data points to use for each of the 4 quadrants. Do not search for more points than this number. |
nMinPointsPerQuadrant | Minimum number of data points to use for each of the 4 quadrants. If less amount of points found the grid node considered empty and will be filled with NODATA marker. |
GDAL.GDALGridNearestNeighborOptions
— TypeGDALGridNearestNeighborOptions
Nearest neighbor method control options
Field | Note |
---|---|
nSizeOfStructure | Added in GDAL 3.6 to detect potential ABI issues. Should be set to sizeof(GDALGridNearestNeighborOptions ) |
dfRadius1 | The first radius (X axis if rotation angle is 0) of search ellipse. |
dfRadius2 | The second radius (Y axis if rotation angle is 0) of search ellipse. |
dfAngle | Angle of ellipse rotation in degrees. Ellipse rotated counter clockwise. |
dfNoDataValue | No data marker to fill empty points. |
GDAL.GDALGroupH
— TypeOpaque type for C++ GDALGroup
GDAL.GDALMDArrayH
— TypeOpaque type for C++ GDALMDArray
GDAL.GDALMajorObjectH
— TypeOpaque type used for the C bindings of the C++ GDALMajorObject class
GDAL.GDALMaskFunc
— TypeDoxygen_Suppress
GDAL.GDALPaletteInterp
— TypeGDALPaletteInterp
Types of color interpretations for a GDALColorTable.
Enumerator | Note |
---|---|
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) |
GDAL.GDALQueryLoggerFunc
— TypeType of functions to pass to GDALDatasetSetQueryLoggerFunc
\since GDAL 3.7
GDAL.GDALRATFieldType
— TypeGDALRATFieldType
Field type of raster attribute table
Enumerator | Note |
---|---|
GFT_Integer | Integer field |
GFT_Real | Floating point (double) field |
GFT_String | String field |
GDAL.GDALRATFieldUsage
— TypeGDALRATFieldUsage
Field usage of raster attribute table
Enumerator | Note |
---|---|
GFU_Generic | General purpose field. |
GFU_PixelCount | Histogram pixel count |
GFU_Name | Class name |
GFU_Min | Class range minimum |
GFU_Max | Class range maximum |
GFU_MinMax | Class value (min=max) |
GFU_Red | Red class color (0-255) |
GFU_Green | Green class color (0-255) |
GFU_Blue | Blue class color (0-255) |
GFU_Alpha | Alpha (0=transparent,255=opaque) |
GFU_RedMin | Color Range Red Minimum |
GFU_GreenMin | Color Range Green Minimum |
GFU_BlueMin | Color Range Blue Minimum |
GFU_AlphaMin | Color Range Alpha Minimum |
GFU_RedMax | Color Range Red Maximum |
GFU_GreenMax | Color Range Green Maximum |
GFU_BlueMax | Color Range Blue Maximum |
GFU_AlphaMax | Color Range Alpha Maximum |
GFU_MaxCount | Maximum GFU value (equals to GFU_AlphaMax+1 currently) |
GDAL.GDALRATTableType
— TypeGDALRATTableType
RAT table type (thematic or athematic)
\since GDAL 2.4
Enumerator | Note |
---|---|
GRTT_THEMATIC | Thematic table type |
GRTT_ATHEMATIC | Athematic table type |
GDAL.GDALRIOResampleAlg
— TypeGDALRIOResampleAlg
RasterIO() resampling method.
\since GDAL 2.0
Enumerator | Note |
---|---|
GRIORA_NearestNeighbour | Nearest neighbour |
GRIORA_Bilinear | Bilinear (2x2 kernel) |
GRIORA_Cubic | Cubic Convolution Approximation (4x4 kernel) |
GRIORA_CubicSpline | Cubic B-Spline Approximation (4x4 kernel) |
GRIORA_Lanczos | Lanczos windowed sinc interpolation (6x6 kernel) |
GRIORA_Average | Average |
GRIORA_Mode | Mode (selects the value which appears most often of all the sampled points) |
GRIORA_Gauss | Gauss blurring |
GRIORA_RESERVED_START | Doxygen_Suppress |
GRIORA_RESERVED_END | |
GRIORA_RMS | RMS: Root Mean Square / Quadratic Mean. For complex numbers, applies on the real and imaginary part independently. |
GRIORA_LAST | Doxygen_Suppress |
GDAL.GDALRPCInfoV1
— TypeGDALRPCInfoV1
Field | Note |
---|---|
dfLINE_OFF | Line offset |
dfSAMP_OFF | Sample/Pixel offset |
dfLAT_OFF | Latitude offset |
dfLONG_OFF | Longitude offset |
dfHEIGHT_OFF | Height offset |
dfLINE_SCALE | Line scale |
dfSAMP_SCALE | Sample/Pixel scale |
dfLAT_SCALE | Latitude scale |
dfLONG_SCALE | Longitude scale |
dfHEIGHT_SCALE | Height scale |
adfLINE_NUM_COEFF | Line Numerator Coefficients |
adfLINE_DEN_COEFF | Line Denominator Coefficients |
adfSAMP_NUM_COEFF | Sample/Pixel Numerator Coefficients |
adfSAMP_DEN_COEFF | Sample/Pixel Denominator Coefficients |
dfMIN_LONG | Minimum longitude |
dfMIN_LAT | Minimum latitude |
dfMAX_LONG | Maximum longitude |
dfMAX_LAT | Maximum latitude |
GDAL.GDALRPCInfoV2
— TypeGDALRPCInfoV2
Structure to store Rational Polynomial Coefficients / Rigorous Projection Model. See http://geotiff.maptools.org/rpc_prop.html
Field | Note |
---|---|
dfLINE_OFF | Line offset |
dfSAMP_OFF | Sample/Pixel offset |
dfLAT_OFF | Latitude offset |
dfLONG_OFF | Longitude offset |
dfHEIGHT_OFF | Height offset |
dfLINE_SCALE | Line scale |
dfSAMP_SCALE | Sample/Pixel scale |
dfLAT_SCALE | Latitude scale |
dfLONG_SCALE | Longitude scale |
dfHEIGHT_SCALE | Height scale |
adfLINE_NUM_COEFF | Line Numerator Coefficients |
adfLINE_DEN_COEFF | Line Denominator Coefficients |
adfSAMP_NUM_COEFF | Sample/Pixel Numerator Coefficients |
adfSAMP_DEN_COEFF | Sample/Pixel Denominator Coefficients |
dfMIN_LONG | Minimum longitude |
dfMIN_LAT | Minimum latitude |
dfMAX_LONG | Maximum longitude |
dfMAX_LAT | Maximum latitude |
dfERR_BIAS | Bias error |
dfERR_RAND | Random error |
GDAL.GDALRWFlag
— TypeGDALRWFlag
Read/Write flag for RasterIO() method
Enumerator | Note |
---|---|
GF_Read | Read data |
GF_Write | Write data |
GDAL.GDALRasterAttributeTableH
— TypeOpaque type used for the C bindings of the C++ GDALRasterAttributeTable class
GDAL.GDALRasterBandH
— TypeOpaque type used for the C bindings of the C++ GDALRasterBand class
GDAL.GDALRasterIOExtraArg
— TypeGDALRasterIOExtraArg
Structure to pass extra arguments to RasterIO() method, must be initialized with INIT_RASTERIO_EXTRA_ARG
\since GDAL 2.0
Field | Note |
---|---|
nVersion | Version of structure (to allow future extensions of the structure) |
eResampleAlg | Resampling algorithm |
pfnProgress | Progress callback |
pProgressData | Progress callback user data |
bFloatingPointWindowValidity | Indicate if dfXOff, dfYOff, dfXSize and dfYSize are set. Mostly reserved from the VRT driver to communicate a more precise source window. Must be such that dfXOff - nXOff < 1.0 and dfYOff - nYOff < 1.0 and nXSize - dfXSize < 1.0 and nYSize - dfYSize < 1.0 |
dfXOff | Pixel offset to the top left corner. Only valid if bFloatingPointWindowValidity = TRUE |
dfYOff | Line offset to the top left corner. Only valid if bFloatingPointWindowValidity = TRUE |
dfXSize | Width in pixels of the area of interest. Only valid if bFloatingPointWindowValidity = TRUE |
dfYSize | Height in pixels of the area of interest. Only valid if bFloatingPointWindowValidity = TRUE |
GDAL.GDALRelationshipCardinality
— TypeGDALRelationshipCardinality
Cardinality of relationship.
\since GDAL 3.6
Enumerator | Note |
---|---|
GRC_ONE_TO_ONE | One-to-one |
GRC_ONE_TO_MANY | One-to-many |
GRC_MANY_TO_ONE | Many-to-one |
GRC_MANY_TO_MANY | Many-to-many |
GDAL.GDALRelationshipH
— TypeOpaque type used for the C bindings of the C++ GDALRelationship class
\since GDAL 3.6
GDAL.GDALRelationshipType
— TypeGDALRelationshipType
Type of relationship.
\since GDAL 3.6
Enumerator | Note |
---|---|
GRT_COMPOSITE | Composite relationship |
GRT_ASSOCIATION | Association relationship |
GRT_AGGREGATION | Aggregation relationship |
GDAL.GDALResampleAlg
— TypeGDALResampleAlg
Warp Resampling Algorithm
Enumerator | Note |
---|---|
GRA_NearestNeighbour | Nearest neighbour (select on one input pixel) |
GRA_Bilinear | Bilinear (2x2 kernel) |
GRA_Cubic | Cubic Convolution Approximation (4x4 kernel) |
GRA_CubicSpline | Cubic B-Spline Approximation (4x4 kernel) |
GRA_Lanczos | Lanczos windowed sinc interpolation (6x6 kernel) |
GRA_Average | Average (computes the weighted average of all non-NODATA contributing pixels) |
GRA_Mode | Mode (selects the value which appears most often of all the sampled points) |
GRA_Max | Max (selects maximum of all non-NODATA contributing pixels) |
GRA_Min | Min (selects minimum of all non-NODATA contributing pixels) |
GRA_Med | Med (selects median of all non-NODATA contributing pixels) |
GRA_Q1 | Q1 (selects first quartile of all non-NODATA contributing pixels) |
GRA_Q3 | Q3 (selects third quartile of all non-NODATA contributing pixels) |
GRA_Sum | Sum (weighed sum of all non-NODATA contributing pixels). Added in GDAL 3.1 |
GRA_RMS | RMS (weighted root mean square (quadratic mean) of all non-NODATA contributing pixels) |
GRA_LAST_VALUE | Doxygen_Suppress |
GDAL.GDALSubdatasetInfoH
— TypeOpaque type used for the C bindings of the C++ GDALSubdatasetInfo
class
\since GDAL 3.8
GDAL.GDALTileOrganization
— TypeGDALTileOrganization
! Enumeration to describe the tile organization
Enumerator | Note |
---|---|
GTO_TIP | Tile Interleaved by Pixel: tile (0,0) with internal band interleaved by pixel organization, tile (1, 0), ... |
GTO_BIT | Band Interleaved by Tile : tile (0,0) of first band, tile (0,0) of second band, ... tile (1,0) of first band, tile (1,0) of second band, ... |
GTO_BSQ | Band SeQuential : all the tiles of first band, all the tiles of following band... |
GDAL.GDALTriBarycentricCoefficients
— TypeGDALTriBarycentricCoefficients
Triangle barycentric coefficients.
Conversion from cartesian (x,y) to barycentric (l1,l2,l3) with : l1 = dfMul1X * (x - dfCxtX) + dfMul1Y * (y - dfCstY) l2 = dfMul2X * (x - dfCxtX) + dfMul2Y * (y - dfCstY) l3 = 1 - l1 - l2
Field | Note |
---|---|
dfMul1X | dfMul1X |
dfMul1Y | dfMul1Y |
dfMul2X | dfMul2X |
dfMul2Y | dfMul2Y |
dfCstX | dfCstX |
dfCstY | dfCstY |
GDAL.GDALTriFacet
— TypeGDALTriFacet
Triangle fact
Field | Note |
---|---|
anVertexIdx | index to the padfX/padfY arrays |
anNeighborIdx | index to GDALDelaunayTriangulation.pasFacets, or -1 |
GDAL.GDALTriangulation
— TypeGDALTriangulation
Triangulation structure
Field | Note |
---|---|
nFacets | number of facets |
pasFacets | array of nFacets facets |
pasFacetCoefficients | arra of nFacets barycentric coefficients |
GDAL.GDALVRTProcessedDatasetFuncFree
— TypeFree function to pass to GDALVRTRegisterProcessedDatasetFunc
.
\since GDAL 3.9
Arguments
pszFuncName
: Function name. Must be unique and not null.pUserData
: User data. May be nullptr. Must remain valid during the lifetime of GDAL.pWorkingData
: Value of the *ppWorkingData output parameter ofGDALVRTProcessedDatasetFuncInit
.
GDAL.GDALVRTProcessedDatasetFuncInit
— TypeInitialization function to pass to GDALVRTRegisterProcessedDatasetFunc
.
This initialization function is called for each step of a VRTProcessedDataset that uses the related algorithm. The initialization function returns the output data type, output band count and potentially initializes a working structure, typically parsing arguments.
\since GDAL 3.9
Arguments
pszFuncName
: Function name. Must be unique and not null.pUserData
: User data. May be nullptr. Must remain valid during the lifetime of GDAL.papszFunctionArgs
: Function arguments as a list of key=value pairs.nInBands
: Number of input bands.eInDT
: Input data type.padfInNoData
:[in,out] Array of nInBands values for the input nodata value. The init function may also override them.pnOutBands
:[in,out] Pointer whose value must be set to the number of output bands. This will be set to 0 by the caller when calling the function, unless this is the final step, in which case it will be initialized with the number of expected output bands.peOutDT
:[out] Pointer whose value must be set to the output data type.ppadfOutNoData
:[in,out] Pointer to an array of *pnOutBands values for the output nodata value that the function must set. For non-final steps, *ppadfOutNoData will be nullptr and it is the responsibility of the function toCPLMalloc
()'ate it. If this is the final step, it will be already allocated and initialized with the expected nodata values from the output dataset (if the init function need to reallocate it, it must useCPLRealloc
())pszVRTPath
: Directory of the VRTppWorkingData
:[out] Pointer whose value must be set to a working structure, or nullptr.
Returns
CE_None in case of success, error otherwise.
GDAL.GDALVRTProcessedDatasetFuncProcess
— TypeProcessing function to pass to GDALVRTRegisterProcessedDatasetFunc
.
\since GDAL 3.9
Arguments
pszFuncName
: Function name. Must be unique and not null.pUserData
: User data. May be nullptr. Must remain valid during the lifetime of GDAL.pWorkingData
: Value of the *ppWorkingData output parameter ofGDALVRTProcessedDatasetFuncInit
.papszFunctionArgs
: Function arguments as a list of key=value pairs.nBufXSize
: Width in pixels of pInBuffer and pOutBuffernBufYSize
: Height in pixels of pInBuffer and pOutBufferpInBuffer
: Input buffer. It is pixel-interleaved (i.e. R00,G00,B00,R01,G01,B01, etc.)nInBufferSize
: Size in bytes of pInBuffereInDT
: Data type of pInBuffernInBands
: Number of bands in pInBuffer.padfInNoData
: Input nodata values.pOutBuffer
: Output buffer. It is pixel-interleaved (i.e. R00,G00,B00,R01,G01,B01, etc.)nOutBufferSize
: Size in bytes of pOutBuffereOutDT
: Data type of pOutBuffernOutBands
: Number of bands in pOutBuffer.padfOutNoData
: Input nodata values.dfSrcXOff
: Source X coordinate in pixel of the top-left of the regiondfSrcYOff
: Source Y coordinate in pixel of the top-left of the regiondfSrcXSize
: Width in pixels of the regiondfSrcYSize
: Height in pixels of the regionadfSrcGT
: Source geotransformpszVRTPath
: Directory of the VRTpapszExtra
: Extra arguments (unused for now)
GDAL.GDALViewshedMode
— TypeGDALViewshedMode
Viewshed Modes
GDAL.GDALViewshedOutputType
— TypeGDALViewshedOutputType
Viewshed output types
GDAL.GDALWarpOperationH
— TypeOpaque type representing a GDALWarpOperation object
GDAL.GDALWarpOptions
— TypeGDALWarpOptions
Warp control options for use with GDALWarpOperation::Initialize()
Field | Note |
---|---|
dfWarpMemoryLimit | In bytes, 0.0 for internal default |
eResampleAlg | Resampling algorithm to use |
eWorkingDataType | data type to use during warp operation, GDT_Unknown lets the algorithm select the type |
hSrcDS | Source image dataset. |
hDstDS | Destination image dataset - may be NULL if only using GDALWarpOperation::WarpRegionToBuffer(). |
nBandCount | Number of bands to process, may be 0 to select all bands. |
panSrcBands | The band numbers for the source bands to process (1 based) |
panDstBands | The band numbers for the destination bands to process (1 based) |
nSrcAlphaBand | The source band so use as an alpha (transparency) value, 0=disabled |
nDstAlphaBand | The dest. band so use as an alpha (transparency) value, 0=disabled |
padfSrcNoDataReal | The "nodata" value real component for each input band, if NULL there isn't one |
padfSrcNoDataImag | The "nodata" value imaginary component - may be NULL even if real component is provided. This value is not used to flag invalid values. Only the real component is used. |
padfDstNoDataReal | The "nodata" value real component for each output band, if NULL there isn't one |
padfDstNoDataImag | The "nodata" value imaginary component - may be NULL even if real component is provided. Note that warp operations only use real component for flagging invalid data. |
pfnProgress | GDALProgressFunc () compatible progress reporting function, or NULL if there isn't one. |
pProgressArg | Callback argument to be passed to pfnProgress. |
pfnTransformer | Type of spatial point transformer function |
pTransformerArg | Handle to image transformer setup structure |
papfnSrcPerBandValidityMaskFunc | Unused. Must be NULL |
papSrcPerBandValidityMaskFuncArg | |
pfnSrcValidityMaskFunc | |
pSrcValidityMaskFuncArg | |
pfnSrcDensityMaskFunc | |
pSrcDensityMaskFuncArg | |
pfnDstDensityMaskFunc | |
pDstDensityMaskFuncArg | |
pfnDstValidityMaskFunc | |
pDstValidityMaskFuncArg | |
pfnPreWarpChunkProcessor | |
pPreWarpProcessorArg | |
pfnPostWarpChunkProcessor | |
pPostWarpProcessorArg | |
hCutline | Optional OGRPolygonH for a masking cutline. |
dfCutlineBlendDist | Optional blending distance to apply across cutline in pixels, default is zero. |
GDAL.GDAL_GCP
— TypeGDAL_GCP
Ground Control Point
Field | Note |
---|---|
pszId | Unique identifier, often numeric |
pszInfo | Informational message or "" |
dfGCPPixel | Pixel (x) location of GCP on raster |
dfGCPLine | Line (y) location of GCP on raster |
dfGCPX | X position of GCP in georeferenced space |
dfGCPY | Y position of GCP in georeferenced space |
dfGCPZ | Elevation of GCP, or zero if not known |
GDAL.GInt16
— TypeInt16 type
GDAL.GInt32
— TypeInt32 type
GDAL.GInt64
— TypeSigned 64 bit integer type
GDAL.GInt8
— TypeSigned int8 type
GDAL.GIntBig
— TypeLarge signed integer type (generally 64-bit integer type). Use GInt64
when exactly 64 bit is needed
GDAL.GPtrDiff_t
— TypeInteger type large enough to hold the difference between 2 addresses
GDAL.GSpacing
— TypeType to express pixel, line or band spacing. Signed 64 bit integer
GDAL.GUInt16
— TypeUnsigned int16 type
GDAL.GUInt32
— TypeUnsigned int32 type
GDAL.GUInt64
— TypeUnsigned 64 bit integer type
GDAL.GUIntBig
— TypeLarge unsigned integer type (generally 64-bit unsigned integer type). Use GUInt64
when exactly 64 bit is needed
GDAL.GWKAverageOrModeAlg
— TypeGWKAverageOrModeAlg
GWKAverageOrMode Algorithm
Enumerator | Note |
---|---|
GWKAOM_Average | Average |
GWKAOM_Fmode | Mode |
GWKAOM_Imode | Mode of GDT_Byte, GDT_UInt16, or GDT_Int16 |
GWKAOM_Max | Maximum |
GWKAOM_Min | Minimum |
GWKAOM_Quant | Quantile |
GWKAOM_Sum | Sum |
GWKAOM_RMS | RMS |
GDAL.OGRAxisOrientation
— TypeOGRAxisOrientation
Axis orientations (corresponds to CS_AxisOrientationEnum).
Enumerator | Note |
---|---|
OAO_Other | Other |
OAO_North | North |
OAO_South | South |
OAO_East | East |
OAO_West | West |
OAO_Up | Up (to space) |
OAO_Down | Down (to Earth center) |
GDAL.OGRBoolean
— TypeType for a OGR boolean
GDAL.OGRCodedValue
— TypeOGRCodedValue
Associates a code and a value
\since GDAL 3.3
Field | Note |
---|---|
pszCode | Code. Content should be of the type of the OGRFieldDomain |
pszValue | Value. Might be NULL |
GDAL.OGRContourWriterInfo
— TypeOGRContourWriterInfo
Doxygen_Suppress
GDAL.OGRCoordinateTransformationH
— TypeOpaque type for a coordinate transformation object
GDAL.OGRCoordinateTransformationOptionsH
— TypeCoordinate transformation options
GDAL.OGRDataSourceH
— TypeOpaque type for a OGR datasource (OGRDataSource)
GDAL.OGRErr
— TypeType for a OGR error
GDAL.OGRFeatureDefnH
— TypeOpaque type for a feature definition (OGRFeatureDefn)
GDAL.OGRFeatureH
— TypeOpaque type for a feature (OGRFeature)
GDAL.OGRField
— TypeOGRField
OGRFeature field attribute value union.
GDAL.OGRFieldDefnH
— TypeOpaque type for a field definition (OGRFieldDefn)
GDAL.OGRFieldDomainH
— TypeOpaque type for a field domain definition (OGRFieldDomain)
GDAL.OGRFieldDomainMergePolicy
— TypeOGRFieldDomainMergePolicy
Merge policy for field domains.
When a feature is built by merging two features, defines how the value of attributes following the domain are computed.
\since GDAL 3.3
Enumerator | Note |
---|---|
OFDMP_DEFAULT_VALUE | Default value |
OFDMP_SUM | Sum |
OFDMP_GEOMETRY_WEIGHTED | New values are computed as the weighted average of the source values. |
GDAL.OGRFieldDomainSplitPolicy
— TypeOGRFieldDomainSplitPolicy
Split policy for field domains.
When a feature is split in two, defines how the value of attributes following the domain are computed.
\since GDAL 3.3
Enumerator | Note |
---|---|
OFDSP_DEFAULT_VALUE | Default value |
OFDSP_DUPLICATE | Duplicate |
OFDSP_GEOMETRY_RATIO | New values are computed by the ratio of their area/length compared to the area/length of the original feature |
GDAL.OGRFieldDomainType
— TypeOGRFieldDomainType
Type of field domain.
\since GDAL 3.3
Enumerator | Note |
---|---|
OFDT_CODED | Coded |
OFDT_RANGE | Range (min/max) |
OFDT_GLOB | Glob (used by GeoPackage) |
GDAL.OGRFieldSubType
— TypeOGRFieldSubType
List of field subtypes. A subtype represents a hint, a restriction of the main type, that is not strictly necessary to consult. This list is likely to be extended in the future ... avoid coding applications based on the assumption that all field types can be known. Most subtypes only make sense for a restricted set of main types.
\since GDAL 2.0
Enumerator | Note |
---|---|
OFSTNone | No subtype. This is the default value |
OFSTBoolean | Boolean integer. Only valid for OFTInteger and OFTIntegerList. |
OFSTInt16 | Signed 16-bit integer. Only valid for OFTInteger and OFTIntegerList. |
OFSTFloat32 | Single precision (32 bit) floating point. Only valid for OFTReal and OFTRealList. |
OFSTJSON | JSON content. Only valid for OFTString. \since GDAL 2.4 |
OFSTUUID | UUID string representation. Only valid for OFTString. \since GDAL 3.3 |
OFSTMaxSubType |
GDAL.OGRFieldType
— TypeOGRFieldType
List of feature field types. This list is likely to be extended in the future ... avoid coding applications based on the assumption that all field types can be known.
Enumerator | Note |
---|---|
OFTInteger | Simple 32bit integer |
OFTIntegerList | List of 32bit integers |
OFTReal | Double Precision floating point |
OFTRealList | List of doubles |
OFTString | String of ASCII chars |
OFTStringList | Array of strings |
OFTWideString | deprecated |
OFTWideStringList | |
OFTBinary | Raw Binary data |
OFTDate | Date |
OFTTime | Time |
OFTDateTime | Date and Time |
OFTInteger64 | Single 64bit integer |
OFTInteger64List | List of 64bit integers |
OFTMaxType |
GDAL.OGRGeomCoordinatePrecisionH
— TypeOpaque type for OGRGeomCoordinatePrecision
GDAL.OGRGeomFieldDefnH
— TypeOpaque type for a geometry field definition (OGRGeomFieldDefn)
GDAL.OGRGeomTransformerH
— TypeOpaque type for a geometry transformer
GDAL.OGRGeometryH
— TypeOpaque type for a geometry
GDAL.OGRGeometryTypeCounter
— TypeOGRGeometryTypeCounter
Result item of OGR_L_GetGeometryTypes
Field | Note |
---|---|
eGeomType | Geometry type |
nCount | Number of geometries of type eGeomType |
GDAL.OGRJustification
— TypeOGRJustification
Display justification for field values.
GDAL.OGRLayerH
— TypeOpaque type for a layer (OGRLayer)
GDAL.OGRPreparedGeometryH
— TypeOpaque type for a prepared geometry
GDAL.OGRSFDriverH
— TypeOpaque type for a OGR driver (OGRSFDriver)
GDAL.OGRSTBrushParam
— TypeList of parameters for use with OGRStyleBrush
GDAL.OGRSTClassId
— TypeOGRStyleTool derived class types (returned by GetType())
GDAL.OGRSTLabelParam
— TypeList of parameters for use with OGRStyleLabel
GDAL.OGRSTPenParam
— TypeList of parameters for use with OGRStylePen
GDAL.OGRSTSymbolParam
— TypeList of parameters for use with OGRStyleSymbol
GDAL.OGRSTUnitId
— TypeList of units supported by OGRStyleTools
GDAL.OGRSpatialReferenceH
— TypeOpaque type for a spatial reference system
GDAL.OGRStyleMgrH
— TypeStyle manager opaque type
GDAL.OGRStyleTableH
— TypeOpaque type for a style table (OGRStyleTable)
GDAL.OGRStyleToolH
— TypeStyle tool opaque type
GDAL.OGRwkbByteOrder
— TypeOGRwkbByteOrder
Enumeration to describe byte order
Enumerator | Note |
---|---|
wkbXDR | MSB/Sun/Motorola: Most Significant Byte First |
wkbNDR | LSB/Intel/Vax: Least Significant Byte First |
GDAL.OGRwkbGeometryType
— TypeOGRwkbGeometryType
List of well known binary geometry types. These are used within the BLOBs but are also returned from OGRGeometry::getGeometryType() to identify the type of a geometry object.
Enumerator | Note |
---|---|
wkbUnknown | unknown type, non-standard |
wkbPoint | 0-dimensional geometric object, standard WKB |
wkbLineString | 1-dimensional geometric object with linear interpolation between Points, standard WKB |
wkbPolygon | planar 2-dimensional geometric object defined by 1 exterior boundary and 0 or more interior boundaries, standard WKB |
wkbMultiPoint | GeometryCollection of Points, standard WKB |
wkbMultiPolygon | GeometryCollection of Polygons, standard WKB |
wkbGeometryCollection | geometric object that is a collection of 1 or more geometric objects, standard WKB |
wkbCircularString | one or more circular arc segments connected end to end, ISO SQL/MM Part 3. GDAL >= 2.0 |
wkbCompoundCurve | sequence of contiguous curves, ISO SQL/MM Part 3. GDAL >= 2.0 |
wkbCurvePolygon | planar surface, defined by 1 exterior boundary and zero or more interior boundaries, that are curves. ISO SQL/MM Part 3. GDAL >= 2.0 |
wkbMultiCurve | GeometryCollection of Curves, ISO SQL/MM Part 3. GDAL >= 2.0 |
wkbMultiSurface | GeometryCollection of Surfaces, ISO SQL/MM Part 3. GDAL >= 2.0 |
wkbTIN | a PolyhedralSurface consisting only of Triangle patches ISO SQL/MM Part 3. GDAL >= 2.3 |
wkbTriangle | a Triangle. ISO SQL/MM Part 3. GDAL >= 2.3 |
wkbNone | non-standard, for pure attribute records |
wkbLinearRing | non-standard, just for createGeometry() |
wkbCircularStringZ | wkbCircularString with Z component. ISO SQL/MM Part 3. GDAL >= 2.0 |
wkbCompoundCurveZ | wkbCompoundCurve with Z component. ISO SQL/MM Part 3. GDAL >= 2.0 |
wkbCurvePolygonZ | wkbCurvePolygon with Z component. ISO SQL/MM Part 3. GDAL >= 2.0 |
wkbMultiCurveZ | wkbMultiCurve with Z component. ISO SQL/MM Part 3. GDAL >= 2.0 |
wkbMultiSurfaceZ | wkbMultiSurface with Z component. ISO SQL/MM Part 3. GDAL >= 2.0 |
wkbCurveZ | wkbCurve with Z component. ISO SQL/MM Part 3. GDAL >= 2.1 |
wkbSurfaceZ | wkbSurface with Z component. ISO SQL/MM Part 3. GDAL >= 2.1 |
wkbPolyhedralSurfaceZ | ISO SQL/MM Part 3. GDAL >= 2.3 |
wkbTINZ | |
wkbTriangleZ | |
wkbPointM | ISO SQL/MM Part 3. GDAL >= 2.1 |
wkbLineStringM | |
wkbPolygonM | |
wkbMultiPointM | |
wkbMultiLineStringM | |
wkbMultiPolygonM | |
wkbGeometryCollectionM | |
wkbCircularStringM | |
wkbCompoundCurveM | |
wkbCurvePolygonM | |
wkbMultiCurveM | |
wkbMultiSurfaceM | |
wkbCurveM | |
wkbSurfaceM | |
wkbPolyhedralSurfaceM | ISO SQL/MM Part 3. GDAL >= 2.3 |
wkbTINM | |
wkbTriangleM | |
wkbPointZM | ISO SQL/MM Part 3. GDAL >= 2.1 |
wkbLineStringZM | |
wkbPolygonZM | |
wkbMultiPointZM | |
wkbMultiLineStringZM | |
wkbMultiPolygonZM | |
wkbGeometryCollectionZM | |
wkbCircularStringZM | |
wkbCompoundCurveZM | |
wkbCurvePolygonZM | |
wkbMultiCurveZM | |
wkbMultiSurfaceZM | |
wkbCurveZM | |
wkbSurfaceZM | |
wkbPolyhedralSurfaceZM | ISO SQL/MM Part 3. GDAL >= 2.3 |
wkbTINZM | |
wkbTriangleZM | |
wkbPoint25D | 2.5D extension as per 99-402 |
wkbLineString25D | |
wkbPolygon25D | |
wkbMultiPoint25D | |
wkbMultiLineString25D | |
wkbMultiPolygon25D | |
wkbGeometryCollection25D |
GDAL.OGRwkbVariant
— TypeOGRwkbVariant
Output variants of WKB we support.
99-402 was a short-lived extension to SFSQL 1.1 that used a high-bit flag to indicate the presence of Z coordinates in a WKB geometry.
SQL/MM Part 3 and SFSQL 1.2 use offsets of 1000 (Z), 2000 (M) and 3000 (ZM) to indicate the present of higher dimensional coordinates in a WKB geometry. Reference: <a href="https://portal.opengeospatial.org/files/?artifactid=320243"> 09-009\Committee_Draft_ISOIEC_CD_13249-3_SQLMM_Spatial.pdf</a>, ISO/IEC JTC 1/SC 32 N 1820, ISO/IEC CD 13249-3:201x(E), Date: 2009-01-16. The codes are also found in §8.2.3 of <a href="http://portal.opengeospatial.org/files/?artifact_id=25355"> OGC 06-103r4 "OpenGIS® Implementation Standard for Geographic information - Simple feature access - Part 1: Common architecture", v1.2.1</a>
Enumerator | Note |
---|---|
wkbVariantOldOgc | Old-style 99-402 extended dimension (Z) WKB types |
wkbVariantIso | SFSQL 1.2 and ISO SQL/MM Part 3 extended dimension (Z&M) WKB types |
wkbVariantPostGIS1 | PostGIS 1.X has different codes for CurvePolygon, MultiCurve and MultiSurface |
GDAL.OSRAxisMappingStrategy
— TypeOSRAxisMappingStrategy
Data axis to CRS axis mapping strategy.
Enumerator | Note |
---|---|
OAMS_TRADITIONAL_GIS_ORDER | Traditional GIS order |
OAMS_AUTHORITY_COMPLIANT | Compliant with the order mandated by the CRS authority |
OAMS_CUSTOM | Custom |
GDAL.OSRCRSInfo
— TypeOSRCRSInfo
Structure given overall description of a CRS.
This structure may grow over time, and should not be directly allocated by client code.
Field | Note |
---|---|
pszAuthName | Authority name. |
pszCode | Object code. |
pszName | Object name. |
eType | Object type. |
bDeprecated | Whether the object is deprecated |
bBboxValid | Whereas the west_lon_degree, south_lat_degree, east_lon_degree and north_lat_degree fields are valid. |
dfWestLongitudeDeg | Western-most longitude of the area of use, in degrees. |
dfSouthLatitudeDeg | Southern-most latitude of the area of use, in degrees. |
dfEastLongitudeDeg | Eastern-most longitude of the area of use, in degrees. |
dfNorthLatitudeDeg | Northern-most latitude of the area of use, in degrees. |
pszAreaName | Name of the area of use. |
pszProjectionMethod | Name of the projection method for a projected CRS. Might be NULL evenfor projected CRS in some cases. |
GDAL.OSRCRSType
— TypeOSRCRSType
Type of Coordinate Reference System (CRS).
Enumerator | Note |
---|---|
OSR_CRS_TYPE_GEOGRAPHIC_2D | Geographic 2D CRS |
OSR_CRS_TYPE_GEOGRAPHIC_3D | Geographic 3D CRS |
OSR_CRS_TYPE_GEOCENTRIC | Geocentric CRS |
OSR_CRS_TYPE_PROJECTED | Projected CRS |
OSR_CRS_TYPE_VERTICAL | Vertical CRS |
OSR_CRS_TYPE_COMPOUND | Compound CRS |
OSR_CRS_TYPE_OTHER | Other |
GDAL.VRTAveragedSourceH
— TypeDoxygen_Suppress
GDAL.VRTDatasetH
— TypeOpaque type for a VRT dataset
GDAL.VRTImageReadFunc
— TypeType for a function that returns the pixel data in a provided window
GDAL.VRTPDWorkingDataPtr
— TypeGeneric pointer for the working structure of VRTProcessedDataset function
GDAL.VRTSourcedRasterBandH
— TypeOpaque type for a VRT sourced raster band
GDAL.VSIDIREntry
— TypeVSIDIREntry
Directory entry.
Field | Note |
---|---|
pszName | Filename |
nMode | File mode. See VSI_ISREG () / VSI_ISDIR () |
nSize | File size |
nMTime | Last modification time (seconds since 1970/01/01) |
bModeKnown | Whether nMode is known: 0 = unknown, 1 = known. |
bSizeKnown | Whether nSize is known: 0 = unknown, 1 = known. |
bMTimeKnown | Whether nMTime is known: 0 = unknown, 1 = known. |
papszExtra | NULL-terminated list of extra properties. |
GDAL.VSIFilesystemPluginAdviseReadCallback
— TypeThis optional method is called when code plans to access soon one or several ranges in a file. Some file systems may be able to use this hint to for example asynchronously start such requests.
Offsets may be given in a non-increasing order, and may potentially overlap.
\since GDAL 3.7
Arguments
pFile
: File handle.nRanges
: Size of the panOffsets and panSizes arrays.panOffsets
: Array containing the start offset of each range.panSizes
: Array containing the size (in bytes) of each range.
GDAL.VSIFilesystemPluginCallbacksStruct
— TypeVSIFilesystemPluginCallbacksStruct
struct containing callbacks to used by the handler. (rw), (r), (w) or () at the end indicate whether the given callback is mandatory for reading and or writing handlers. A (?) indicates that the callback might be mandatory for certain drivers only.
\since GDAL 3.0
Field | Note |
---|---|
pUserData | Optional opaque pointer passed back to filemanager callbacks (e.g. open, stat, rmdir) |
stat | stat handle by name (rw) |
unlink | unlink handle by name () |
rename | rename handle () |
mkdir | make directory () |
rmdir | remove directory () |
read_dir | list directory content (r?) |
open | open handle by name (rw) |
tell | get current position of handle (rw) |
seek | set current position of handle (rw) |
read | read from current position (r) |
read_multi_range | read multiple blocks () |
get_range_status | get range status () |
eof | has end of file been reached (r?) |
write | write bytes to current position (w) |
flush | sync bytes (w) |
truncate | truncate handle (w?) |
close | close handle (rw) |
nBufferSize | buffer small reads (makes handler read only) |
nCacheSize | max mem to use per file when buffering |
sibling_files | list related files |
advise_read | AdviseRead() |
GDAL.VSIFilesystemPluginCloseCallback
— TypeClose file handle. Optional
\since GDAL 3.0
GDAL.VSIFilesystemPluginEofCallback
— TypeHas end of file been reached. Mandatory? for read handles.
\since GDAL 3.0
GDAL.VSIFilesystemPluginFlushCallback
— TypeSync written bytes. Optional
\since GDAL 3.0
GDAL.VSIFilesystemPluginGetRangeStatusCallback
— TypeGet empty ranges. Optional
\since GDAL 3.0
GDAL.VSIFilesystemPluginMkdirCallback
— TypeCreate Directory. Optional
\since GDAL 3.0
GDAL.VSIFilesystemPluginOpenCallback
— TypeOpen a handle. Mandatory. Returns an opaque pointer that will be used in subsequent file I/O calls. Should return null and/or set errno if the handle does not exist or the access mode is incorrect.
\since GDAL 3.0
GDAL.VSIFilesystemPluginReadCallback
— TypeRead data from current position, returns the number of blocks correctly read. Mandatory except for write only handles
\since GDAL 3.0
GDAL.VSIFilesystemPluginReadDirCallback
— TypeList directory content. Optional
\since GDAL 3.0
GDAL.VSIFilesystemPluginReadMultiRangeCallback
— TypeRead from multiple offsets. Optional, will be replaced by multiple calls to Read() if not provided
\since GDAL 3.0
GDAL.VSIFilesystemPluginRenameCallback
— TypeRename handle. Optional
\since GDAL 3.0
GDAL.VSIFilesystemPluginRmdirCallback
— TypeDelete Directory. Optional
\since GDAL 3.0
GDAL.VSIFilesystemPluginSeekCallback
— TypeSeek to position in handle. Mandatory except for write only handles
\since GDAL 3.0
GDAL.VSIFilesystemPluginSiblingFilesCallback
— TypeList related files. Must return NULL if unknown, or a list of relative filenames that can be opened along the main file. If no other file than pszFilename needs to be opened, return static_cast<char**> (CPLCalloc
(1,sizeof(char*)));
Optional
\since GDAL 3.2
GDAL.VSIFilesystemPluginStatCallback
— TypeReturn information about a handle. Optional (driver dependent)
\since GDAL 3.0
GDAL.VSIFilesystemPluginTellCallback
— TypeReturn current position in handle. Mandatory
\since GDAL 3.0
GDAL.VSIFilesystemPluginTruncateCallback
— TypeTruncate handle. Mandatory (driver dependent?) for write handles
GDAL.VSIFilesystemPluginUnlinkCallback
— TypeRemove handle by name. Optional
\since GDAL 3.0
GDAL.VSIFilesystemPluginWriteCallback
— TypeWrite bytes at current offset. Mandatory for writable handles
\since GDAL 3.0
GDAL.VSILFILE
— TypeOpaque type for a FILE that implements the VSIVirtualHandle
API
GDAL.VSIRangeStatus
— TypeVSIRangeStatus
Range status
Enumerator | Note |
---|---|
VSI_RANGE_STATUS_UNKNOWN | Unknown |
VSI_RANGE_STATUS_DATA | Data present |
VSI_RANGE_STATUS_HOLE | Hole |
GDAL.VSIStatBuf
— TypeDoxygen_Suppress
GDAL.VSIStatBufL
— TypeType for VSIStatL
()
GDAL.VSIWriteFunction
— TypeCallback used by VSIStdoutSetRedirection
()
GDAL.ogr_style_tool_class_id
— Typeogr_style_tool_class_id
OGRStyleTool derived class types (returned by GetType()).
Enumerator | Note |
---|---|
OGRSTCNone | None |
OGRSTCPen | Pen |
OGRSTCBrush | Brush |
OGRSTCSymbol | Symbol |
OGRSTCLabel | Label |
OGRSTCVector | Vector |
GDAL.ogr_style_tool_param_brush_id
— Typeogr_style_tool_param_brush_id
List of parameters for use with OGRStyleBrush.
Enumerator | Note |
---|---|
OGRSTBrushFColor | Foreground color |
OGRSTBrushBColor | Background color |
OGRSTBrushId | Id |
OGRSTBrushAngle | Angle |
OGRSTBrushSize | Size |
OGRSTBrushDx | Dx |
OGRSTBrushDy | Dy |
OGRSTBrushPriority | Priority |
GDAL.ogr_style_tool_param_label_id
— Typeogr_style_tool_param_label_id
List of parameters for use with OGRStyleLabel.
Enumerator | Note |
---|---|
OGRSTLabelFontName | Font name |
OGRSTLabelSize | Size |
OGRSTLabelTextString | Text string |
OGRSTLabelAngle | Angle |
OGRSTLabelFColor | Foreground color |
OGRSTLabelBColor | Background color |
OGRSTLabelPlacement | Placement |
OGRSTLabelAnchor | Anchor |
OGRSTLabelDx | Dx |
OGRSTLabelDy | Dy |
OGRSTLabelPerp | Perpendicular |
OGRSTLabelBold | Bold |
OGRSTLabelItalic | Italic |
OGRSTLabelUnderline | Underline |
OGRSTLabelPriority | Priority |
OGRSTLabelStrikeout | Strike out |
OGRSTLabelStretch | Stretch |
OGRSTLabelAdjHor | OBSOLETE; do not use |
OGRSTLabelAdjVert | |
OGRSTLabelHColor | Highlight color |
OGRSTLabelOColor | Outline color |
GDAL.ogr_style_tool_param_pen_id
— Typeogr_style_tool_param_pen_id
List of parameters for use with OGRStylePen.
Enumerator | Note |
---|---|
OGRSTPenColor | Color |
OGRSTPenWidth | Width |
OGRSTPenPattern | Pattern |
OGRSTPenId | Id |
OGRSTPenPerOffset | Perpendicular offset |
OGRSTPenCap | Cap |
OGRSTPenJoin | Join |
OGRSTPenPriority | Priority |
GDAL.ogr_style_tool_param_symbol_id
— Typeogr_style_tool_param_symbol_id
List of parameters for use with OGRStyleSymbol.
Enumerator | Note |
---|---|
OGRSTSymbolId | Id |
OGRSTSymbolAngle | Angle |
OGRSTSymbolColor | Color |
OGRSTSymbolSize | Size |
OGRSTSymbolDx | Dx |
OGRSTSymbolDy | Dy |
OGRSTSymbolStep | Step |
OGRSTSymbolPerp | Perpendicular |
OGRSTSymbolOffset | Offset |
OGRSTSymbolPriority | Priority |
OGRSTSymbolFontName | Font name |
OGRSTSymbolOColor | Outline color |
GDAL.ogr_style_tool_units_id
— Typeogr_style_tool_units_id
List of units supported by OGRStyleTools.
Enumerator | Note |
---|---|
OGRSTUGround | Ground unit |
OGRSTUPixel | Pixel |
OGRSTUPoints | Points |
OGRSTUMM | Millimeter |
OGRSTUCM | Centimeter |
OGRSTUInches | Inch |
GDAL.vsi_l_offset
— TypeType for a file offset
GDAL._cplassert
— Method_CPLAssert(const char * pszExpression,
const char * pszFile,
int iLine) -> void
Report failure of a logical assertion.
GDAL.aftercare
— MethodHandle anything returned from GDAL
When values are returned from GDAL, always check if there was a failure using maybe_throw
. If the failure was thrown by GDAL itself, it will not even get to aftercare
and end up in gdaljl_errorhandler
. However in many cases even though GDAL sets the error state to CE_Failure
it will not throw the error. However we always do, to make sure not failure goes unnoticed. If an error might be expected, one can use try .. catch
to handle this.
Depending on the return type, we do extra work.
GDAL.aftercare
— MethodFor string pointers, load them to String, and free them if we should.
GDAL.aftercare
— MethodFor string list pointers, load them to Vector{String}
That is it expects a StringList
, in the sense of the CPL functions, as a null-terminated array of strings.
GDAL.cplacquirelock
— MethodCPLAcquireLock(CPLLock * psLock) -> int
GDAL.cplacquiremutex
— MethodCPLAcquireMutex(CPLMutex * hMutexIn,
double) -> int
GDAL.cpladdfileinzip
— MethodCPLAddFileInZip(void * hZip,
const char * pszArchiveFilename,
const char * pszInputFilename,
VSILFILE * fpInput,
CSLConstList papszOptions,
GDALProgressFunc pProgressFunc,
void * pProgressData) -> CPLErr
Add a file inside a ZIP file opened/created with CPLCreateZip().
Parameters
- hZip: ZIP file handle
- pszArchiveFilename: Filename (in UTF-8) stored in the archive.
- pszInputFilename: Filename of the file to add. If NULL, fpInput must not be NULL
- fpInput: File handle opened on the file to add. May be NULL if pszInputFilename is provided.
- papszOptions: Options.
- pProgressFunc: Progress callback, or NULL.
- pProgressData: User data of progress callback, or NULL.
Returns
CE_None in case of success.
GDAL.cpladdxmlattributeandvalue
— MethodCPLAddXMLAttributeAndValue(CPLXMLNode * psParent,
const char * pszName,
const char * pszValue) -> void
Create an attribute and text value.
Parameters
- psParent: the parent node to which the resulting node should be attached. Must not be NULL.
- pszName: the attribute name to create.
- pszValue: the text to attach to the attribute. Must not be NULL.
GDAL.cpladdxmlchild
— MethodCPLAddXMLChild(CPLXMLNode * psParent,
CPLXMLNode * psChild) -> void
Add child node to parent.
Parameters
- psParent: the node to attach the child to. May not be NULL.
- psChild: the child to add to the parent. May not be NULL. Should not be a child of any other parent.
GDAL.cpladdxmlsibling
— MethodCPLAddXMLSibling(CPLXMLNode * psOlderSibling,
CPLXMLNode * psNewSibling) -> void
Add new sibling.
Parameters
- psOlderSibling: the node to attach the sibling after.
- psNewSibling: the node to add at the end of psOlderSiblings psNext chain.
GDAL.cplatof
— MethodCPLAtof(const char * nptr) -> double
Converts ASCII string to floating point number.
Parameters
- nptr: Pointer to string to convert.
Returns
Converted value, if any.
GDAL.cplatofdelim
— MethodCPLAtofDelim(const char * nptr,
char point) -> double
Converts ASCII string to floating point number.
Parameters
- nptr: Pointer to string to convert.
- point: Decimal delimiter.
Returns
Converted value, if any.
GDAL.cplatofm
— MethodCPLAtofM(const char * nptr) -> double
Converts ASCII string to floating point number using any numeric locale.
Parameters
- nptr: The string to convert.
Returns
Converted value, if any. Zero on failure.
GDAL.cplatogintbig
— MethodCPLAtoGIntBig(const char * pszString) -> GIntBig
Convert a string to a 64 bit signed integer.
Parameters
- pszString: String containing 64 bit signed integer.
Returns
64 bit signed integer.
GDAL.cplatogintbigex
— MethodCPLAtoGIntBigEx(const char * pszString,
int bWarn,
int * pbOverflow) -> GIntBig
Convert a string to a 64 bit signed integer.
Parameters
- pszString: String containing 64 bit signed integer.
- bWarn: Issue a warning if an overflow occurs during conversion
- pbOverflow: Pointer to an integer to store if an overflow occurred, or NULL
Returns
64 bit signed integer.
GDAL.cplcalloc
— MethodCPLCalloc(size_t nCount,
size_t nSize) -> void *
Safe version of calloc().
Parameters
- nCount: number of objects to allocate.
- nSize: size (in bytes) of object to allocate.
Returns
pointer to newly allocated memory, only NULL if nSize * nCount is NULL.
GDAL.cplcallprevioushandler
— MethodCPLCallPreviousHandler(CPLErr eErrClass,
CPLErrorNum err_no,
const char * pszMsg) -> void
Call the previously installed error handler in the error handler stack.
GDAL.cplcheckforfile
— MethodCPLCheckForFile(char * pszFilename,
char ** papszSiblingFiles) -> int
Check for file existence.
Parameters
- pszFilename: name of file to check for - filename case updated in some cases.
- papszSiblingFiles: a list of files in the same directory as pszFilename if available, or NULL. This list should have no path components.
Returns
TRUE if a match is found, or FALSE if not.
GDAL.cplcleantrailingslash
— MethodCPLCleanTrailingSlash(const char * pszPath) -> const char *
Remove trailing forward/backward slash from the path for UNIX/Windows resp.
Parameters
- pszPath: the path to be cleaned up
Returns
Path in an internal string which must not be freed. The string may be destroyed by the next CPL filename handling call.
GDAL.cplcleanuperrormutex
— Methodcplcleanuperrormutex()
Doxygen_Suppress
GDAL.cplcleanupmastermutex
— MethodCPLCleanupMasterMutex() -> void
GDAL.cplcleanupsetlocalemutex
— Methodcplcleanupsetlocalemutex()
Doxygen_Suppress
GDAL.cplcleanupsharedfilemutex
— Methodcplcleanupsharedfilemutex()
Doxygen_Suppress
GDAL.cplcleanuptls
— MethodCPLCleanupTLS() -> void
GDAL.cplcleanxmlelementname
— MethodCPLCleanXMLElementName(char * pszTarget) -> void
Make string into safe XML token.
Parameters
- pszTarget: the string to be adjusted. It is altered in place.
GDAL.cplclonexmltree
— MethodCPLCloneXMLTree(const CPLXMLNode * psTree) -> CPLXMLNode *
Copy tree.
Parameters
- psTree: the tree to duplicate.
Returns
a copy of the whole tree.
GDAL.cplclosefileinzip
— MethodCPLCloseFileInZip(void *) -> CPLErr
GDAL.cplcloseshared
— MethodCPLCloseShared(FILE * fp) -> void
Close shared file.
Parameters
- fp: file handle from CPLOpenShared() to deaccess.
GDAL.cplclosezip
— MethodCPLCloseZip(void *) -> CPLErr
GDAL.cplcondbroadcast
— MethodCPLCondBroadcast(CPLCond * hCond) -> void
GDAL.cplcondsignal
— MethodCPLCondSignal(CPLCond * hCond) -> void
GDAL.cplcondtimedwait
— MethodCPLCondTimedWait(CPLCond * hCond,
CPLMutex * hMutex,
double dfWaitInSeconds) -> CPLCondTimedWaitReason
GDAL.cplcondwait
— MethodCPLCondWait(CPLCond * hCond,
CPLMutex * hMutex) -> void
GDAL.cplcopyfile
— MethodCPLCopyFile(const char * pszNewPath,
const char * pszOldPath) -> int
Copy a file.
GDAL.cplcopytree
— MethodCPLCopyTree(const char * pszNewPath,
const char * pszOldPath) -> int
Recursively copy a tree.
GDAL.cplcorrespondingpaths
— MethodCPLCorrespondingPaths(const char * pszOldFilename,
const char * pszNewFilename,
char ** papszFileList) -> char **
Identify corresponding paths.
Parameters
- pszOldFilename: path to old prototype file.
- pszNewFilename: path to new prototype file.
- papszFileList: list of other files associated with pszOldFilename to rename similarly.
Returns
a list of files corresponding to papszFileList but renamed to correspond to pszNewFilename.
GDAL.cplcreatecond
— MethodCPLCreateCond() -> CPLCond *
GDAL.cplcreatefileinzip
— MethodCPLCreateFileInZip(void *,
const char *,
char **) -> CPLErr
GDAL.cplcreatejoinablethread
— MethodCPLCreateJoinableThread(CPLThreadFunc pfnMain,
void * pThreadArg) -> CPLJoinableThread *
GDAL.cplcreatelock
— MethodCPLCreateLock(CPLLockType eType) -> CPLLock *
GDAL.cplcreatemutex
— MethodCPLCreateMutex() -> CPLMutex *
GDAL.cplcreatemutexex
— MethodCPLCreateMutexEx(int nOptions) -> CPLMutex *
GDAL.cplcreateoracquirelock
— MethodCPLCreateOrAcquireLock(CPLLock ** ppsLock,
CPLLockType eType) -> int
GDAL.cplcreateoracquiremutex
— MethodCPLCreateOrAcquireMutex(CPLMutex ** phMutex,
double dfWaitInSeconds) -> int
GDAL.cplcreateoracquiremutexex
— MethodCPLCreateOrAcquireMutexEx(CPLMutex ** phMutex,
double dfWaitInSeconds,
int nOptions) -> int
GDAL.cplcreatethread
— MethodCPLCreateThread(CPLThreadFunc pfnMain,
void * pThreadArg) -> int
GDAL.cplcreatexmlelementandvalue
— MethodCPLCreateXMLElementAndValue(CPLXMLNode * psParent,
const char * pszName,
const char * pszValue) -> CPLXMLNode *
Create an element and text value.
Parameters
- psParent: the parent node to which the resulting node should be attached. May be NULL to keep as freestanding.
- pszName: the element name to create.
- pszValue: the text to attach to the element. Must not be NULL.
Returns
the pointer to the new element node.
GDAL.cplcreatexmlnode
— MethodCPLCreateXMLNode(CPLXMLNode * poParent,
CPLXMLNodeType eType,
const char * pszText) -> CPLXMLNode *
Create an document tree item.
Parameters
- poParent: the parent to which this node should be attached as a child. May be NULL to keep as free standing.
- eType: the type of the newly created node
- pszText: the value of the newly created node
Returns
the newly created node, now owned by the caller (or parent node).
GDAL.cplcreatezip
— Methodcplcreatezip(pszZipFilename, papszOptions)
GDAL.cpldectodms
— MethodCPLDecToDMS(double dfAngle,
const char * pszAxis,
int nPrecision) -> const char *
Translate a decimal degrees value to a DMS string with hemisphere.
GDAL.cpldectopackeddms
— MethodCPLDecToPackedDMS(double dfDec) -> double
Convert decimal degrees into packed DMS value (DDDMMMSSS.SS).
Parameters
- dfDec: Angle in decimal degrees.
Returns
Angle in packed DMS format.
GDAL.cpldefaultfindfile
— MethodCPLDefaultFindFile(const char * pszClass,
const char * pszBasename) -> const char *
CPLDefaultFindFile.
GDAL.cpldestroycond
— MethodCPLDestroyCond(CPLCond * hCond) -> void
GDAL.cpldestroylock
— MethodCPLDestroyLock(CPLLock * psLock) -> void
GDAL.cpldestroymutex
— MethodCPLDestroyMutex(CPLMutex * hMutexIn) -> void
GDAL.cpldestroyxmlnode
— MethodCPLDestroyXMLNode(CPLXMLNode * psNode) -> void
Destroy a tree.
Parameters
- psNode: the tree to free.
GDAL.cpldmstodec
— Methodcpldmstodec(is)
GDAL.cpldumpsharedlist
— MethodCPLDumpSharedList(FILE * fp) -> void
Report open shared files.
Parameters
- fp: File handle to write to.
GDAL.cplexpandtilde
— MethodCPLExpandTilde(const char * pszFilename) -> const char *
Expands ~/ at start of filename.
Parameters
- pszFilename: filename potentially starting with ~/
Returns
an expanded filename.
GDAL.cplextractrelativepath
— MethodCPLExtractRelativePath(const char * pszBaseDir,
const char * pszTarget,
int * pbGotRelative) -> const char *
Get relative path from directory to target file.
Parameters
- pszBaseDir: the name of the directory relative to which the path should be computed. pszBaseDir may be NULL in which case the original target is returned without relativizing.
- pszTarget: the filename to be changed to be relative to pszBaseDir.
- pbGotRelative: Pointer to location in which a flag is placed indicating that the returned path is relative to the basename (TRUE) or not (FALSE). This pointer may be NULL if flag is not desired.
Returns
an adjusted path or the original if it could not be made relative to the pszBaseFile's path.
GDAL.cplfgets
— MethodCPLFGets(char * pszBuffer,
int nBufferSize,
FILE * fp) -> char *
Reads in at most one less than nBufferSize characters from the fp stream and stores them into the buffer pointed to by pszBuffer.
Parameters
- pszBuffer: pointer to the targeting character buffer.
- nBufferSize: maximum size of the string to read (not including terminating '\0').
- fp: file pointer to read from.
Returns
pointer to the pszBuffer containing a string read from the file or NULL if the error or end of file was encountered.
GDAL.cplfinderclean
— MethodCPLFinderClean() -> void
CPLFinderClean.
GDAL.cplfindfile
— MethodCPLFindFile(const char * pszClass,
const char * pszBasename) -> const char *
CPLFindFile.
GDAL.cplformcifilename
— MethodCPLFormCIFilename(const char * pszPath,
const char * pszBasename,
const char * pszExtension) -> const char *
Case insensitive file searching, returning full path.
Parameters
- pszPath: directory path to the directory containing the file. This may be relative or absolute, and may have a trailing path separator or not. May be NULL.
- pszBasename: file basename. May optionally have path and/or extension. May not be NULL.
- pszExtension: file extension, optionally including the period. May be NULL.
Returns
a fully formed filename in an internal static string. Do not modify or free the returned string. The string may be destroyed by the next CPL call.
GDAL.cplformfilename
— MethodCPLFormFilename(const char * pszPath,
const char * pszBasename,
const char * pszExtension) -> const char *
Build a full file path from a passed path, file basename and extension.
Parameters
- pszPath: directory path to the directory containing the file. This may be relative or absolute, and may have a trailing path separator or not. May be NULL.
- pszBasename: file basename. May optionally have path and/or extension. Must NOT be NULL.
- pszExtension: file extension, optionally including the period. May be NULL.
Returns
a fully formed filename in an internal static string. Do not modify or free the returned string. The string may be destroyed by the next CPL call.
GDAL.cplfreeconfig
— Methodcplfreeconfig()
Doxygen_Suppress
GDAL.cplgeneratetempfilename
— MethodCPLGenerateTempFilename(const char * pszStem) -> const char *
Generate temporary file name.
Parameters
- pszStem: if non-NULL this will be part of the filename.
Returns
a filename which is valid till the next CPL call in this thread.
GDAL.cplgetbasename
— MethodCPLGetBasename(const char * pszFullFilename) -> const char *
Extract basename (non-directory, non-extension) portion of filename.
Parameters
- pszFullFilename: the full filename potentially including a path.
Returns
just the non-directory, non-extension portion of the path in an internal string which must not be freed. The string may be destroyed by the next CPL filename handling call.
GDAL.cplgetconfigoption
— Methodcplgetconfigoption(arg1, arg2)
GDAL.cplgetconfigoptions
— Methodcplgetconfigoptions()
GDAL.cplgetcurrentdir
— MethodCPLGetCurrentDir() -> char *
Get the current working directory name.
Returns
a pointer to buffer, containing current working directory path or NULL in case of error. User is responsible to free that buffer after usage with CPLFree() function. If HAVE_GETCWD macro is not defined, the function returns NULL.
GDAL.cplgetcurrentprocessid
— MethodCPLGetCurrentProcessID() -> int
GDAL.cplgetdirname
— MethodCPLGetDirname(const char * pszFilename) -> const char *
Extract directory path portion of filename.
Parameters
- pszFilename: the filename potentially including a path.
Returns
Path in an internal string which must not be freed. The string may be destroyed by the next CPL filename handling call. The returned will generally not contain a trailing path separator.
GDAL.cplgetexecpath
— MethodCPLGetExecPath(char * pszPathBuf,
int nMaxLength) -> int
Fetch path of executable.
Parameters
- pszPathBuf: the buffer into which the path is placed.
- nMaxLength: the buffer size (including the nul-terminating character). MAX_PATH+1 is suggested.
Returns
FALSE on failure or TRUE on success.
GDAL.cplgetextension
— MethodCPLGetExtension(const char * pszFullFilename) -> const char *
Extract filename extension from full filename.
Parameters
- pszFullFilename: the full filename potentially including a path.
Returns
just the extension portion of the path in an internal string which must not be freed. The string may be destroyed by the next CPL filename handling call.
GDAL.cplgetfilename
— MethodCPLGetFilename(const char * pszFullFilename) -> const char *
Extract non-directory portion of filename.
Parameters
- pszFullFilename: the full filename potentially including a path.
Returns
just the non-directory portion of the path (points back into original string).
GDAL.cplgetglobalconfigoption
— MethodCPLGetGlobalConfigOption(const char * pszKey,
const char * pszDefault) -> const char *
Same as CPLGetConfigOption() but excludes environment variables and options set with CPLSetThreadLocalConfigOption().
GDAL.cplgethomedir
— MethodCPLGetHomeDir() -> const char *
Return the path to the home directory.
Returns
the home directory, or NULL.
GDAL.cplgetlasterrormsg
— MethodCPLGetLastErrorMsg() -> const char *
Get the last error message.
Returns
the last error message, or an empty string ("") if there is no posted error message.
GDAL.cplgetnumcpus
— MethodCPLGetNumCPUs() -> int
GDAL.cplgetpagesize
— Methodcplgetpagesize()
Return the size of a page of virtual memory.
\since GDAL 1.11
Returns
the page size.
GDAL.cplgetpath
— MethodCPLGetPath(const char * pszFilename) -> const char *
Extract directory path portion of filename.
Parameters
- pszFilename: the filename potentially including a path.
Returns
Path in an internal string which must not be freed. The string may be destroyed by the next CPL filename handling call. The returned will generally not contain a trailing path separator.
GDAL.cplgetphysicalram
— MethodCPLGetPhysicalRAM(void) -> GIntBig
Return the total physical RAM in bytes.
Returns
the total physical RAM in bytes (or 0 in case of failure).
GDAL.cplgetpid
— Methodcplgetpid()
Contrary to what its name suggests, CPLGetPID
() actually returns the thread id
GDAL.cplgetsharedlist
— MethodCPLGetSharedList(int * pnCount) -> CPLSharedFileInfo *
Fetch list of open shared files.
Parameters
- pnCount: place to put the count of entries.
Returns
the pointer to the first in the array of shared file info structures.
GDAL.cplgetsymbol
— MethodCPLGetSymbol(const char * pszLibrary,
const char * pszSymbolName) -> void *
Fetch a function pointer from a shared library / DLL.
Parameters
- pszLibrary: the name of the shared library or DLL containing the function. May contain path to file. If not system supplies search paths will be used.
- pszSymbolName: the name of the function to fetch a pointer to.
Returns
A pointer to the function if found, or NULL if the function isn't found, or the shared library can't be loaded.
GDAL.cplgetthreadingmodel
— MethodCPLGetThreadingModel() -> const char *
GDAL.cplgetthreadlocalconfigoption
— MethodCPLGetThreadLocalConfigOption(const char * pszKey,
const char * pszDefault) -> const char *
Same as CPLGetConfigOption() but only with options set with CPLSetThreadLocalConfigOption()
GDAL.cplgetthreadlocalconfigoptions
— MethodCPLGetThreadLocalConfigOptions(void) -> char **
Return the list of thread local configuration options as KEY=VALUE pairs.
Returns
a copy of the list, to be freed with CSLDestroy().
GDAL.cplgettls
— MethodCPLGetTLS(int nIndex) -> void *
GDAL.cplgettlsex
— MethodCPLGetTLSEx(int nIndex,
int * pbMemoryErrorOccurred) -> void *
GDAL.cplgetusablephysicalram
— MethodCPLGetUsablePhysicalRAM(void) -> GIntBig
Return the total physical RAM, usable by a process, in bytes.
Returns
the total physical RAM, usable by a process, in bytes (or 0 in case of failure).
GDAL.cplgetxmlnode
— MethodCPLGetXMLNode(CPLXMLNode * psRoot,
const char * pszPath) -> CPLXMLNode *
Find node by path.
Parameters
- psRoot: the subtree in which to search. This should be a node of type CXT_Element. NULL is safe.
- pszPath: the list of element names in the path (dot separated).
Returns
the requested element node, or NULL if not found.
GDAL.cplgetxmlvalue
— MethodCPLGetXMLValue(const CPLXMLNode * psRoot,
const char * pszPath,
const char * pszDefault) -> const char *
Fetch element/attribute value.
Parameters
- psRoot: the subtree in which to search. This should be a node of type CXT_Element. NULL is safe.
- pszPath: the list of element names in the path (dot separated). An empty path means get the value of the psRoot node.
- pszDefault: the value to return if a corresponding value is not found, may be NULL.
Returns
the requested value or pszDefault if not found.
GDAL.cplisfilenamerelative
— MethodCPLIsFilenameRelative(const char * pszFilename) -> int
Is filename relative or absolute?
Parameters
- pszFilename: the filename with path to test.
Returns
TRUE if the filename is relative or FALSE if it is absolute.
GDAL.cplispoweroftwo
— Methodcplispoweroftwo(i)
Arguments
i
: - tested number
Returns
GDAL.cplisvirtualmemfilemapavailable
— Methodcplisvirtualmemfilemapavailable()
Return if virtual memory mapping of a file is available.
\since GDAL 1.11
Returns
TRUE
if virtual memory mapping of a file is available.
GDAL.cpljointhread
— MethodCPLJoinThread(CPLJoinableThread * hJoinableThread) -> void
GDAL.cpllaunderforfilename
— MethodCPLLaunderForFilename(const char * pszName,
const char * pszOutputPath) -> const char *
Launder a string to be compatible of a filename.
Parameters
- pszName: The input string to launder.
- pszOutputPath: The directory where the file would be created. Unused for now. May be NULL.
Returns
the laundered name.
GDAL.cplloadconfigoptionsfromfile
— MethodCPLLoadConfigOptionsFromFile(const char * pszFilename,
int bOverrideEnvVars) -> void
Load configuration from a given configuration file.
Parameters
- pszFilename: File where to load configuration from.
- bOverrideEnvVars: Whether configuration options from the configuration file should override environment variables.
GDAL.cplloadconfigoptionsfrompredefinedfiles
— MethodCPLLoadConfigOptionsFromPredefinedFiles() -> void
Load configuration from a set of predefined files.
GDAL.cpllockfile
— MethodCPLLockFile(const char * pszPath,
double dfWaitInSeconds) -> void *
GDAL.cpllocksetdebugperf
— MethodCPLLockSetDebugPerf(CPLLock *,
int bEnableIn) -> void
GDAL.cplmalloc
— MethodCPLMalloc(size_t nSize) -> void *
Safe version of malloc().
Parameters
- nSize: size (in bytes) of memory block to allocate.
Returns
pointer to newly allocated memory, only NULL if nSize is zero.
GDAL.cplmovefile
— MethodCPLMoveFile(const char * pszNewPath,
const char * pszOldPath) -> int
Move a file.
GDAL.cplopenshared
— MethodCPLOpenShared(const char * pszFilename,
const char * pszAccess,
int bLargeIn) -> FILE *
Open a shared file handle.
Parameters
- pszFilename: the name of the file to open.
- pszAccess: the normal fopen()/VSIFOpen() style access string.
- bLargeIn: If TRUE VSIFOpenL() (for large files) will be used instead of VSIFOpen().
Returns
a file handle or NULL if opening fails.
GDAL.cplpackeddmstodec
— MethodCPLPackedDMSToDec(double dfPacked) -> double
Convert a packed DMS value (DDDMMMSSS.SS) into decimal degrees.
Parameters
- dfPacked: Angle in packed DMS format.
Returns
Angle in decimal degrees.
GDAL.cplparsexmlfile
— MethodCPLParseXMLFile(const char * pszFilename) -> CPLXMLNode *
Parse XML file into tree.
Parameters
- pszFilename: the file to open.
Returns
NULL on failure, or the document tree on success.
GDAL.cplparsexmlstring
— MethodCPLParseXMLString(const char * pszString) -> CPLXMLNode *
Parse an XML string into tree form.
Parameters
- pszString: the document to parse.
Returns
parsed tree or NULL on error.
GDAL.cplpopfilefinder
— MethodCPLPopFileFinder() -> CPLFileFinder
CPLPopFileFinder.
GDAL.cplpopfinderlocation
— MethodCPLPopFinderLocation() -> void
CPLPopFinderLocation.
GDAL.cplprintdouble
— MethodCPLPrintDouble(char * pszBuffer,
const char * pszFormat,
double dfValue,
const char * pszLocale) -> int
Print double value into specified string buffer.
Parameters
- pszBuffer: Pointer to the destination string buffer. Should be large enough to hold the resulting string. Note, that the string will not be NULL-terminated, so user should do this himself, if needed.
- pszFormat: Format specifier (for example, "%16.9E").
- dfValue: Numerical value to print.
- pszLocale: Unused.
Returns
Number of characters printed.
GDAL.cplprintint32
— MethodCPLPrintInt32(char * pszBuffer,
GInt32 iValue,
int nMaxLen) -> int
Print GInt32 value into specified string buffer.
Parameters
- pszBuffer: Pointer to the destination string buffer. Should be large enough to hold the resulting string. Note, that the string will not be NULL-terminated, so user should do this himself, if needed.
- iValue: Numerical value to print.
- nMaxLen: Maximum length of the resulting string. If string length is greater than nMaxLen, it will be truncated.
Returns
Number of characters printed.
GDAL.cplprintpointer
— MethodCPLPrintPointer(char * pszBuffer,
void * pValue,
int nMaxLen) -> int
Print pointer value into specified string buffer.
Parameters
- pszBuffer: Pointer to the destination string buffer. Should be large enough to hold the resulting string. Note, that the string will not be NULL-terminated, so user should do this himself, if needed.
- pValue: Pointer to ASCII encode.
- nMaxLen: Maximum length of the resulting string. If string length is greater than nMaxLen, it will be truncated.
Returns
Number of characters printed.
GDAL.cplprintstring
— MethodCPLPrintString(char * pszDest,
const char * pszSrc,
int nMaxLen) -> int
Copy the string pointed to by pszSrc, NOT including the terminating \0 character, to the array pointed to by pszDest.
Parameters
- pszDest: Pointer to the destination string buffer. Should be large enough to hold the resulting string.
- pszSrc: Pointer to the source buffer.
- nMaxLen: Maximum length of the resulting string. If string length is greater than nMaxLen, it will be truncated.
Returns
Number of characters printed.
GDAL.cplprintstringfill
— MethodCPLPrintStringFill(char * pszDest,
const char * pszSrc,
int nMaxLen) -> int
Copy the string pointed to by pszSrc, NOT including the terminating \0 character, to the array pointed to by pszDest.
Parameters
- pszDest: Pointer to the destination string buffer. Should be large enough to hold the resulting string.
- pszSrc: Pointer to the source buffer.
- nMaxLen: Maximum length of the resulting string. If string length is greater than nMaxLen, it will be truncated.
Returns
Number of characters printed.
GDAL.cplprinttime
— MethodCPLPrintTime(char * pszBuffer,
int nMaxLen,
const char * pszFormat,
const struct tm * poBrokenTime,
const char * pszLocale) -> int
Print specified time value accordingly to the format options and specified locale name.
Parameters
- pszBuffer: Pointer to the destination string buffer. Should be large enough to hold the resulting string. Note, that the string will not be NULL-terminated, so user should do this himself, if needed.
- nMaxLen: Maximum length of the resulting string. If string length is greater than nMaxLen, it will be truncated.
- pszFormat: Controls the output format. Options are the same as for strftime(3) function.
- poBrokenTime: Pointer to the broken-down time structure. May be requested with the VSIGMTime() and VSILocalTime() functions.
- pszLocale: Pointer to a character string containing locale name ("C", "POSIX", "usUS", "ruRU.KOI8-R" etc.). If NULL we will not manipulate with locale settings and current process locale will be used for printing. Be aware that it may be unsuitable to use current locale for printing time, because all names will be printed in your native language, as well as time format settings also may be adjusted differently from the C/POSIX defaults. To solve these problems this option was introduced.
Returns
Number of characters printed.
GDAL.cplprintuintbig
— MethodCPLPrintUIntBig(char * pszBuffer,
GUIntBig iValue,
int nMaxLen) -> int
Print GUIntBig value into specified string buffer.
Parameters
- pszBuffer: Pointer to the destination string buffer. Should be large enough to hold the resulting string. Note, that the string will not be NULL-terminated, so user should do this himself, if needed.
- iValue: Numerical value to print.
- nMaxLen: Maximum length of the resulting string. If string length is greater than nMaxLen, it will be truncated.
Returns
Number of characters printed.
GDAL.cplprojectrelativefilename
— MethodCPLProjectRelativeFilename(const char * pszProjectDir,
const char * pszSecondaryFilename) -> const char *
Find a file relative to a project file.
Parameters
- pszProjectDir: the directory relative to which the secondary files path should be interpreted.
- pszSecondaryFilename: the filename (potentially with path) that is to be interpreted relative to the project directory.
Returns
a composed path to the secondary file. The returned string is internal and should not be altered, freed, or depending on past the next CPL call.
GDAL.cplpushfilefinder
— MethodCPLPushFileFinder(CPLFileFinder pfnFinder) -> void
CPLPushFileFinder.
GDAL.cplpushfinderlocation
— MethodCPLPushFinderLocation(const char * pszLocation) -> void
CPLPushFinderLocation.
GDAL.cplreadline
— MethodCPLReadLine(FILE * fp) -> const char *
Simplified line reading from text file.
Parameters
- fp: file pointer opened with VSIFOpen().
Returns
pointer to an internal buffer containing a line of text read from the file or NULL if the end of file was encountered.
GDAL.cplreadline2l
— MethodCPLReadLine2L(VSILFILE * fp,
int nMaxCars,
CSLConstList papszOptions) -> const char *
Simplified line reading from text file.
Parameters
- fp: file pointer opened with VSIFOpenL().
- nMaxCars: maximum number of characters allowed, or -1 for no limit.
- papszOptions: NULL-terminated array of options. Unused for now.
Returns
pointer to an internal buffer containing a line of text read from the file or NULL if the end of file was encountered or the maximum number of characters allowed reached.
GDAL.cplreadline3l
— MethodCPLReadLine3L(VSILFILE * fp,
int nMaxCars,
int * pnBufLength,
CSLConstList papszOptions) -> const char *
Simplified line reading from text file.
Parameters
- fp: file pointer opened with VSIFOpenL().
- nMaxCars: maximum number of characters allowed, or -1 for no limit.
- papszOptions: NULL-terminated array of options. Unused for now.
- pnBufLength: size of output string (must be non-NULL)
Returns
pointer to an internal buffer containing a line of text read from the file or NULL if the end of file was encountered or the maximum number of characters allowed reached.
GDAL.cplreadlinel
— MethodCPLReadLineL(VSILFILE * fp) -> const char *
Simplified line reading from text file.
Parameters
- fp: file pointer opened with VSIFOpenL().
Returns
pointer to an internal buffer containing a line of text read from the file or NULL if the end of file was encountered.
GDAL.cplrealloc
— MethodCPLRealloc(void * pData,
size_t nNewSize) -> void *
Safe version of realloc().
Parameters
- pData: existing memory block which should be copied to the new block.
- nNewSize: new size (in bytes) of memory block to allocate.
Returns
pointer to allocated memory, only NULL if nNewSize is zero.
GDAL.cplreleaselock
— MethodCPLReleaseLock(CPLLock * psLock) -> void
GDAL.cplreleasemutex
— MethodCPLReleaseMutex(CPLMutex * hMutexIn) -> void
GDAL.cplremovexmlchild
— MethodCPLRemoveXMLChild(CPLXMLNode * psParent,
CPLXMLNode * psChild) -> int
Remove child node from parent.
Parameters
- psParent: the node to the child is attached to.
- psChild: the child to remove.
Returns
TRUE on success or FALSE if the child was not found.
GDAL.cplresetextension
— MethodCPLResetExtension(const char * pszPath,
const char * pszExt) -> const char *
Replace the extension with the provided one.
Parameters
- pszPath: the input path, this string is not altered.
- pszExt: the new extension to apply to the given path.
Returns
an altered filename with the new extension. Do not modify or free the returned string. The string may be destroyed by the next CPL call.
GDAL.cplscandouble
— MethodCPLScanDouble(const char * pszString,
int nMaxLength) -> double
Extract double from string.
Parameters
- pszString: String containing characters to be scanned. It may be terminated with a null character.
- nMaxLength: The maximum number of character to consider as part of the number. Less characters will be considered if a null character is encountered.
Returns
Double value, converted from its ASCII form.
GDAL.cplscanlong
— MethodCPLScanLong(const char * pszString,
int nMaxLength) -> long
Scan up to a maximum number of characters from a string and convert the result to a long.
Parameters
- pszString: String containing characters to be scanned. It may be terminated with a null character.
- nMaxLength: The maximum number of character to consider as part of the number. Less characters will be considered if a null character is encountered.
Returns
Long value, converted from its ASCII form.
GDAL.cplscanpointer
— MethodCPLScanPointer(const char * pszString,
int nMaxLength) -> void *
Extract pointer from string.
Parameters
- pszString: String containing characters to be scanned. It may be terminated with a null character.
- nMaxLength: The maximum number of character to consider as part of the number. Less characters will be considered if a null character is encountered.
Returns
pointer value, converted from its ASCII form.
GDAL.cplscanstring
— MethodCPLScanString(const char * pszString,
int nMaxLength,
int bTrimSpaces,
int bNormalize) -> char *
Scan up to a maximum number of characters from a given string, allocate a buffer for a new string and fill it with scanned characters.
Parameters
- pszString: String containing characters to be scanned. It may be terminated with a null character.
- nMaxLength: The maximum number of character to read. Less characters will be read if a null character is encountered.
- bTrimSpaces: If TRUE, trim ending spaces from the input string. Character considered as empty using isspace(3) function.
- bNormalize: If TRUE, replace ':' symbol with the '_'. It is needed if resulting string will be used in CPL dictionaries.
Returns
Pointer to the resulting string buffer. Caller responsible to free this buffer with CPLFree().
GDAL.cplscanuintbig
— MethodCPLScanUIntBig(const char * pszString,
int nMaxLength) -> GUIntBig
Extract big integer from string.
Parameters
- pszString: String containing characters to be scanned. It may be terminated with a null character.
- nMaxLength: The maximum number of character to consider as part of the number. Less characters will be considered if a null character is encountered.
Returns
GUIntBig value, converted from its ASCII form.
GDAL.cplscanulong
— MethodCPLScanULong(const char * pszString,
int nMaxLength) -> unsigned long
Scan up to a maximum number of characters from a string and convert the result to a unsigned long.
Parameters
- pszString: String containing characters to be scanned. It may be terminated with a null character.
- nMaxLength: The maximum number of character to consider as part of the number. Less characters will be considered if a null character is encountered.
Returns
Unsigned long value, converted from its ASCII form.
GDAL.cplsearchxmlnode
— MethodCPLSearchXMLNode(CPLXMLNode * psRoot,
const char * pszElement) -> CPLXMLNode *
Search for a node in document.
Parameters
- psRoot: the subtree to search. This should be a node of type CXT_Element. NULL is safe.
- pszElement: the name of the element or attribute to search for.
Returns
The matching node or NULL on failure.
GDAL.cplserializexmltree
— MethodCPLSerializeXMLTree(const CPLXMLNode * psNode) -> char *
Convert tree into string document.
Parameters
- psNode: the node to serialize.
Returns
the document on success or NULL on failure.
GDAL.cplserializexmltreetofile
— MethodCPLSerializeXMLTreeToFile(const CPLXMLNode * psTree,
const char * pszFilename) -> int
Write document tree to a file.
Parameters
- psTree: the document tree to write.
- pszFilename: the name of the file to write to.
Returns
TRUE on success, FALSE otherwise.
GDAL.cplsetconfigoption
— MethodCPLSetConfigOption(const char * pszKey,
const char * pszValue) -> void
Set a configuration option for GDAL/OGR use.
Parameters
- pszKey: the key of the option
- pszValue: the value of the option, or NULL to clear a setting.
GDAL.cplsetconfigoptions
— MethodCPLSetConfigOptions(const char *const * papszConfigOptions) -> void
Replace the full list of configuration options with the passed list of KEY=VALUE pairs.
Parameters
- papszConfigOptions: the new list (or NULL).
GDAL.cplsetlocale
— MethodCPLsetlocale(int category,
const char * locale) -> char *
Prevents parallel executions of setlocale().
Parameters
- category: See your compiler's documentation on setlocale.
- locale: See your compiler's documentation on setlocale.
Returns
See your compiler's documentation on setlocale.
GDAL.cplsetthreadlocalconfigoption
— MethodCPLSetThreadLocalConfigOption(const char * pszKey,
const char * pszValue) -> void
Set a configuration option for GDAL/OGR use.
Parameters
- pszKey: the key of the option
- pszValue: the value of the option, or NULL to clear a setting.
GDAL.cplsetthreadlocalconfigoptions
— MethodCPLSetThreadLocalConfigOptions(const char *const * papszConfigOptions) -> void
Replace the full list of thread local configuration options with the passed list of KEY=VALUE pairs.
Parameters
- papszConfigOptions: the new list (or NULL).
GDAL.cplsettls
— MethodCPLSetTLS(int nIndex,
void * pData,
int bFreeOnExit) -> void
GDAL.cplsettlswithfreefunc
— MethodCPLSetTLSWithFreeFunc(int nIndex,
void * pData,
CPLTLSFreeFunc pfnFree) -> void
GDAL.cplsettlswithfreefuncex
— MethodCPLSetTLSWithFreeFuncEx(int nIndex,
void * pData,
CPLTLSFreeFunc pfnFree,
int * pbMemoryErrorOccurred) -> void
GDAL.cplsetxmlvalue
— MethodCPLSetXMLValue(CPLXMLNode * psRoot,
const char * pszPath,
const char * pszValue) -> int
Set element value by path.
Parameters
- psRoot: the subdocument to be updated.
- pszPath: the dot separated path to the target element/attribute.
- pszValue: the text value to assign.
Returns
TRUE on success.
GDAL.cplsleep
— MethodCPLSleep(double dfWaitInSeconds) -> void
GDAL.cplstat
— MethodCPLStat(const char * pszPath,
VSIStatBuf * psStatBuf) -> int
Same as VSIStat() except it works on "C:" as if it were "C:\".
GDAL.cplstrdup
— MethodCPLStrdup(const char * pszString) -> char *
Safe version of strdup() function.
Parameters
- pszString: input string to be duplicated. May be NULL.
Returns
pointer to a newly allocated copy of the string. Free with CPLFree() or VSIFree().
GDAL.cplstringtocomplex
— MethodCPLStringToComplex(const char * pszString,
double * pdfReal,
double * pdfImag) -> void
Fetch the real and imaginary part of a serialized complex number.
GDAL.cplstripxmlnamespace
— MethodCPLStripXMLNamespace(CPLXMLNode * psRoot,
const char * pszNamespace,
int bRecurse) -> void
Strip indicated namespaces.
Parameters
- psRoot: the document to operate on.
- pszNamespace: the name space prefix (not including colon), or NULL.
- bRecurse: TRUE to recurse over whole document, or FALSE to only operate on the passed node.
GDAL.cplstrlwr
— MethodCPLStrlwr(char * pszString) -> char *
Convert each characters of the string to lower case.
Parameters
- pszString: input string to be converted.
Returns
pointer to the same string, pszString.
GDAL.cplstrtod
— MethodCPLStrtod(const char * nptr,
char ** endptr) -> double
Converts ASCII string to floating point number.
Parameters
- nptr: Pointer to string to convert.
- endptr: If is not NULL, a pointer to the character after the last character used in the conversion is stored in the location referenced by endptr.
Returns
Converted value, if any.
GDAL.cplstrtoddelim
— MethodCPLStrtodDelim(const char * nptr,
char ** endptr,
char point) -> double
Converts ASCII string to floating point number using specified delimiter.
Parameters
- nptr: Pointer to string to convert.
- endptr: If is not NULL, a pointer to the character after the last character used in the conversion is stored in the location referenced by endptr.
- point: Decimal delimiter.
Returns
Converted value, if any.
GDAL.cplstrtodm
— MethodCPLStrtodM(const char * nptr,
char ** endptr) -> double
Converts ASCII string to floating point number.
Parameters
- nptr: Pointer to string to convert.
- endptr: If is not NULL, a pointer to the character after the last character used in the conversion is stored in the location referenced by endptr.
Returns
Converted value, if any.
GDAL.cplstrtof
— MethodCPLStrtof(const char * nptr,
char ** endptr) -> float
Converts ASCII string to floating point number.
Parameters
- nptr: Pointer to string to convert.
- endptr: If is not NULL, a pointer to the character after the last character used in the conversion is stored in the location referenced by endptr.
Returns
Converted value, if any.
GDAL.cplstrtofdelim
— MethodCPLStrtofDelim(const char * nptr,
char ** endptr,
char point) -> float
Converts ASCII string to floating point number using specified delimiter.
Parameters
- nptr: Pointer to string to convert.
- endptr: If is not NULL, a pointer to the character after the last character used in the conversion is stored in the location referenced by endptr.
- point: Decimal delimiter.
Returns
Converted value, if any.
GDAL.cplsubscribetosetconfigoption
— MethodCPLSubscribeToSetConfigOption(CPLSetConfigOptionSubscriber pfnCallback,
void * pUserData) -> int
Install a callback that will be notified of calls to CPLSetConfigOption()/ CPLSetThreadLocalConfigOption()
Parameters
- pfnCallback: Callback. Must not be NULL
- pUserData: Callback user data. May be NULL.
Returns
subscriber ID that can be used with CPLUnsubscribeToSetConfigOption()
GDAL.cplsymlink
— MethodCPLSymlink(const char * pszOldPath,
const char * pszNewPath,
CSLConstList) -> int
Create a symbolic link.
GDAL.cplturnfailureintowarning
— MethodCPLTurnFailureIntoWarning(int bOn) -> void
Whether failures should be turned into warnings.
GDAL.cplunlinktree
— MethodCPLUnlinkTree(const char * pszPath) -> int
Recursively unlink a directory.
Returns
0 on successful completion, -1 if function fails.
GDAL.cplunlockfile
— MethodCPLUnlockFile(void * hLock) -> void
GDAL.cplunsubscribetosetconfigoption
— MethodCPLUnsubscribeToSetConfigOption(int nId) -> void
Remove a subscriber installed with CPLSubscribeToSetConfigOption()
Parameters
- nId: Subscriber id returned by CPLSubscribeToSetConfigOption()
GDAL.cplvalidatexml
— MethodCPLValidateXML(const char * pszXMLFilename,
const char * pszXSDFilename,
CSLConstList papszOptions) -> int
Validate a XML file against a XML schema.
Parameters
- pszXMLFilename: the filename of the XML file to validate.
- pszXSDFilename: the filename of the XSD schema.
- papszOptions: unused for now. Set to NULL.
Returns
TRUE if the XML file validates against the XML schema.
GDAL.cplverifyconfiguration
— Methodcplverifyconfiguration()
Doxygen_Suppress
GDAL.cplvirtualmemdeclarethread
— Methodcplvirtualmemdeclarethread(ctxt)
Declare that a thread will access a virtual memory mapping.
This function must be called by a thread that wants to access the content of a virtual memory mapping, except if the virtual memory mapping has been created with bSingleThreadUsage = TRUE
.
This function must be paired with CPLVirtualMemUnDeclareThread
().
\since GDAL 1.11
Arguments
ctxt
: context returned byCPLVirtualMemNew
().
GDAL.cplvirtualmemderivednew
— Methodcplvirtualmemderivednew(pVMemBase, nOffset, nSize, pfnFreeUserData, pCbkUserData)
Create a new virtual memory mapping derived from an other virtual memory mapping.
This may be useful in case of creating mapping for pixel interleaved data.
The new mapping takes a reference on the base mapping.
\since GDAL 1.11
Arguments
pVMemBase
: Base virtual memory mappingnOffset
: Offset in the base virtual memory mapping from which to start the new mapping.nSize
: Size of the base virtual memory mapping to expose in the the new mapping.pfnFreeUserData
: callback that is called when the object is destroyed.pCbkUserData
: user data passed to pfnFreeUserData.
Returns
a virtual memory object that must be freed by CPLVirtualMemFree
(), or NULL in case of failure.
GDAL.cplvirtualmemfilemapnew
— Methodcplvirtualmemfilemapnew(fp, nOffset, nLength, eAccessMode, pfnFreeUserData, pCbkUserData)
Create a new virtual memory mapping from a file.
The file must be a "real" file recognized by the operating system, and not a VSI extended virtual file.
In VIRTUALMEM_READWRITE mode, updates to the memory mapping will be written in the file.
On Linux AMD64 platforms, the maximum value for nLength is 128 TB. On Linux x86 platforms, the maximum value for nLength is 2 GB.
Supported on Linux only in GDAL <= 2.0, and all POSIX systems supporting mmap() in GDAL >= 2.1
\since GDAL 1.11
Arguments
fp
: Virtual file handle.nOffset
: Offset in the file to start the mapping from.nLength
: Length of the portion of the file to map into memory.eAccessMode
: Permission to use for the virtual memory mapping. This must be consistent with how the file has been opened.pfnFreeUserData
: callback that is called when the object is destroyed.pCbkUserData
: user data passed to pfnFreeUserData.
Returns
a virtual memory object that must be freed by CPLVirtualMemFree
(), or NULL in case of failure.
GDAL.cplvirtualmemfree
— Methodcplvirtualmemfree(ctxt)
Free a virtual memory mapping.
The pointer returned by CPLVirtualMemGetAddr
() will no longer be valid. If the virtual memory mapping was created with read/write permissions and that they are dirty (i.e. modified) pages, they will be flushed through the pfnUnCachePage callback before being freed.
\since GDAL 1.11
Arguments
ctxt
: context returned byCPLVirtualMemNew
().
GDAL.cplvirtualmemgetaccessmode
— Methodcplvirtualmemgetaccessmode(ctxt)
Return the access mode of the virtual memory mapping.
\since GDAL 1.11
Arguments
ctxt
: context returned byCPLVirtualMemNew
().
Returns
the access mode of the virtual memory mapping.
GDAL.cplvirtualmemgetaddr
— Methodcplvirtualmemgetaddr(ctxt)
Return the pointer to the start of a virtual memory mapping.
The bytes in the range [p:p+CPLVirtualMemGetSize
()-1] where p is the pointer returned by this function will be valid, until CPLVirtualMemFree
() is called.
Note that if a range of bytes used as an argument of a system call (such as read() or write()) contains pages that have not been "realized", the system call will fail with EFAULT. CPLVirtualMemPin
() can be used to work around this issue.
\since GDAL 1.11
Arguments
ctxt
: context returned byCPLVirtualMemNew
().
Returns
the pointer to the start of a virtual memory mapping.
GDAL.cplvirtualmemgetpagesize
— Methodcplvirtualmemgetpagesize(ctxt)
Return the page size associated to a virtual memory mapping.
The value returned will be at least CPLGetPageSize
(), but potentially larger.
\since GDAL 1.11
Arguments
ctxt
: context returned byCPLVirtualMemNew
().
Returns
the page size
GDAL.cplvirtualmemgetsize
— Methodcplvirtualmemgetsize(ctxt)
Return the size of the virtual memory mapping.
\since GDAL 1.11
Arguments
ctxt
: context returned byCPLVirtualMemNew
().
Returns
the size of the virtual memory mapping.
GDAL.cplvirtualmemisaccessthreadsafe
— Methodcplvirtualmemisaccessthreadsafe(ctxt)
Return TRUE
if this memory mapping can be accessed safely from concurrent threads.
The situation that can cause problems is when several threads try to access a page of the mapping that is not yet mapped.
The return value of this function depends on whether bSingleThreadUsage has been set of not in CPLVirtualMemNew
() and/or the implementation.
On Linux, this will always return TRUE
if bSingleThreadUsage = FALSE
.
\since GDAL 1.11
Arguments
ctxt
: context returned byCPLVirtualMemNew
().
Returns
TRUE
if this memory mapping can be accessed safely from concurrent threads.
GDAL.cplvirtualmemisfilemapping
— Methodcplvirtualmemisfilemapping(ctxt)
Return if the virtual memory mapping is a direct file mapping.
\since GDAL 1.11
Arguments
ctxt
: context returned byCPLVirtualMemNew
().
Returns
TRUE
if the virtual memory mapping is a direct file mapping.
GDAL.cplvirtualmemmanagerterminate
— Methodcplvirtualmemmanagerterminate()
Cleanup any resource and handlers related to virtual memory.
This function must be called after the last CPLVirtualMem
object has been freed.
\since GDAL 2.0
GDAL.cplvirtualmemnew
— Methodcplvirtualmemnew(nSize, nCacheSize, nPageSizeHint, bSingleThreadUsage, eAccessMode, pfnCachePage, pfnUnCachePage, pfnFreeUserData, pCbkUserData)
Create a new virtual memory mapping.
This will reserve an area of virtual memory of size nSize, whose size might be potentially much larger than the physical memory available. Initially, no physical memory will be allocated. As soon as memory pages will be accessed, they will be allocated transparently and filled with the pfnCachePage callback. When the allowed cache size is reached, the least recently used pages will be unallocated.
On Linux AMD64 platforms, the maximum value for nSize is 128 TB. On Linux x86 platforms, the maximum value for nSize is 2 GB.
Only supported on Linux for now.
Note that on Linux, this function will install a SIGSEGV handler. The original handler will be restored by CPLVirtualMemManagerTerminate
().
\since GDAL 1.11
Arguments
nSize
: size in bytes of the virtual memory mapping.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 byCPLGetPageSize
(). Minimum value is generally 4096. Might be set to 0 to let the function determine a default page size.bSingleThreadUsage
: set toTRUE
if there will be no concurrent threads that will access the virtual memory mapping. This can optimize performance a bit.eAccessMode
: permission to use for the virtual memory mapping.pfnCachePage
: callback triggered when a still unmapped page of virtual memory is accessed. The callback has the responsibility of filling the page with relevant values.pfnUnCachePage
: callback triggered when a dirty mapped page is going to be freed (saturation of cache, or termination of the virtual memory mapping). Might be NULL.pfnFreeUserData
: callback that can be used to free pCbkUserData. Might be NULLpCbkUserData
: user data passed to pfnCachePage and pfnUnCachePage.
Returns
a virtual memory object that must be freed by CPLVirtualMemFree
(), or NULL in case of failure.
GDAL.cplvirtualmempin
— Methodcplvirtualmempin(ctxt, pAddr, nSize, bWriteOp)
Make sure that a region of virtual memory will be realized.
Calling this function is not required, but might be useful when debugging a process with tools like gdb or valgrind that do not naturally like segmentation fault signals.
It is also needed when wanting to provide part of virtual memory mapping to a system call such as read() or write(). If read() or write() is called on a memory region not yet realized, the call will fail with EFAULT.
\since GDAL 1.11
Arguments
ctxt
: context returned byCPLVirtualMemNew
().pAddr
: the memory region to pin.nSize
: the size of the memory region.bWriteOp
: set toTRUE
if the memory are will be accessed in write mode.
GDAL.cplvirtualmemundeclarethread
— Methodcplvirtualmemundeclarethread(ctxt)
Declare that a thread will stop accessing a virtual memory mapping.
This function must be called by a thread that will no longer access the content of a virtual memory mapping, except if the virtual memory mapping has been created with bSingleThreadUsage = TRUE
.
This function must be paired with CPLVirtualMemDeclareThread
().
\since GDAL 1.11
Arguments
ctxt
: context returned byCPLVirtualMemNew
().
GDAL.cplwritefileinzip
— MethodCPLWriteFileInZip(void *,
const void *,
int) -> CPLErr
GDAL.cplxmlnodegetramusageestimate
— MethodCPLXMLNodeGetRAMUsageEstimate(const CPLXMLNode * psNode,
bool bVisitSiblings) -> size_t
GDAL.cplzlibdeflate
— MethodCPLZLibDeflate(const void *,
size_t,
int,
void *,
size_t,
size_t * pnOutBytes) -> void *
GDAL.cplzlibinflate
— MethodCPLZLibInflate(const void *,
size_t,
void *,
size_t,
size_t * pnOutBytes) -> void *
GDAL.cplzlibinflateex
— MethodCPLZLibInflateEx(const void * ptr,
size_t nBytes,
void * outptr,
size_t nOutAvailableBytes,
bool bAllowResizeOutptr,
size_t * pnOutBytes) -> void *
Uncompress a buffer compressed with ZLib compression.
Parameters
- ptr: input buffer.
- nBytes: size of input buffer in bytes.
- outptr: output buffer, or NULL to let the function allocate it.
- nOutAvailableBytes: size of output buffer if provided, or ignored.
- bAllowResizeOutptr: whether the function is allowed to grow outptr (using VSIRealloc) if its initial capacity provided by nOutAvailableBytes is not large enough. Ignored if outptr is NULL.
- pnOutBytes: pointer to a size_t, where to store the size of the output buffer.
Returns
the output buffer (to be freed with VSIFree() if not provided) or NULL in case of error. If bAllowResizeOutptr is set to true, only the returned pointer should be freed by the caller, as outptr might have been reallocated or freed.
GDAL.gdal_cg_create
— MethodGDAL_CG_Create(int nWidth,
int nHeight,
int bNoDataSet,
double dfNoDataValue,
double dfContourInterval,
double dfContourBase,
GDALContourWriter pfnWriter,
void * pCBData) -> GDALContourGeneratorH
Create contour generator.
GDAL.gdal_cg_destroy
— MethodGDAL_CG_Destroy(GDALContourGeneratorH hCG) -> void
Destroy contour generator.
GDAL.gdal_cg_feedline
— MethodGDAL_CG_FeedLine(GDALContourGeneratorH hCG,
double * padfScanline) -> CPLErr
Feed a line to the contour generator.
GDAL.gdaladdband
— MethodGDALAddBand(GDALDatasetH hDataset,
GDALDataType eType,
CSLConstList papszOptions) -> CPLErr
Add a band to a dataset.
GDAL.gdaladdderivedbandpixelfunc
— MethodGDALAddDerivedBandPixelFunc(const char * pszName,
GDALDerivedPixelFunc pfnNewFunction) -> CPLErr
This adds a pixel function to the global list of available pixel functions for derived bands.
Parameters
- pszName: 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.
Returns
CE_None, invalid (NULL) parameters are currently ignored.
GDAL.gdaladdderivedbandpixelfuncwithargs
— MethodGDALAddDerivedBandPixelFuncWithArgs(const char * pszName,
GDALDerivedPixelFuncWithArgs pfnNewFunction,
const char * pszMetadata) -> CPLErr
This adds a pixel function to the global list of available pixel functions for derived bands.
Parameters
- pszName: 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.
- pszMetadata: Pixel function metadata (not currently implemented)
Returns
CE_None, invalid (NULL) parameters are currently ignored.
GDAL.gdaladjustvaluetodatatype
— MethodGDALAdjustValueToDataType(GDALDataType eDT,
double dfValue,
int * pbClamped,
int * pbRounded) -> double
Adjust a value to the output data type.
Parameters
- eDT: target data type.
- dfValue: value to adjust.
- pbClamped: pointer to a integer(boolean) to indicate if clamping has been made, or NULL
- pbRounded: pointer to a integer(boolean) to indicate if rounding has been made, or NULL
Returns
adjusted value
GDAL.gdalallregister
— MethodGDALAllRegister() -> void
Register all known configured GDAL drivers.
GDAL.gdalapplygeotransform
— MethodGDALApplyGeoTransform(const double * padfGeoTransform,
double dfPixel,
double dfLine,
double * pdfGeoX,
double * pdfGeoY) -> void
Apply GeoTransform to x/y coordinate.
Parameters
- 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.
GDAL.gdalapplyverticalshiftgrid
— Methodgdalapplyverticalshiftgrid(hSrcDataset, hGridDataset, bInverse, dfSrcUnitToMeter, dfDstUnitToMeter, papszOptions)
GDAL.gdalapproxtransform
— MethodGDALApproxTransform(void * pCBData,
int bDstToSrc,
int nPoints,
double * x,
double * y,
double * z,
int * panSuccess) -> int
Perform approximate transformation.
GDAL.gdalapproxtransformerownssubtransformer
— MethodGDALApproxTransformerOwnsSubtransformer(void * pCBData,
int bOwnFlag) -> void
Set bOwnSubtransformer flag.
GDAL.gdalargetnextupdatedregion
— MethodGDALARGetNextUpdatedRegion(GDALAsyncReaderH hARIO,
double dfTimeout,
int * pnBufXOff,
int * pnBufYOff,
int * pnBufXSize,
int * pnBufYSize) -> GDALAsyncStatusType
Get async IO update.
Parameters
- hARIO: handle to the async reader.
- dfTimeout: the number of seconds to wait for additional updates. Use -1 to wait indefinitely, or zero to not wait at all if there is no data available.
- pnBufXOff: location to return the X offset of the area of the request buffer that has been updated.
- pnBufYOff: location to return the Y offset of the area of the request buffer that has been updated.
- pnBufXSize: location to return the X size of the area of the request buffer that has been updated.
- pnBufYSize: location to return the Y size of the area of the request buffer that has been updated.
Returns
GARIO_ status, details described above.
GDAL.gdalarlockbuffer
— MethodGDALARLockBuffer(GDALAsyncReaderH hARIO,
double dfTimeout) -> int
Lock image buffer.
Parameters
- hARIO: handle to async reader.
- dfTimeout: the time in seconds to wait attempting to lock the buffer. -1.0 to wait indefinitely and 0 to not wait at all if it can't be acquired immediately. Default is -1.0 (infinite wait).
Returns
TRUE if successful, or FALSE on an error.
GDAL.gdalarunlockbuffer
— MethodGDALARUnlockBuffer(GDALAsyncReaderH hARIO) -> void
Unlock image buffer.
Parameters
- hARIO: handle to async reader.
GDAL.gdalattributefreerawresult
— MethodGDALAttributeFreeRawResult(GDALAttributeH hAttr,
GByte * raw,
size_t nSize) -> void
Free the return of GDALAttributeAsRaw()
GDAL.gdalattributegetdatatype
— MethodGDALAttributeGetDataType(GDALAttributeH hAttr) -> GDALExtendedDataTypeH
Return the data type.
GDAL.gdalattributegetdimensioncount
— MethodGDALAttributeGetDimensionCount(GDALAttributeH hAttr) -> size_t
Return the number of dimensions.
GDAL.gdalattributegetdimensionssize
— MethodGDALAttributeGetDimensionsSize(GDALAttributeH hAttr,
size_t * pnCount) -> GUInt64 *
Return the dimension sizes of the attribute.
Parameters
- hAttr: Attribute.
- pnCount: Pointer to the number of values returned. Must NOT be NULL.
Returns
an array of *pnCount values.
GDAL.gdalattributegetfullname
— MethodGDALAttributeGetFullName(GDALAttributeH hAttr) -> const char *
Return the full name of the attribute.
GDAL.gdalattributegetname
— MethodGDALAttributeGetName(GDALAttributeH hAttr) -> const char *
Return the name of the attribute.
GDAL.gdalattributegettotalelementscount
— MethodGDALAttributeGetTotalElementsCount(GDALAttributeH hAttr) -> GUInt64
Return the total number of values in the attribute.
GDAL.gdalattributereadasdouble
— MethodGDALAttributeReadAsDouble(GDALAttributeH hAttr) -> double
Return the value of an attribute as a double.
Returns
a double value.
GDAL.gdalattributereadasdoublearray
— MethodGDALAttributeReadAsDoubleArray(GDALAttributeH hAttr,
size_t * pnCount) -> double *
Return the value of an attribute as an array of doubles.
Parameters
- hAttr: Attribute
- pnCount: Pointer to the number of values returned. Must NOT be NULL.
Returns
array to be freed with CPLFree(), or nullptr.
GDAL.gdalattributereadasint
— MethodGDALAttributeReadAsInt(GDALAttributeH hAttr) -> int
Return the value of an attribute as a integer.
Returns
a integer, or INT_MIN in case of error.
GDAL.gdalattributereadasintarray
— MethodGDALAttributeReadAsIntArray(GDALAttributeH hAttr,
size_t * pnCount) -> int *
Return the value of an attribute as an array of integers.
Parameters
- hAttr: Attribute
- pnCount: Pointer to the number of values returned. Must NOT be NULL.
Returns
array to be freed with CPLFree(), or nullptr.
GDAL.gdalattributereadasraw
— MethodGDALAttributeReadAsRaw(GDALAttributeH hAttr,
size_t * pnSize) -> GByte *
Return the raw value of an attribute.
Parameters
- hAttr: Attribute.
- pnSize: Pointer to the number of bytes returned. Must NOT be NULL.
Returns
a buffer of *pnSize bytes.
GDAL.gdalattributereadasstring
— MethodGDALAttributeReadAsString(GDALAttributeH hAttr) -> const char *
Return the value of an attribute as a string.
Returns
a string, or nullptr.
GDAL.gdalattributereadasstringarray
— MethodGDALAttributeReadAsStringArray(GDALAttributeH hAttr) -> char **
Return the value of an attribute as an array of strings.
GDAL.gdalattributerelease
— MethodGDALAttributeRelease(GDALAttributeH hAttr) -> void
Release the GDAL in-memory object associated with a GDALAttribute.
GDAL.gdalattributerename
— MethodGDALAttributeRename(GDALAttributeH hAttr,
const char * pszNewName) -> bool
Rename the attribute.
Returns
true in case of success
GDAL.gdalattributewritedouble
— MethodGDALAttributeWriteDouble(GDALAttributeH hAttr,
double dfVal) -> int
Write an attribute from a double value.
Parameters
- hAttr: Attribute
- dfVal: Value.
Returns
TRUE in case of success.
GDAL.gdalattributewritedoublearray
— MethodGDALAttributeWriteDoubleArray(GDALAttributeH hAttr,
const double * padfValues,
size_t nCount) -> int
Write an attribute from an array of double.
Parameters
- hAttr: Attribute
- padfValues: Array of double.
- nCount: Should be equal to GetTotalElementsCount().
Returns
TRUE in case of success.
GDAL.gdalattributewriteint
— MethodGDALAttributeWriteInt(GDALAttributeH hAttr,
int nVal) -> int
Write an attribute from a integer value.
Parameters
- hAttr: Attribute
- nVal: Value.
Returns
TRUE in case of success.
GDAL.gdalattributewriteraw
— MethodGDALAttributeWriteRaw(GDALAttributeH hAttr,
const void * pabyValue,
size_t nLength) -> int
Write an attribute from raw values expressed in GetDataType()
Parameters
- hAttr: Attribute
- pabyValue: Buffer of nLen bytes.
- nLength: Size of pabyValue in bytes. Should be equal to GetTotalElementsCount() * GetDataType().GetSize()
Returns
TRUE in case of success.
GDAL.gdalattributewritestring
— MethodGDALAttributeWriteString(GDALAttributeH hAttr,
const char * pszVal) -> int
Write an attribute from a string value.
Parameters
- hAttr: Attribute
- pszVal: Pointer to a string.
Returns
TRUE in case of success.
GDAL.gdalattributewritestringarray
— MethodGDALAttributeWriteStringArray(GDALAttributeH hAttr,
CSLConstList papszValues) -> int
Write an attribute from an array of strings.
Parameters
- hAttr: Attribute
- papszValues: Array of strings.
Returns
TRUE in case of success.
GDAL.gdalautocreatewarpedvrt
— Methodgdalautocreatewarpedvrt(hSrcDS, pszSrcWKT, pszDstWKT, eResampleAlg, dfMaxError, psOptions)
GDAL.gdalautocreatewarpedvrtex
— MethodGDALAutoCreateWarpedVRTEx(GDALDatasetH hSrcDS,
const char * pszSrcWKT,
const char * pszDstWKT,
GDALResampleAlg eResampleAlg,
double dfMaxError,
const GDALWarpOptions * psOptionsIn,
CSLConstList papszTransformerOptions) -> GDALDatasetH
Create virtual warped dataset automatically.
GDAL.gdalbeginasyncreader
— MethodGDALBeginAsyncReader(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,
CSLConstList papszOptions) -> GDALAsyncReaderH
Sets up an asynchronous data request.
Parameters
- hDS: handle to the dataset object.
- 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.
- pBuf: The buffer into which the data should be read. This buffer must contain at least nBufXSize * nBufYSize * nBandCount words of type eBufType. It is organized in left to right,top to bottom pixel order. Spacing is controlled by the nPixelSpace, and nLineSpace parameters.
- 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 pData 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 pData 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 pData to the start of the next. If defaulted 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 (zero) the value will be nLineSpace * nBufYSize implying band sequential organization of the data buffer.
- papszOptions: Driver specific control options in a string list or NULL. Consult driver documentation for options supported.
Returns
handle representing the request.
GDAL.gdalbuildoverviews
— MethodGDALBuildOverviews(GDALDatasetH hDataset,
const char * pszResampling,
int nOverviews,
const int * panOverviewList,
int nListBands,
const int * panBandList,
GDALProgressFunc pfnProgress,
void * pProgressData) -> CPLErr
Build raster overview(s)
GDAL.gdalbuildoverviewsex
— MethodGDALBuildOverviewsEx(GDALDatasetH hDataset,
const char * pszResampling,
int nOverviews,
const int * panOverviewList,
int nListBands,
const int * panBandList,
GDALProgressFunc pfnProgress,
void * pProgressData,
CSLConstList papszOptions) -> CPLErr
Build raster overview(s)
GDAL.gdalbuildvrt
— MethodGDALBuildVRT(const char * pszDest,
int nSrcCount,
GDALDatasetH * pahSrcDS,
const char *const * papszSrcDSNames,
const GDALBuildVRTOptions * psOptionsIn,
int * pbUsageError) -> GDALDatasetH
Build a VRT from a list of datasets.
Parameters
- pszDest: the destination dataset path.
- nSrcCount: the number of input datasets.
- pahSrcDS: the list of input datasets (or NULL, exclusive with papszSrcDSNames). For practical purposes, the type of this argument should be considered as "const GDALDatasetH* const*", that is neither the array nor its values are mutated by this function.
- papszSrcDSNames: the list of input dataset names (or NULL, exclusive with pahSrcDS)
- psOptionsIn: the options struct returned by GDALBuildVRTOptionsNew() or NULL.
- pbUsageError: pointer to a integer output variable to store if any usage error has occurred.
Returns
the output dataset (new dataset that must be closed using GDALClose()) or NULL in case of error. If using pahSrcDS, the returned VRT dataset has a reference to each pahSrcDS[] element. Hence pahSrcDS[] elements should be closed after the returned dataset if using GDALClose(). A safer alternative is to use GDALReleaseDataset() instead of using GDALClose(), in which case you can close datasets in any order.
GDAL.gdalbuildvrtoptionsfree
— MethodGDALBuildVRTOptionsFree(GDALBuildVRTOptions * psOptions) -> void
Frees the GDALBuildVRTOptions struct.
Parameters
- psOptions: the options struct for GDALBuildVRT().
GDAL.gdalbuildvrtoptionsnew
— MethodGDALBuildVRTOptionsNew(char ** papszArgv,
GDALBuildVRTOptionsForBinary * psOptionsForBinary) -> GDALBuildVRTOptions *
Allocates a GDALBuildVRTOptions struct.
Parameters
- papszArgv: NULL terminated list of options (potentially including filename and open options too), or NULL. The accepted options are the ones of the gdalbuildvrt utility.
- psOptionsForBinary: (output) may be NULL (and should generally be NULL), otherwise (gdalbuildvrt_bin.cpp use case) must be allocated with GDALBuildVRTOptionsForBinaryNew() prior to this function. Will be filled with potentially present filename, open options,...
Returns
pointer to the allocated GDALBuildVRTOptions struct. Must be freed with GDALBuildVRTOptionsFree().
GDAL.gdalbuildvrtoptionssetprogress
— MethodGDALBuildVRTOptionsSetProgress(GDALBuildVRTOptions * psOptions,
GDALProgressFunc pfnProgress,
void * pProgressData) -> void
Set a progress function.
Parameters
- psOptions: the options struct for GDALBuildVRT().
- pfnProgress: the progress callback.
- pProgressData: the user data for the progress callback.
GDAL.gdalchecksumimage
— MethodGDALChecksumImage(GDALRasterBandH hBand,
int nXOff,
int nYOff,
int nXSize,
int nYSize) -> int
Compute checksum for image region.
Parameters
- hBand: the raster band to read from.
- nXOff: pixel offset of window to read.
- nYOff: line offset of window to read.
- nXSize: pixel size of window to read.
- nYSize: line size of window to read.
Returns
Checksum value, or -1 in case of error (starting with GDAL 3.6)
GDAL.gdalcheckversion
— Methodgdalcheckversion(nVersionMajor, nVersionMinor, 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 primarily indented for external plugins.
Arguments
nVersionMajor
: Major version to be tested againstnVersionMinor
: Minor version to be tested againstpszCallingComponentName
: If not NULL, in case of version mismatch, the method will issue a failure mentioning the name of the calling component.
GDAL.gdalchunkandwarpimage
— MethodGDALChunkAndWarpImage(GDALWarpOperationH hOperation,
int nDstXOff,
int nDstYOff,
int nDstXSize,
int nDstYSize) -> CPLErr
GDAL.gdalchunkandwarpmulti
— MethodGDALChunkAndWarpMulti(GDALWarpOperationH hOperation,
int nDstXOff,
int nDstYOff,
int nDstXSize,
int nDstYSize) -> CPLErr
GDAL.gdalclonecolortable
— MethodGDALCloneColorTable(GDALColorTableH hTable) -> GDALColorTableH
Make a copy of a color table.
GDAL.gdalclonewarpoptions
— MethodGDALCloneWarpOptions(const GDALWarpOptions * psSrcOptions) -> GDALWarpOptions *
Clone a warp options structure.
GDAL.gdalclose
— MethodGDALClose(GDALDatasetH hDS) -> CPLErr
Close GDAL dataset.
Parameters
- hDS: The dataset to close. May be cast from a "GDALDataset *".
Returns
CENone in case of success (return value since GDAL 3.7). On a shared dataset whose reference count is not dropped below 1, CENone will be returned.
GDAL.gdalcomposegeotransforms
— MethodGDALComposeGeoTransforms(const double * padfGT1,
const double * padfGT2,
double * padfGTOut) -> void
Compose two geotransforms.
Parameters
- 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.
GDAL.gdalcomputebandstats
— MethodGDALComputeBandStats(GDALRasterBandH hSrcBand,
int nSampleStep,
double * pdfMean,
double * pdfStdDev,
GDALProgressFunc pfnProgress,
void * pProgressData) -> CPLErr
Undocumented.
Parameters
- hSrcBand: undocumented.
- nSampleStep: Step between scanlines used to compute statistics. When nSampleStep is equal to 1, all scanlines will be processed.
- pdfMean: undocumented.
- pdfStdDev: undocumented.
- pfnProgress: undocumented.
- pProgressData: undocumented.
Returns
undocumented
GDAL.gdalcomputematchingpoints
— MethodGDALComputeMatchingPoints(GDALDatasetH hFirstImage,
GDALDatasetH hSecondImage,
char ** papszOptions,
int * pnGCPCount) -> GDAL_GCP *
GDALComputeMatchingPoints.
GDAL.gdalcomputemediancutpct
— MethodGDALComputeMedianCutPCT(GDALRasterBandH hRed,
GDALRasterBandH hGreen,
GDALRasterBandH hBlue,
int(*)(int, int, void *) pfnIncludePixel,
int nColors,
GDALColorTableH hColorTable,
GDALProgressFunc pfnProgress,
void * pProgressArg) -> int
Compute optimal PCT for RGB image.
Parameters
- hRed: Red input band.
- hGreen: Green input band.
- hBlue: Blue input band.
- pfnIncludePixel: function used to test which pixels should be included in the analysis. At this time this argument is ignored and all pixels are utilized. This should normally be NULL.
- nColors: the desired number of colors to be returned (2-256).
- hColorTable: the colors will be returned in this color table object.
- pfnProgress: callback for reporting algorithm progress matching the GDALProgressFunc() semantics. May be NULL.
- pProgressArg: callback argument passed to pfnProgress.
Returns
returns CENone on success or CEFailure if an error occurs.
GDAL.gdalcomputeproximity
— MethodGDALComputeProximity(GDALRasterBandH hSrcBand,
GDALRasterBandH hProximityBand,
char ** papszOptions,
GDALProgressFunc pfnProgress,
void * pProgressArg) -> CPLErr
Compute the proximity of all pixels in the image to a set of pixels in the source image.
GDAL.gdalcomputerasterminmax
— MethodGDALComputeRasterMinMax(GDALRasterBandH hBand,
int bApproxOK,
double adfMinMax) -> CPLErr
Compute the min/max values for a band.
GDAL.gdalcomputerasterstatistics
— MethodGDALComputeRasterStatistics(GDALRasterBandH hBand,
int bApproxOK,
double * pdfMin,
double * pdfMax,
double * pdfMean,
double * pdfStdDev,
GDALProgressFunc pfnProgress,
void * pProgressData) -> CPLErr
Compute image statistics.
GDAL.gdalcontourgenerate
— Methodgdalcontourgenerate(hBand, dfContourInterval, dfContourBase, nFixedLevelCount, padfFixedLevels, bUseNoData, dfNoDataValue, hLayer, iIDField, iElevField, pfnProgress, pProgressArg)
GDAL.gdalcontourgenerateex
— MethodGDALContourGenerateEx(GDALRasterBandH hBand,
void * hLayer,
CSLConstList options,
GDALProgressFunc pfnProgress,
void * pProgressArg) -> CPLErr
Create vector contours from raster DEM.
Parameters
- hBand: The band to read raster data from. The whole band will be processed.
- hLayer: The layer to which new contour vectors will be written. Each contour will have a LINESTRING geometry attached to it (or POLYGON if POLYGONIZE=YES). This is really of type OGRLayerH, but void * is used to avoid pulling the ogr_api.h file in here.
- pfnProgress: A GDALProgressFunc that may be used to report progress to the user, or to interrupt the algorithm. May be NULL if not required.
- pProgressArg: The callback data for the pfnProgress function.
- options: List of options
Returns
CENone on success or CEFailure if an error occurs.
GDAL.gdalcopybits
— MethodGDALCopyBits(const GByte * pabySrcData,
int nSrcOffset,
int nSrcStep,
GByte * pabyDstData,
int nDstOffset,
int nDstStep,
int nBitCount,
int nStepCount) -> void
Bitwise word copying.
Parameters
- 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.
GDAL.gdalcopydatasetfiles
— MethodGDALCopyDatasetFiles(GDALDriverH hDriver,
const char * pszNewName,
const char * pszOldName) -> CPLErr
Copy the files of a dataset.
GDAL.gdalcopywords
— MethodGDALCopyWords(const void * pSrcData,
GDALDataType eSrcType,
int nSrcPixelStride,
void * pDstData,
GDALDataType eDstType,
int nDstPixelStride,
int nWordCount) -> void
Copy pixel words from buffer to buffer.
GDAL.gdalcopywords64
— MethodGDALCopyWords64(const void * pSrcData,
GDALDataType eSrcType,
int nSrcPixelStride,
void * pDstData,
GDALDataType eDstType,
int nDstPixelStride,
GPtrDiff_t nWordCount) -> void
Copy pixel words from buffer to buffer.
Parameters
- 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
GDAL.gdalcreate
— MethodGDALCreate(GDALDriverH hDriver,
const char * pszFilename,
int nXSize,
int nYSize,
int nBands,
GDALDataType eBandType,
CSLConstList papszOptions) -> GDALDatasetH
Create a new dataset with this driver.
GDAL.gdalcreateandreprojectimage
— MethodGDALCreateAndReprojectImage(GDALDatasetH hSrcDS,
const char * pszSrcWKT,
const char * pszDstFilename,
const char * pszDstWKT,
GDALDriverH hDstDriver,
char ** papszCreateOptions,
GDALResampleAlg eResampleAlg,
double dfWarpMemoryLimit,
double dfMaxError,
GDALProgressFunc pfnProgress,
void * pProgressArg,
GDALWarpOptions * psOptions) -> CPLErr
Reproject an image and create the target reprojected image.
GDAL.gdalcreateapproxtransformer
— MethodGDALCreateApproxTransformer(GDALTransformerFunc pfnBaseTransformer,
void * pBaseTransformArg,
double dfMaxError) -> void *
Create an approximating transformer.
Parameters
- pfnBaseTransformer: the high precision transformer which should be approximated.
- pBaseTransformArg: the callback argument for the high precision transformer.
- dfMaxError: the maximum cartesian error in the "output" space that is to be accepted in the linear approximation.
Returns
callback pointer suitable for use with GDALApproxTransform(). It should be deallocated with GDALDestroyApproxTransformer().
GDAL.gdalcreatecolorramp
— MethodGDALCreateColorRamp(GDALColorTableH hTable,
int nStartIndex,
const GDALColorEntry * psStartColor,
int nEndIndex,
const GDALColorEntry * psEndColor) -> void
Create color ramp.
GDAL.gdalcreatecolortable
— MethodGDALCreateColorTable(GDALPaletteInterp eInterp) -> GDALColorTableH
Construct a new color table.
GDAL.gdalcreatecopy
— MethodGDALCreateCopy(GDALDriverH hDriver,
const char * pszFilename,
GDALDatasetH hSrcDS,
int bStrict,
CSLConstList papszOptions,
GDALProgressFunc pfnProgress,
void * pProgressData) -> GDALDatasetH
Create a copy of a dataset.
GDAL.gdalcreatedatasetmaskband
— MethodGDALCreateDatasetMaskBand(GDALDatasetH hDS,
int nFlags) -> CPLErr
Adds a mask band to the dataset.
GDAL.gdalcreatedriver
— MethodGDALCreateDriver() -> GDALDriverH
Create a GDALDriver.
GDAL.gdalcreategcprefinetransformer
— MethodGDALCreateGCPRefineTransformer(int nGCPCount,
const GDAL_GCP * pasGCPList,
int nReqOrder,
int bReversed,
double dfTolerance,
int nMinimumGcps) -> void *
Create GCP based polynomial transformer, with a tolerance threshold to discard GCPs that transform badly.
GDAL.gdalcreategcptransformer
— MethodGDALCreateGCPTransformer(int nGCPCount,
const GDAL_GCP * pasGCPList,
int nReqOrder,
int bReversed) -> void *
Create GCP based polynomial transformer.
Parameters
- nGCPCount: the number of GCPs in pasGCPList.
- pasGCPList: an array of GCPs to be used as input.
- nReqOrder: the requested polynomial order. It should be 1, 2 or 3. Using 3 is not recommended due to potential numeric instabilities issues.
- bReversed: set it to TRUE to compute the reversed transformation.
Returns
the transform argument or nullptr if creation fails.
GDAL.gdalcreategenimgprojtransformer
— Methodgdalcreategenimgprojtransformer(hSrcDS, pszSrcWKT, hDstDS, pszDstWKT, bGCPUseOK, dfGCPErrorThreshold, nOrder)
GDAL.gdalcreategenimgprojtransformer2
— MethodGDALCreateGenImgProjTransformer2(GDALDatasetH hSrcDS,
GDALDatasetH hDstDS,
char ** papszOptions) -> void *
Create image to image transformer.
Parameters
- hSrcDS: source dataset, or NULL.
- hDstDS: destination dataset (or NULL).
- papszOptions: NULL-terminated list of string options (or NULL).
Returns
handle suitable for use GDALGenImgProjTransform(), and to be deallocated with GDALDestroyGenImgProjTransformer() or NULL on failure.
GDAL.gdalcreategenimgprojtransformer3
— MethodGDALCreateGenImgProjTransformer3(const char * pszSrcWKT,
const double * padfSrcGeoTransform,
const char * pszDstWKT,
const double * padfDstGeoTransform) -> void *
Create image to image transformer.
Parameters
- pszSrcWKT: source WKT (or NULL).
- padfSrcGeoTransform: source geotransform (or NULL).
- pszDstWKT: destination WKT (or NULL).
- padfDstGeoTransform: destination geotransform (or NULL).
Returns
handle suitable for use GDALGenImgProjTransform(), and to be deallocated with GDALDestroyGenImgProjTransformer() or NULL on failure.
GDAL.gdalcreategenimgprojtransformer4
— MethodGDALCreateGenImgProjTransformer4(OGRSpatialReferenceH hSrcSRS,
const double * padfSrcGeoTransform,
OGRSpatialReferenceH hDstSRS,
const double * padfDstGeoTransform,
const char *const * papszOptions) -> void *
Create image to image transformer.
GDAL.gdalcreategeoloctransformer
— MethodGDALCreateGeoLocTransformer(GDALDatasetH hBaseDS,
char ** papszGeolocationInfo,
int bReversed) -> void *
Create GeoLocation transformer.
GDAL.gdalcreatemaskband
— MethodGDALCreateMaskBand(GDALRasterBandH hBand,
int nFlags) -> CPLErr
Adds a mask band to the current band.
GDAL.gdalcreatemultidimensional
— MethodGDALCreateMultiDimensional(GDALDriverH hDriver,
const char * pszName,
CSLConstList papszRootGroupOptions,
CSLConstList papszOptions) -> GDALDatasetH
Create a new multidimensional dataset with this driver.
GDAL.gdalcreatepansharpenedvrt
— MethodGDALCreatePansharpenedVRT(const char * pszXML,
GDALRasterBandH hPanchroBand,
int nInputSpectralBands,
GDALRasterBandH * pahInputSpectralBands) -> GDALDatasetH
Create a virtual pansharpened dataset.
Parameters
- pszXML: Pansharpened VRT XML where <SpectralBand> elements have no explicit SourceFilename and SourceBand. The spectral bands in the XML will be assigned the successive values of the pahInputSpectralBands array. Must not be NULL.
- hPanchroBand: Panchromatic band. Must not be NULL.
- nInputSpectralBands: Number of input spectral bands. Must be greater than zero.
- pahInputSpectralBands: Array of nInputSpectralBands spectral bands.
Returns
NULL on failure, or a new virtual dataset handle on success to be closed with GDALClose().
GDAL.gdalcreaterasterattributetable
— MethodGDALCreateRasterAttributeTable() -> GDALRasterAttributeTableH
Construct empty table.
GDAL.gdalcreaterasterattributetablefrommdarrays
— MethodGDALCreateRasterAttributeTableFromMDArrays(GDALRATTableType eTableType,
const std::vector< std::shared_ptr< GDALMDArray > > & apoArrays,
const std::vector< GDALRATFieldUsage > & aeUsages) -> GDALRasterAttributeTable *
Return a virtual Raster Attribute Table from several GDALMDArray's.
Parameters
- eTableType: RAT table type
- apoArrays: Vector of GDALMDArray's (none of them should be nullptr)
- aeUsages: Vector of GDALRATFieldUsage (of the same size as apoArrays if non-empty), or empty vector to use defaults
Returns
a new Raster Attribute Table to free with delete, or nullptr in case of error
GDAL.gdalcreatereprojectiontransformer
— MethodGDALCreateReprojectionTransformer(const char * pszSrcWKT,
const char * pszDstWKT) -> void *
Create reprojection transformer.
Parameters
- pszSrcWKT: the coordinate system for the source coordinate system.
- pszDstWKT: the coordinate system for the destination coordinate system.
Returns
Handle for use with GDALReprojectionTransform(), or NULL if the system fails to initialize the reprojection.
GDAL.gdalcreatereprojectiontransformerex
— MethodGDALCreateReprojectionTransformerEx(OGRSpatialReferenceH hSrcSRS,
OGRSpatialReferenceH hDstSRS,
const char *const * papszOptions) -> void *
Create reprojection transformer.
Parameters
- hSrcSRS: the coordinate system for the source coordinate system.
- hDstSRS: the coordinate system for the destination coordinate system.
- papszOptions: NULL-terminated list of options, or NULL. Currently supported options are:
AREAOFINTEREST=westlong,southlat,eastlong,northlat: Values in degrees. longitudes in [-180,180], latitudes in [-90,90].
COORDINATE_OPERATION=string: PROJ or WKT string representing a coordinate operation, overriding the default computed transformation.
COORDINATEEPOCH=decimalyear: Coordinate epoch, expressed as a decimal year. Useful for time-dependant coordinate operations.
SRCCOORDINATEEPOCH: (GDAL >= 3.4) Coordinate epoch of source CRS, expressed as a decimal year. Useful for time-dependant coordinate operations.
DSTCOORDINATEEPOCH: (GDAL >= 3.4) Coordinate epoch of target CRS, expressed as a decimal year. Useful for time-dependant coordinate operations.
Returns
Handle for use with GDALReprojectionTransform(), or NULL if the system fails to initialize the reprojection.
GDAL.gdalcreaterpctransformerv1
— MethodGDALCreateRPCTransformerV1(GDALRPCInfoV1 * psRPCInfo,
int bReversed,
double dfPixErrThreshold,
char ** papszOptions) -> void *
GDAL.gdalcreaterpctransformerv2
— Methodgdalcreaterpctransformerv2(psRPC, bReversed, dfPixErrThreshold, papszOptions)
GDAL.gdalcreatescaledprogress
— MethodGDALCreateScaledProgress(double dfMin,
double dfMax,
GDALProgressFunc pfnProgress,
void * pData) -> void *
Create scaled progress transformer.
Parameters
- dfMin: the value to which 0.0 in the sub operation is mapped.
- dfMax: the value to which 1.0 is the sub operation is mapped.
- pfnProgress: the overall progress function.
- pData: the overall progress function callback data.
Returns
pointer to pass as pProgressArg to sub functions. Should be freed with GDALDestroyScaledProgress().
GDAL.gdalcreatesimilartransformer
— MethodGDALCreateSimilarTransformer(void * pTransformArg,
double dfRatioX,
double dfRatioY) -> void *
GDAL.gdalcreatetpstransformer
— MethodGDALCreateTPSTransformer(int nGCPCount,
const GDAL_GCP * pasGCPList,
int bReversed) -> void *
Create Thin Plate Spline transformer from GCPs.
Parameters
- nGCPCount: the number of GCPs in pasGCPList.
- pasGCPList: an array of GCPs to be used as input.
- bReversed: set it to TRUE to compute the reversed transformation.
Returns
the transform argument or NULL if creation fails.
GDAL.gdalcreatewarpedvrt
— MethodGDALCreateWarpedVRT(GDALDatasetH hSrcDS,
int nPixels,
int nLines,
double * padfGeoTransform,
GDALWarpOptions * psOptions) -> GDALDatasetH
Create virtual warped dataset.
Parameters
- hSrcDS: The source dataset.
- nPixels: Width of the virtual warped dataset to create
- nLines: Height of the virtual warped dataset to create
- padfGeoTransform: Geotransform matrix of the virtual warped dataset to create
- psOptions: Warp options. Must be different from NULL.
Returns
NULL on failure, or a new virtual dataset handle on success.
GDAL.gdalcreatewarpoperation
— MethodGDALCreateWarpOperation(const GDALWarpOptions * psNewOptions) -> GDALWarpOperationH
GDAL.gdalcreatewarpoptions
— MethodGDALCreateWarpOptions() -> GDALWarpOptions *
Create a warp options structure.
GDAL.gdaldatasetabortsql
— MethodGDALDatasetAbortSQL(GDALDatasetH hDS) -> OGRErr
Abort any SQL statement running in the data store.
Parameters
- hDS: the dataset handle.
Returns
OGRERRNONE on success, or OGRERRUNSUPPORTED_OPERATION if AbortSQL is not supported for this datasource. .
GDAL.gdaldatasetaddfielddomain
— MethodGDALDatasetAddFieldDomain(GDALDatasetH hDS,
OGRFieldDomainH hFieldDomain,
char ** ppszFailureReason) -> bool
Add a field domain to the dataset.
Parameters
- hDS: Dataset handle.
- hFieldDomain: The domain definition. Contrary to the C++ version, the passed object is copied.
- ppszFailureReason: Output parameter. Will contain an error message if an error occurs (*ppszFailureReason to be freed with CPLFree). May be NULL.
Returns
true in case of success.
GDAL.gdaldatasetaddrelationship
— MethodGDALDatasetAddRelationship(GDALDatasetH hDS,
GDALRelationshipH hRelationship,
char ** ppszFailureReason) -> bool
Add a relationship to the dataset.
Parameters
- hDS: Dataset handle.
- hRelationship: The relationship definition. Contrary to the C++ version, the passed object is copied.
- ppszFailureReason: Output parameter. Will contain an error message if an error occurs (*ppszFailureReason to be freed with CPLFree). May be NULL.
Returns
true in case of success.
GDAL.gdaldatasetadviseread
— MethodGDALDatasetAdviseRead(GDALDatasetH hDS,
int nXOff,
int nYOff,
int nXSize,
int nYSize,
int nBufXSize,
int nBufYSize,
GDALDataType eDT,
int nBandCount,
int * panBandMap,
CSLConstList papszOptions) -> CPLErr
Advise driver of upcoming read requests.
GDAL.gdaldatasetclearstatistics
— MethodGDALDatasetClearStatistics(GDALDatasetH hDS) -> void
Clear statistics.
GDAL.gdaldatasetcommittransaction
— MethodGDALDatasetCommitTransaction(GDALDatasetH hDS) -> OGRErr
For datasources which support transactions, CommitTransaction commits a transaction.
Returns
OGRERR_NONE on success.
GDAL.gdaldatasetcopylayer
— MethodGDALDatasetCopyLayer(GDALDatasetH hDS,
OGRLayerH hSrcLayer,
const char * pszNewName,
CSLConstList papszOptions) -> OGRLayerH
Duplicate an existing layer.
Parameters
- hDS: the dataset handle.
- hSrcLayer: source layer.
- pszNewName: the name of the layer to create.
- papszOptions: a StringList of name=value options. Options are driver specific.
Returns
a handle to the layer, or NULL if an error occurs.
GDAL.gdaldatasetcopywholeraster
— MethodGDALDatasetCopyWholeRaster(GDALDatasetH hSrcDS,
GDALDatasetH hDstDS,
CSLConstList papszOptions,
GDALProgressFunc pfnProgress,
void * pProgressData) -> CPLErr
Copy all dataset raster data.
Parameters
- 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.
Returns
CENone on success, or CEFailure on failure.
GDAL.gdaldatasetcreatelayer
— MethodGDALDatasetCreateLayer(GDALDatasetH hDS,
const char * pszName,
OGRSpatialReferenceH hSpatialRef,
OGRwkbGeometryType eGType,
CSLConstList papszOptions) -> OGRLayerH
This function attempts to create a new layer on the dataset with the indicated name, coordinate system, geometry type.
Parameters
- hDS: the dataset handle
- pszName: the name for the new layer. This should ideally not match any existing layer on the datasource.
- hSpatialRef: the coordinate system to use for the new layer, or NULL if no coordinate system is available.
- eGType: the geometry type for the layer. Use wkbUnknown if there are no constraints on the types geometry to be written.
- papszOptions: a StringList of name=value options. Options are driver specific.
Returns
NULL is returned on failure, or a new OGRLayer handle on success.
GDAL.gdaldatasetcreatelayerfromgeomfielddefn
— MethodGDALDatasetCreateLayerFromGeomFieldDefn(GDALDatasetH hDS,
const char * pszName,
OGRGeomFieldDefnH hGeomFieldDefn,
CSLConstList papszOptions) -> OGRLayerH
This function attempts to create a new layer on the dataset with the indicated name and geometry field.
Parameters
- hDS: the dataset handle
- pszName: the name for the new layer. This should ideally not match any existing layer on the datasource.
- hGeomFieldDefn: the geometry field definition. May be NULL to indicate a non-spatial file (or if adding geometry fields later with OGRLCreateGeomField() for drivers supporting that interface).
- papszOptions: a StringList of name=value options. Options are driver specific.
Returns
NULL is returned on failure, or a new OGRLayer handle on success.
GDAL.gdaldatasetdeletefielddomain
— MethodGDALDatasetDeleteFieldDomain(GDALDatasetH hDS,
const char * pszName,
char ** ppszFailureReason) -> bool
Removes a field domain from the dataset.
Parameters
- hDS: Dataset handle.
- pszName: The domain name.
- ppszFailureReason: Output parameter. Will contain an error message if an error occurs (*ppszFailureReason to be freed with CPLFree). May be NULL.
Returns
true in case of success.
GDAL.gdaldatasetdeletelayer
— MethodGDALDatasetDeleteLayer(GDALDatasetH hDS,
int iLayer) -> OGRErr
Delete the indicated layer from the datasource.
Parameters
- hDS: the dataset handle.
- iLayer: the index of the layer to delete.
Returns
OGRERRNONE on success, or OGRERRUNSUPPORTED_OPERATION if deleting layers is not supported for this datasource.
GDAL.gdaldatasetdeleterelationship
— MethodGDALDatasetDeleteRelationship(GDALDatasetH hDS,
const char * pszName,
char ** ppszFailureReason) -> bool
Removes a relationship from the dataset.
Parameters
- hDS: Dataset handle.
- pszName: The relationship name.
- ppszFailureReason: Output parameter. Will contain an error message if an error occurs (*ppszFailureReason to be freed with CPLFree). May be NULL.
Returns
true in case of success.
GDAL.gdaldatasetexecutesql
— MethodGDALDatasetExecuteSQL(GDALDatasetH hDS,
const char * pszStatement,
OGRGeometryH hSpatialFilter,
const char * pszDialect) -> OGRLayerH
Execute an SQL statement against the data store.
Parameters
- hDS: the dataset handle.
- pszStatement: the SQL statement to execute.
- hSpatialFilter: geometry which represents a spatial filter. Can be NULL.
- pszDialect: allows control of the statement dialect. If set to NULL, the OGR SQL engine will be used, except for RDBMS drivers that will use their dedicated SQL engine, unless OGRSQL is explicitly passed as the dialect. Starting with OGR 1.10, the SQLITE dialect can also be used.
Returns
an OGRLayer containing the results of the query. Deallocate with GDALDatasetReleaseResultSet().
GDAL.gdaldatasetgetcompressionformats
— MethodGDALDatasetGetCompressionFormats(GDALDatasetH hDS,
int nXOff,
int nYOff,
int nXSize,
int nYSize,
int nBandCount,
const int * panBandList) -> char **
Return the compression formats that can be natively obtained for the window of interest and requested bands.
Parameters
- hDS: Dataset handle.
- 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.
- nBandCount: the number of bands being requested.
- panBandList: the list of nBandCount band numbers. Note band numbers are 1 based. This may be NULL to select the first nBandCount bands.
Returns
a list of compatible formats (which may be empty) that should be freed with CSLDestroy(), or nullptr.
GDAL.gdaldatasetgetfielddomain
— MethodGDALDatasetGetFieldDomain(GDALDatasetH hDS,
const char * pszName) -> OGRFieldDomainH
Get a field domain from its name.
Parameters
- hDS: Dataset handle.
- pszName: Name of field domain.
Returns
the field domain (ownership remains to the dataset), or nullptr if not found.
GDAL.gdaldatasetgetfielddomainnames
— MethodGDALDatasetGetFieldDomainNames(GDALDatasetH hDS,
CSLConstList papszOptions) -> char **
Returns a list of the names of all field domains stored in the dataset.
Parameters
- hDS: Dataset handle.
- papszOptions: Driver specific options determining how attributes should be retrieved. Pass nullptr for default behavior.
Returns
list of field domain names, to be freed with CSLDestroy()
GDAL.gdaldatasetgetlayer
— MethodGDALDatasetGetLayer(GDALDatasetH hDS,
int iLayer) -> OGRLayerH
Fetch a layer by index.
Parameters
- hDS: the dataset handle.
- iLayer: a layer number between 0 and GetLayerCount()-1.
Returns
the layer, or NULL if iLayer is out of range or an error occurs.
GDAL.gdaldatasetgetlayerbyname
— MethodGDALDatasetGetLayerByName(GDALDatasetH hDS,
const char * pszName) -> OGRLayerH
Fetch a layer by name.
Parameters
- hDS: the dataset handle.
- pszName: the layer name of the layer to fetch.
Returns
the layer, or NULL if Layer is not found or an error occurs.
GDAL.gdaldatasetgetlayercount
— MethodGDALDatasetGetLayerCount(GDALDatasetH hDS) -> int
Get the number of layers in this dataset.
Parameters
- hDS: the dataset handle.
Returns
layer count.
GDAL.gdaldatasetgetnextfeature
— MethodGDALDatasetGetNextFeature(GDALDatasetH hDS,
OGRLayerH * phBelongingLayer,
double * pdfProgressPct,
GDALProgressFunc pfnProgress,
void * pProgressData) -> OGRFeatureH
Fetch the next available feature from this dataset.
Parameters
- hDS: dataset handle.
- phBelongingLayer: a pointer to a OGRLayer* variable to receive the layer to which the object belongs to, or NULL. It is possible that the output of *ppoBelongingLayer to be NULL despite the feature not being NULL.
- pdfProgressPct: a pointer to a double variable to receive the percentage progress (in [0,1] range), or NULL. On return, the pointed value might be negative if determining the progress is not possible.
- pfnProgress: a progress callback to report progress (for GetNextFeature() calls that might have a long duration) and offer cancellation possibility, or NULL
- pProgressData: user data provided to pfnProgress, or NULL
Returns
a feature, or NULL if no more features are available.
GDAL.gdaldatasetgetrelationship
— MethodGDALDatasetGetRelationship(GDALDatasetH hDS,
const char * pszName) -> GDALRelationshipH
Get a relationship from its name.
Parameters
- hDS: Dataset handle.
- pszName: Name of relationship.
Returns
the relationship (ownership remains to the dataset), or nullptr if not found.
GDAL.gdaldatasetgetrelationshipnames
— MethodGDALDatasetGetRelationshipNames(GDALDatasetH hDS,
CSLConstList papszOptions) -> char **
Returns a list of the names of all relationships stored in the dataset.
Parameters
- hDS: Dataset handle.
- papszOptions: Driver specific options determining how relationships should be retrieved. Pass nullptr for default behavior.
Returns
list of relationship names, to be freed with CSLDestroy()
GDAL.gdaldatasetgetrootgroup
— MethodGDALDatasetGetRootGroup(GDALDatasetH hDS) -> GDALGroupH
Return the root GDALGroup of this dataset.
GDAL.gdaldatasetgetstyletable
— MethodGDALDatasetGetStyleTable(GDALDatasetH hDS) -> OGRStyleTableH
Returns dataset style table.
Parameters
- hDS: the dataset handle
Returns
handle to a style table which should not be modified or freed by the caller.
GDAL.gdaldatasetgettiledvirtualmem
— MethodGDALDatasetGetTiledVirtualMem(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,
CSLConstList papszOptions) -> CPLVirtualMem *
Create a CPLVirtualMem object from a GDAL dataset object, with tiling organization.
Parameters
- hDS: Dataset object
- eRWFlag: Either GFRead to read a region of data, or GFWrite 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.
Returns
a virtual memory object that must be freed by CPLVirtualMemFree(), or NULL in case of failure.
GDAL.gdaldatasetgetvirtualmem
— MethodGDALDatasetGetVirtualMem(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,
CSLConstList papszOptions) -> CPLVirtualMem *
Create a CPLVirtualMem object from a GDAL dataset object.
Parameters
- hDS: Dataset object
- eRWFlag: Either GFRead to read a region of data, or GFWrite 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.
Returns
a virtual memory object that must be freed by CPLVirtualMemFree(), or NULL in case of failure.
GDAL.gdaldatasetislayerprivate
— MethodGDALDatasetIsLayerPrivate(GDALDatasetH hDS,
int iLayer) -> int
Returns true if the layer at the specified index is deemed a private or system table, or an internal detail only.
Parameters
- hDS: the dataset handle.
- iLayer: a layer number between 0 and GetLayerCount()-1.
Returns
true if the layer is a private or system table.
GDAL.gdaldatasetrasterio
— MethodGDALDatasetRasterIO(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) -> CPLErr
Read/write a region of image data from multiple bands.
GDAL.gdaldatasetrasterioex
— MethodGDALDatasetRasterIOEx(GDALDatasetH hDS,
GDALRWFlag eRWFlag,
int nXOff,
int nYOff,
int nXSize,
int nYSize,
void * pData,
int nBufXSize,
int nBufYSize,
GDALDataType eBufType,
int nBandCount,
int * panBandMap,
GSpacing nPixelSpace,
GSpacing nLineSpace,
GSpacing nBandSpace,
GDALRasterIOExtraArg * psExtraArg) -> CPLErr
Read/write a region of image data from multiple bands.
GDAL.gdaldatasetreadcompresseddata
— MethodGDALDatasetReadCompressedData(GDALDatasetH hDS,
const char * pszFormat,
int nXOff,
int nYOff,
int nXSize,
int nYSize,
int nBandCount,
const int * panBandList,
void ** ppBuffer,
size_t * pnBufferSize,
char ** ppszDetailedFormat) -> CPLErr
Return the compressed content that can be natively obtained for the window of interest and requested bands.
Parameters
- hDS: Dataset handle.
- pszFormat: Requested compression format (e.g. "JPEG", "WEBP", "JXL"). This is the MIME type of one of the values returned by GetCompressionFormats(). The format string is designed to potentially include at a later point key=value optional parameters separated by a semi-colon character. At time of writing, none are implemented. ReadCompressedData() implementations should verify optional parameters and return CE_Failure if they cannot support one of them.
- 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.
- nBandCount: the number of bands being requested.
- panBandList: the list of nBandCount band numbers. Note band numbers are 1 based. This may be NULL to select the first nBandCount bands.
- ppBuffer: Pointer to a buffer to store the compressed data or nullptr. If ppBuffer is not nullptr, then pnBufferSize should also not be nullptr. If ppBuffer is not nullptr, and *ppBuffer is not nullptr, then the provided buffer will be filled with the compressed data, provided that pnBufferSize and *pnBufferSize are not nullptr, and *pnBufferSize, indicating the size of *ppBuffer, is sufficiently large to hold the data. If ppBuffer is not nullptr, but *ppBuffer is nullptr, then the method will allocate *ppBuffer using VSIMalloc(), and thus the caller is responsible to free it with VSIFree(). If ppBuffer is nullptr, then the compressed data itself will not be returned, but *pnBufferSize will be updated with an upper bound of the size that would be necessary to hold it (if pnBufferSize != nullptr).
- pnBufferSize: Output buffer size, or nullptr. If ppBuffer != nullptr && *ppBuffer != nullptr, then pnBufferSize should be != nullptr and *pnBufferSize contain the size of *ppBuffer. If the method is successful, *pnBufferSize will be updated with the actual size used.
- ppszDetailedFormat: Pointer to an output string, or nullptr. If ppszDetailedFormat is not nullptr, then, on success, the method will allocate a new string in *ppszDetailedFormat (to be freed with VSIFree()) *ppszDetailedFormat might contain strings like "JPEG;frametype=SOF0baseline;bitdepth=8;numcomponents=3;" "subsampling=4:2:0;colorspace=YCbCr" or simply the MIME type. The string will contain at least as much information as what GetCompressionFormats() returns, and potentially more when ppBuffer != nullptr.
Returns
CENone in case of success, CEFailure otherwise.
GDAL.gdaldatasetreleaseresultset
— MethodGDALDatasetReleaseResultSet(GDALDatasetH hDS,
OGRLayerH hLayer) -> void
Release results of ExecuteSQL().
Parameters
- hDS: the dataset handle.
- hLayer: the result of a previous ExecuteSQL() call.
GDAL.gdaldatasetresetreading
— MethodGDALDatasetResetReading(GDALDatasetH hDS) -> void
Reset feature reading to start on the first feature.
Parameters
- hDS: dataset handle
GDAL.gdaldatasetrollbacktransaction
— MethodGDALDatasetRollbackTransaction(GDALDatasetH hDS) -> OGRErr
For datasources which support transactions, RollbackTransaction will roll back a datasource to its state before the start of the current transaction.
Returns
OGRERR_NONE on success.
GDAL.gdaldatasetsetqueryloggerfunc
— Methodgdaldatasetsetqueryloggerfunc(hDS, pfnQueryLoggerFunc, poQueryLoggerArg)
Sets the SQL query logger callback.
When supported by the driver, the callback will be called with the executed SQL text, the error message, the execution time in milliseconds, the number of records fetched/affected and the client status data.
A value of -1 in the execution time or in the number of records indicates that the values are unknown.
\since GDAL 3.7
Arguments
hDS
: Dataset handle.pfnQueryLoggerFunc
: Callback functionpoQueryLoggerArg
: Opaque client status data
Returns
true in case of success.
GDAL.gdaldatasetsetstyletable
— MethodGDALDatasetSetStyleTable(GDALDatasetH hDS,
OGRStyleTableH hStyleTable) -> void
Set dataset style table.
Parameters
- hDS: the dataset handle
- hStyleTable: style table handle to set
GDAL.gdaldatasetsetstyletabledirectly
— MethodGDALDatasetSetStyleTableDirectly(GDALDatasetH hDS,
OGRStyleTableH hStyleTable) -> void
Set dataset style table.
Parameters
- hDS: the dataset handle
- hStyleTable: style table handle to set
GDAL.gdaldatasetstarttransaction
— MethodGDALDatasetStartTransaction(GDALDatasetH hDS,
int bForce) -> OGRErr
For datasources which support transactions, StartTransaction creates a transaction.
Parameters
- hDS: the dataset handle.
- bForce: can be set to TRUE if an emulation, possibly slow, of a transaction mechanism is acceptable.
Returns
OGRERR_NONE on success.
GDAL.gdaldatasettestcapability
— MethodGDALDatasetTestCapability(GDALDatasetH hDS,
const char * pszCap) -> int
Test if capability is available.
Parameters
- hDS: the dataset handle.
- pszCap: the capability to test.
Returns
TRUE if capability available otherwise FALSE.
GDAL.gdaldatasetupdatefielddomain
— MethodGDALDatasetUpdateFieldDomain(GDALDatasetH hDS,
OGRFieldDomainH hFieldDomain,
char ** ppszFailureReason) -> bool
Updates an existing field domain by replacing its definition.
Parameters
- hDS: Dataset handle.
- hFieldDomain: The domain definition. Contrary to the C++ version, the passed object is copied.
- ppszFailureReason: Output parameter. Will contain an error message if an error occurs (*ppszFailureReason to be freed with CPLFree). May be NULL.
Returns
true in case of success.
GDAL.gdaldatasetupdaterelationship
— MethodGDALDatasetUpdateRelationship(GDALDatasetH hDS,
GDALRelationshipH hRelationship,
char ** ppszFailureReason) -> bool
Updates an existing relationship by replacing its definition.
Parameters
- hDS: Dataset handle.
- hRelationship: The relationship definition. Contrary to the C++ version, the passed object is copied.
- ppszFailureReason: Output parameter. Will contain an error message if an error occurs (*ppszFailureReason to be freed with CPLFree). May be NULL.
Returns
true in case of success.
GDAL.gdaldatatypeiscomplex
— MethodGDALDataTypeIsComplex(GDALDataType eDataType) -> int
Is data type complex?
Returns
TRUE if the passed type is complex (one of GDTCInt16, GDTCInt32, GDTCFloat32 or GDTCFloat64), that is it consists of a real and imaginary component.
GDAL.gdaldatatypeisconversionlossy
— MethodGDALDataTypeIsConversionLossy(GDALDataType eTypeFrom,
GDALDataType eTypeTo) -> int
Is conversion from eTypeFrom to eTypeTo potentially lossy.
Parameters
- eTypeFrom: input datatype
- eTypeTo: output datatype
Returns
TRUE if conversion from eTypeFrom to eTypeTo potentially lossy.
GDAL.gdaldatatypeisfloating
— MethodGDALDataTypeIsFloating(GDALDataType eDataType) -> int
Is data type floating? (might be complex)
Returns
TRUE if the passed type is floating (one of GDTFloat32, GDTFloat64, GDTCFloat32, GDTCFloat64)
GDAL.gdaldatatypeisinteger
— MethodGDALDataTypeIsInteger(GDALDataType eDataType) -> int
Is data type integer? (might be complex)
Returns
TRUE if the passed type is integer (one of GDTByte, GDTInt16, GDTUInt16, GDTInt32, GDTUInt32, GDTCInt16, GDT_CInt32).
GDAL.gdaldatatypeissigned
— MethodGDALDataTypeIsSigned(GDALDataType eDataType) -> int
Is data type signed?
Returns
TRUE if the passed type is signed.
GDAL.gdaldatatypeunion
— MethodGDALDataTypeUnion(GDALDataType eType1,
GDALDataType eType2) -> GDALDataType
Return the smallest data type that can fully express both input data types.
Parameters
- eType1: first data type.
- eType2: second data type.
Returns
a data type able to express eType1 and eType2.
GDAL.gdaldatatypeunionwithvalue
— MethodGDALDataTypeUnionWithValue(GDALDataType eDT,
double dValue,
int bComplex) -> GDALDataType
Union a data type with the one found for a value.
Parameters
- eDT: the first data type
- dValue: the value for which to find a data type and union with eDT
- bComplex: if the value is complex
Returns
a data type able to express eDT and dValue.
GDAL.gdaldectodms
— MethodGDALDecToDMS(double dfAngle,
const char * pszAxis,
int nPrecision) -> const char *
Translate a decimal degrees value to a DMS string with hemisphere.
GDAL.gdaldectopackeddms
— MethodGDALDecToPackedDMS(double dfDec) -> double
Convert decimal degrees into packed DMS value (DDDMMMSSS.SS).
GDAL.gdaldeinitgcps
— MethodGDALDeinitGCPs(int nCount,
GDAL_GCP * psGCP) -> void
De-initialize an array of GCPs (initialized with GDALInitGCPs())
Parameters
- nCount: number of GCPs in psGCP
- psGCP: array of GCPs of size nCount.
GDAL.gdaldeinterleave
— MethodGDALDeinterleave(const void * pSourceBuffer,
GDALDataType eSourceDT,
int nComponents,
void ** ppDestBuffer,
GDALDataType eDestDT,
size_t nIters) -> void
GDAL.gdaldeletedataset
— MethodGDALDeleteDataset(GDALDriverH hDriver,
const char * pszFilename) -> CPLErr
Delete named dataset.
GDAL.gdaldeleterasternodatavalue
— MethodGDALDeleteRasterNoDataValue(GDALRasterBandH hBand) -> CPLErr
Remove the no data value for this band.
GDAL.gdaldemprocessing
— MethodGDALDEMProcessing(const char * pszDest,
GDALDatasetH hSrcDataset,
const char * pszProcessing,
const char * pszColorFilename,
const GDALDEMProcessingOptions * psOptionsIn,
int * pbUsageError) -> GDALDatasetH
Apply a DEM processing.
Parameters
- pszDest: the destination dataset path.
- hSrcDataset: the source dataset handle.
- pszProcessing: the processing to apply (one of "hillshade", "slope", "aspect", "color-relief", "TRI", "TPI", "Roughness")
- pszColorFilename: color file (mandatory for "color-relief" processing, should be NULL otherwise)
- psOptionsIn: the options struct returned by GDALDEMProcessingOptionsNew() or NULL.
- pbUsageError: pointer to a integer output variable to store if any usage error has occurred or NULL.
Returns
the output dataset (new dataset that must be closed using GDALClose()) or NULL in case of error.
GDAL.gdaldemprocessingoptionsfree
— MethodGDALDEMProcessingOptionsFree(GDALDEMProcessingOptions * psOptions) -> void
Frees the GDALDEMProcessingOptions struct.
Parameters
- psOptions: the options struct for GDALDEMProcessing().
GDAL.gdaldemprocessingoptionsnew
— MethodGDALDEMProcessingOptionsNew(char ** papszArgv,
GDALDEMProcessingOptionsForBinary * psOptionsForBinary) -> GDALDEMProcessingOptions *
Allocates a GDALDEMProcessingOptions struct.
Parameters
- papszArgv: NULL terminated list of options (potentially including filename and open options too), or NULL. The accepted options are the ones of the gdaldem utility.
- psOptionsForBinary: (output) may be NULL (and should generally be NULL), otherwise (gdaltranslatebin.cpp use case) must be allocated with GDALDEMProcessingOptionsForBinaryNew() prior to this function. Will be filled with potentially present filename, open options,...
Returns
pointer to the allocated GDALDEMProcessingOptions struct. Must be freed with GDALDEMProcessingOptionsFree().
GDAL.gdaldemprocessingoptionssetprogress
— MethodGDALDEMProcessingOptionsSetProgress(GDALDEMProcessingOptions * psOptions,
GDALProgressFunc pfnProgress,
void * pProgressData) -> void
Set a progress function.
Parameters
- psOptions: the options struct for GDALDEMProcessing().
- pfnProgress: the progress callback.
- pProgressData: the user data for the progress callback.
GDAL.gdaldereferencedataset
— MethodGDALDereferenceDataset(GDALDatasetH hDataset) -> int
Subtract one from dataset reference count.
GDAL.gdalderegisterdriver
— MethodGDALDeregisterDriver(GDALDriverH hDriver) -> void
Deregister the passed driver.
GDAL.gdaldeserializetransformer
— MethodGDALDeserializeTransformer(CPLXMLNode * psTree,
GDALTransformerFunc * ppfnFunc,
void ** ppTransformArg) -> CPLErr
GDAL.gdaldeserializewarpoptions
— MethodGDALDeserializeWarpOptions(CPLXMLNode * psTree) -> GDALWarpOptions *
GDAL.gdaldestroy
— MethodGDALDestroy(void) -> void
GDAL.gdaldestroyapproxtransformer
— MethodGDALDestroyApproxTransformer(void * pCBData) -> void
Cleanup approximate transformer.
Parameters
- pCBData: callback data originally returned by GDALCreateApproxTransformer().
GDAL.gdaldestroycolortable
— MethodGDALDestroyColorTable(GDALColorTableH hTable) -> void
Destroys a color table.
GDAL.gdaldestroydriver
— MethodGDALDestroyDriver(GDALDriverH hDriver) -> void
Destroy a GDALDriver.
Parameters
- hDriver: the driver to destroy.
GDAL.gdaldestroydrivermanager
— MethodGDALDestroyDriverManager(void) -> void
Destroy the driver manager.
GDAL.gdaldestroygcptransformer
— MethodGDALDestroyGCPTransformer(void * pTransformArg) -> void
Destroy GCP transformer.
Parameters
- pTransformArg: the transform arg previously returned by GDALCreateGCPTransformer().
GDAL.gdaldestroygenimgprojtransformer
— MethodGDALDestroyGenImgProjTransformer(void * hTransformArg) -> void
GenImgProjTransformer deallocator.
Parameters
- hTransformArg: the handle to deallocate.
GDAL.gdaldestroygeoloctransformer
— MethodGDALDestroyGeoLocTransformer(void * pTransformAlg) -> void
Destroy GeoLocation transformer.
GDAL.gdaldestroyrasterattributetable
— MethodGDALDestroyRasterAttributeTable(GDALRasterAttributeTableH hRAT) -> void
Destroys a RAT.
GDAL.gdaldestroyrelationship
— MethodGDALDestroyRelationship(GDALRelationshipH hRelationship) -> void
Destroys a relationship.
GDAL.gdaldestroyreprojectiontransformer
— MethodGDALDestroyReprojectionTransformer(void * pTransformArg) -> void
Destroy reprojection transformation.
Parameters
- pTransformArg: the transformation handle returned by GDALCreateReprojectionTransformer().
GDAL.gdaldestroyrpctransformer
— MethodGDALDestroyRPCTransformer(void * pTransformAlg) -> void
Destroy RPC tranformer.
GDAL.gdaldestroyscaledprogress
— MethodGDALDestroyScaledProgress(void * pData) -> void
Cleanup scaled progress handle.
Parameters
- pData: scaled progress handle returned by GDALCreateScaledProgress().
GDAL.gdaldestroysubdatasetinfo
— Methodgdaldestroysubdatasetinfo(hInfo)
Destroys a GDALSubdatasetInfo
object.
\since GDAL 3.8
Arguments
hInfo
: Pointer toGDALSubdatasetInfo
object
GDAL.gdaldestroytpstransformer
— MethodGDALDestroyTPSTransformer(void * pTransformArg) -> void
Destroy TPS transformer.
Parameters
- pTransformArg: the transform arg previously returned by GDALCreateTPSTransformer().
GDAL.gdaldestroytransformer
— Methodgdaldestroytransformer(pTransformerArg)
Doxygen_Suppress
GDAL.gdaldestroywarpoperation
— MethodGDALDestroyWarpOperation(GDALWarpOperationH hOperation) -> void
GDAL.gdaldestroywarpoptions
— MethodGDALDestroyWarpOptions(GDALWarpOptions * psOptions) -> void
Destroy a warp options structure.
GDAL.gdaldimensiongetdirection
— MethodGDALDimensionGetDirection(GDALDimensionH hDim) -> const char *
Return dimension direction.
GDAL.gdaldimensiongetfullname
— MethodGDALDimensionGetFullName(GDALDimensionH hDim) -> const char *
Return dimension full name.
GDAL.gdaldimensiongetindexingvariable
— MethodGDALDimensionGetIndexingVariable(GDALDimensionH hDim) -> GDALMDArrayH
Return the variable that is used to index the dimension (if there is one).
GDAL.gdaldimensiongetname
— MethodGDALDimensionGetName(GDALDimensionH hDim) -> const char *
Return dimension name.
GDAL.gdaldimensiongetsize
— MethodGDALDimensionGetSize(GDALDimensionH hDim) -> GUInt64
Return the size, that is the number of values along the dimension.
GDAL.gdaldimensiongettype
— MethodGDALDimensionGetType(GDALDimensionH hDim) -> const char *
Return dimension type.
GDAL.gdaldimensionrelease
— MethodGDALDimensionRelease(GDALDimensionH hDim) -> void
Release the GDAL in-memory object associated with a GDALDimension.
GDAL.gdaldimensionrename
— MethodGDALDimensionRename(GDALDimensionH hDim,
const char * pszNewName) -> bool
Rename the dimension.
Returns
true in case of success
GDAL.gdaldimensionsetindexingvariable
— MethodGDALDimensionSetIndexingVariable(GDALDimensionH hDim,
GDALMDArrayH hArray) -> int
Set the variable that is used to index the dimension.
Returns
TRUE in case of success.
GDAL.gdalditherrgb2pct
— MethodGDALDitherRGB2PCT(GDALRasterBandH hRed,
GDALRasterBandH hGreen,
GDALRasterBandH hBlue,
GDALRasterBandH hTarget,
GDALColorTableH hColorTable,
GDALProgressFunc pfnProgress,
void * pProgressArg) -> int
24bit to 8bit conversion with dithering.
Parameters
- hRed: Red input band.
- hGreen: Green input band.
- hBlue: Blue input band.
- hTarget: Output band.
- hColorTable: the color table to use with the output band.
- pfnProgress: callback for reporting algorithm progress matching the GDALProgressFunc() semantics. May be NULL.
- pProgressArg: callback argument passed to pfnProgress.
Returns
CENone on success or CEFailure if an error occurs.
GDAL.gdaldropcache
— MethodGDALDropCache(GDALDatasetH hDS) -> CPLErr
Drop all write cached data.
Returns
CE_None in case of success
GDAL.gdaldroprastercache
— MethodGDALDropRasterCache(GDALRasterBandH hBand) -> CPLErr
Drop raster data cache.
GDAL.gdaldummyprogress
— MethodGDALDummyProgress(double,
const char *,
void *) -> int
Stub progress function.
GDAL.gdaldumpopendatasets
— MethodGDALDumpOpenDatasets(FILE * fp) -> int
List open datasets.
GDAL.gdalduplicategcps
— MethodGDALDuplicateGCPs(int nCount,
const GDAL_GCP * pasGCPList) -> GDAL_GCP *
Duplicate an array of GCPs.
Parameters
- nCount: number of GCPs in psGCP
- pasGCPList: array of GCPs of size nCount.
GDAL.gdaledtcomponentcreate
— MethodGDALEDTComponentCreate(const char * pszName,
size_t nOffset,
GDALExtendedDataTypeH hType) -> GDALEDTComponentH
Create a new GDALEDTComponent.
GDAL.gdaledtcomponentgetname
— MethodGDALEDTComponentGetName(GDALEDTComponentH hComp) -> const char *
Return the name.
GDAL.gdaledtcomponentgetoffset
— MethodGDALEDTComponentGetOffset(GDALEDTComponentH hComp) -> size_t
Return the offset (in bytes) of the component in the compound data type.
GDAL.gdaledtcomponentgettype
— MethodGDALEDTComponentGetType(GDALEDTComponentH hComp) -> GDALExtendedDataTypeH
Return the data type of the component.
GDAL.gdaledtcomponentrelease
— MethodGDALEDTComponentRelease(GDALEDTComponentH hComp) -> void
Release the GDAL in-memory object associated with a GDALEDTComponentH.
GDAL.gdalendasyncreader
— MethodGDALEndAsyncReader(GDALDatasetH hDS,
GDALAsyncReaderH hAsyncReaderH) -> void
End asynchronous request.
Parameters
- hDS: handle to the dataset object.
- hAsyncReaderH: handle returned by GDALBeginAsyncReader()
GDAL.gdalextendeddatatypecanconvertto
— MethodGDALExtendedDataTypeCanConvertTo(GDALExtendedDataTypeH hSourceEDT,
GDALExtendedDataTypeH hTargetEDT) -> int
Return whether this data type can be converted to the other one.
Parameters
- hSourceEDT: Source data type for the conversion being considered.
- hTargetEDT: Target data type for the conversion being considered.
Returns
TRUE if hSourceEDT can be convert to hTargetEDT. FALSE otherwise.
GDAL.gdalextendeddatatypecreate
— MethodGDALExtendedDataTypeCreate(GDALDataType eType) -> GDALExtendedDataTypeH
Return a new GDALExtendedDataType of class GEDTC_NUMERIC.
Parameters
- eType: Numeric data type.
Returns
a new GDALExtendedDataTypeH handle, or nullptr.
GDAL.gdalextendeddatatypecreatecompound
— MethodGDALExtendedDataTypeCreateCompound(const char * pszName,
size_t nTotalSize,
size_t nComponents,
const GDALEDTComponentH * comps) -> GDALExtendedDataTypeH
Return a new GDALExtendedDataType of class GEDTC_COMPOUND.
Parameters
- pszName: Type name.
- nTotalSize: Total size of the type in bytes. Should be large enough to store all components.
- nComponents: Number of components in comps array.
- comps: Components.
Returns
a new GDALExtendedDataTypeH handle, or nullptr.
GDAL.gdalextendeddatatypecreatestring
— MethodGDALExtendedDataTypeCreateString(size_t nMaxStringLength) -> GDALExtendedDataTypeH
Return a new GDALExtendedDataType of class GEDTC_STRING.
Returns
a new GDALExtendedDataTypeH handle, or nullptr.
GDAL.gdalextendeddatatypecreatestringex
— MethodGDALExtendedDataTypeCreateStringEx(size_t nMaxStringLength,
GDALExtendedDataTypeSubType eSubType) -> GDALExtendedDataTypeH
Return a new GDALExtendedDataType of class GEDTC_STRING.
Returns
a new GDALExtendedDataTypeH handle, or nullptr.
GDAL.gdalextendeddatatypeequals
— MethodGDALExtendedDataTypeEquals(GDALExtendedDataTypeH hFirstEDT,
GDALExtendedDataTypeH hSecondEDT) -> int
Return whether this data type is equal to another one.
Parameters
- hFirstEDT: First data type.
- hSecondEDT: Second data type.
Returns
TRUE if they are equal. FALSE otherwise.
GDAL.gdalextendeddatatypefreecomponents
— MethodGDALExtendedDataTypeFreeComponents(GDALEDTComponentH * components,
size_t nCount) -> void
Free the return of GDALExtendedDataTypeGetComponents().
Parameters
- components: return value of GDALExtendedDataTypeGetComponents()
- nCount: *pnCount value returned by GDALExtendedDataTypeGetComponents()
GDAL.gdalextendeddatatypegetclass
— MethodGDALExtendedDataTypeGetClass(GDALExtendedDataTypeH hEDT) -> GDALExtendedDataTypeClass
Return type class.
GDAL.gdalextendeddatatypegetcomponents
— MethodGDALExtendedDataTypeGetComponents(GDALExtendedDataTypeH hEDT,
size_t * pnCount) -> GDALEDTComponentH *
Return the components of the data type (only valid when GetClass() == GEDTC_COMPOUND)
Parameters
- hEDT: Data type
- pnCount: Pointer to the number of values returned. Must NOT be NULL.
Returns
an array of *pnCount components.
GDAL.gdalextendeddatatypegetmaxstringlength
— MethodGDALExtendedDataTypeGetMaxStringLength(GDALExtendedDataTypeH hEDT) -> size_t
Return the maximum length of a string in bytes.
GDAL.gdalextendeddatatypegetname
— MethodGDALExtendedDataTypeGetName(GDALExtendedDataTypeH hEDT) -> const char *
Return type name.
GDAL.gdalextendeddatatypegetnumericdatatype
— MethodGDALExtendedDataTypeGetNumericDataType(GDALExtendedDataTypeH hEDT) -> GDALDataType
Return numeric data type (only valid when GetClass() == GEDTC_NUMERIC)
GDAL.gdalextendeddatatypegetsize
— MethodGDALExtendedDataTypeGetSize(GDALExtendedDataTypeH hEDT) -> size_t
Return data type size in bytes.
GDAL.gdalextendeddatatypegetsubtype
— MethodGDALExtendedDataTypeGetSubType(GDALExtendedDataTypeH hEDT) -> GDALExtendedDataTypeSubType
Return the subtype of a type.
Parameters
- hEDT: Data type.
Returns
subtype.
GDAL.gdalextendeddatatyperelease
— MethodGDALExtendedDataTypeRelease(GDALExtendedDataTypeH hEDT) -> void
Release the GDAL in-memory object associated with a GDALExtendedDataTypeH.
GDAL.gdalextractrpcinfov1
— Methodgdalextractrpcinfov1(arg1, arg2)
Doxygen_Suppress
GDAL.gdalextractrpcinfov2
— Methodgdalextractrpcinfov2(arg1, arg2)
GDAL.gdalfillnodata
— MethodGDALFillNodata(GDALRasterBandH hTargetBand,
GDALRasterBandH hMaskBand,
double dfMaxSearchDist,
int bDeprecatedOption,
int nSmoothingIterations,
char ** papszOptions,
GDALProgressFunc pfnProgress,
void * pProgressArg) -> CPLErr
Fill selected raster regions by interpolation from the edges.
Parameters
- hTargetBand: the raster band to be modified in place.
- hMaskBand: a mask band indicating pixels to be interpolated (zero valued). If hMaskBand is set to NULL, this method will internally use the mask band returned by GDALGetMaskBand(hTargetBand).
- dfMaxSearchDist: the maximum number of pixels to search in all directions to find values to interpolate from.
- bDeprecatedOption: unused argument, should be zero.
- nSmoothingIterations: the number of 3x3 smoothing filter passes to run (0 or more).
- papszOptions: additional name=value options in a string list.
TEMPFILEDRIVER=gdaldrivername. For example MEM.
NODATA=value (starting with GDAL 2.4). Source pixels at that value will be ignored by the interpolator. Warning: currently this will not be honored by smoothing passes.
INTERPOLATION=INVDIST/NEAREST (GDAL >= 3.9). By default, pixels are interpolated using an inverse distance weighting (INVDIST). It is also possible to choose a nearest neighbour (NEAREST) strategy.
- pfnProgress: the progress function to report completion.
- pProgressArg: callback data for progress function.
Returns
CENone on success or CEFailure if something goes wrong.
GDAL.gdalfillraster
— MethodGDALFillRaster(GDALRasterBandH hBand,
double dfRealValue,
double dfImaginaryValue) -> CPLErr
Fill this band with a constant value.
GDAL.gdalfinddatatype
— MethodGDALFindDataType(int nBits,
int bSigned,
int bFloating,
int bComplex) -> GDALDataType
Finds the smallest data type able to support the given requirements.
Parameters
- nBits: number of bits necessary
- bSigned: if negative values are necessary
- bFloating: if non-integer values necessary
- bComplex: if complex values are necessary
Returns
a best fit GDALDataType for supporting the requirements
GDAL.gdalfinddatatypeforvalue
— MethodGDALFindDataTypeForValue(double dValue,
int bComplex) -> GDALDataType
Finds the smallest data type able to support the provided value.
Parameters
- dValue: value to support
- bComplex: is the value complex
Returns
a best fit GDALDataType for supporting the value
GDAL.gdalflushcache
— MethodGDALFlushCache(GDALDatasetH hDS) -> CPLErr
Flush all write cached data to disk.
Returns
CE_None in case of success (note: return value added in GDAL 3.7)
GDAL.gdalflushcacheblock
— MethodGDALFlushCacheBlock() -> int
Try to flush one cached raster block.
Returns
TRUE if one block was flushed, FALSE if there are no cached blocks or if they are currently locked.
GDAL.gdalflushrastercache
— MethodGDALFlushRasterCache(GDALRasterBandH hBand) -> CPLErr
Flush raster data cache.
GDAL.gdalfootprint
— MethodGDALFootprint(const char * pszDest,
GDALDatasetH hDstDS,
GDALDatasetH hSrcDataset,
const GDALFootprintOptions * psOptionsIn,
int * pbUsageError) -> GDALDatasetH
Computes the footprint of a raster.
Parameters
- pszDest: the vector destination dataset path or NULL.
- hDstDS: the vector destination dataset or NULL.
- hSrcDataset: the raster source dataset handle.
- psOptionsIn: the options struct returned by GDALFootprintOptionsNew() or NULL.
- pbUsageError: pointer to a integer output variable to store if any usage error has occurred or NULL.
Returns
the output dataset (new dataset that must be closed using GDALClose(), or hDstDS is not NULL) or NULL in case of error.
GDAL.gdalfootprintoptionsfree
— MethodGDALFootprintOptionsFree(GDALFootprintOptions * psOptions) -> void
Frees the GDALFootprintOptions struct.
Parameters
- psOptions: the options struct for GDALFootprint().
GDAL.gdalfootprintoptionsnew
— MethodGDALFootprintOptionsNew(char ** papszArgv,
GDALFootprintOptionsForBinary * psOptionsForBinary) -> GDALFootprintOptions *
Allocates a GDALFootprintOptions struct.
Parameters
- papszArgv: NULL terminated list of options (potentially including filename and open options too), or NULL. The accepted options are the ones of the gdal_rasterize utility.
- psOptionsForBinary: (output) may be NULL (and should generally be NULL), otherwise (gdaltranslatebin.cpp use case) must be allocated with GDALFootprintOptionsForBinaryNew() prior to this function. Will be filled with potentially present filename, open options,...
Returns
pointer to the allocated GDALFootprintOptions struct. Must be freed with GDALFootprintOptionsFree().
GDAL.gdalfootprintoptionssetprogress
— MethodGDALFootprintOptionsSetProgress(GDALFootprintOptions * psOptions,
GDALProgressFunc pfnProgress,
void * pProgressData) -> void
Set a progress function.
Parameters
- psOptions: the options struct for GDALFootprint().
- pfnProgress: the progress callback.
- pProgressData: the user data for the progress callback.
GDAL.gdalfpolygonize
— MethodGDALFPolygonize(GDALRasterBandH hSrcBand,
GDALRasterBandH hMaskBand,
OGRLayerH hOutLayer,
int iPixValField,
char ** papszOptions,
GDALProgressFunc pfnProgress,
void * pProgressArg) -> CPLErr
Create polygon coverage from raster data.
Parameters
- hSrcBand: the source raster band to be processed.
- hMaskBand: an optional mask band. All pixels in the mask band with a value other than zero will be considered suitable for collection as polygons.
- hOutLayer: the vector feature layer to which the polygons should be written.
- iPixValField: the attribute field index indicating the feature attribute into which the pixel value of the polygon should be written. Or -1 to indicate that the pixel value must not be written.
- papszOptions: a name/value list of additional options
8CONNECTED=8: May be set to "8" to use 8 connectedness. Otherwise 4 connectedness will be applied to the algorithm
DATASETFORGEOREF=dataset_name: Name of a dataset from which to read the geotransform. This useful if hSrcBand has no related dataset, which is typical for mask bands.
- pfnProgress: callback for reporting algorithm progress matching the GDALProgressFunc() semantics. May be NULL.
- pProgressArg: callback argument passed to pfnProgress.
Returns
CENone on success or CEFailure on a failure.
GDAL.gdalgcpstogeotransform
— MethodGDALGCPsToGeoTransform(int nGCPCount,
const GDAL_GCP * pasGCPs,
double * padfGeoTransform,
int bApproxOK) -> int
Generate Geotransform from GCPs.
Parameters
- 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.
Returns
TRUE on success or FALSE if there aren't enough points to prepare a geotransform, the pointers are ill-determined or if bApproxOK is FALSE and the fit is poor.
GDAL.gdalgcptransform
— MethodGDALGCPTransform(void * pTransformArg,
int bDstToSrc,
int nPointCount,
double * x,
double * y,
double * z,
int * panSuccess) -> int
Transforms point based on GCP derived polynomial model.
Parameters
- pTransformArg: return value from GDALCreateGCPTransformer().
- bDstToSrc: TRUE if transformation is from the destination (georeferenced) coordinates to pixel/line or FALSE when transforming from pixel/line to georeferenced coordinates.
- nPointCount: the number of values in the x, y and z arrays.
- x: array containing the X values to be transformed.
- y: array containing the Y values to be transformed.
- z: array containing the Z values to be transformed.
- panSuccess: array in which a flag indicating success (TRUE) or failure (FALSE) of the transformation are placed.
Returns
TRUE.
GDAL.gdalgeneralcmdlineprocessor
— MethodGDALGeneralCmdLineProcessor(int nArgc,
char *** ppapszArgv,
int nOptions) -> int
General utility option processing.
Parameters
- nArgc: number of values in the argument list.
- ppapszArgv: pointer to the argument list array (will be updated in place).
- nOptions: a or-able combination of GDALOFRASTER and GDALOFVECTOR to determine which drivers should be displayed by formats. If set to 0, GDALOFRASTER is assumed.
Returns
updated nArgc argument count. Return of 0 requests terminate without error, return of -1 requests exit with error code.
GDAL.gdalgenimgprojtransform
— MethodGDALGenImgProjTransform(void * pTransformArgIn,
int bDstToSrc,
int nPointCount,
double * padfX,
double * padfY,
double * padfZ,
int * panSuccess) -> int
Perform general image reprojection transformation.
GDAL.gdalgeoloctransform
— MethodGDALGeoLocTransform(void * pTransformArg,
int bDstToSrc,
int nPointCount,
double * padfX,
double * padfY,
double * padfZ,
int * panSuccess) -> int
Use GeoLocation transformer.
GDAL.gdalgetaccess
— MethodGDALGetAccess(GDALDatasetH hDS) -> int
Return access flag.
GDAL.gdalgetactualblocksize
— MethodGDALGetActualBlockSize(GDALRasterBandH hBand,
int nXBlockOff,
int nYBlockOff,
int * pnXValid,
int * pnYValid) -> CPLErr
Retrieve the actual block size for a given block offset.
GDAL.gdalgetasyncstatustypebyname
— MethodGDALGetAsyncStatusTypeByName(const char * pszName) -> GDALAsyncStatusType
Get AsyncStatusType by symbolic name.
Parameters
- pszName: string containing the symbolic name of the type.
Returns
GDAL AsyncStatus type.
GDAL.gdalgetasyncstatustypename
— MethodGDALGetAsyncStatusTypeName(GDALAsyncStatusType eAsyncStatusType) -> const char *
Get name of AsyncStatus data type.
Parameters
- eAsyncStatusType: type to get name of.
Returns
string corresponding to type.
GDAL.gdalgetbanddataset
— MethodGDALGetBandDataset(GDALRasterBandH hBand) -> GDALDatasetH
Fetch the owning dataset handle.
GDAL.gdalgetbandnumber
— MethodGDALGetBandNumber(GDALRasterBandH hBand) -> int
Fetch the band number.
GDAL.gdalgetblocksize
— MethodGDALGetBlockSize(GDALRasterBandH hBand,
int * pnXSize,
int * pnYSize) -> void
Fetch the "natural" block size of this band.
GDAL.gdalgetcachemax
— MethodGDALGetCacheMax() -> int
Get maximum cache memory.
Returns
maximum in bytes.
GDAL.gdalgetcachemax64
— MethodGDALGetCacheMax64() -> GIntBig
Get maximum cache memory.
Returns
maximum in bytes.
GDAL.gdalgetcacheused
— MethodGDALGetCacheUsed() -> int
Get cache memory used.
Returns
the number of bytes of memory currently in use by the GDALRasterBlock memory caching.
GDAL.gdalgetcacheused64
— MethodGDALGetCacheUsed64() -> GIntBig
Get cache memory used.
Returns
the number of bytes of memory currently in use by the GDALRasterBlock memory caching.
GDAL.gdalgetcolorentry
— MethodGDALGetColorEntry(GDALColorTableH hTable,
int i) -> const GDALColorEntry *
Fetch a color entry from table.
GDAL.gdalgetcolorentryasrgb
— MethodGDALGetColorEntryAsRGB(GDALColorTableH hTable,
int i,
GDALColorEntry * poEntry) -> int
Fetch a table entry in RGB format.
GDAL.gdalgetcolorentrycount
— MethodGDALGetColorEntryCount(GDALColorTableH hTable) -> int
Get number of color entries in table.
GDAL.gdalgetcolorinterpretationbyname
— MethodGDALGetColorInterpretationByName(const char * pszName) -> GDALColorInterp
Get color interpretation by symbolic name.
Parameters
- pszName: string containing the symbolic name of the color interpretation.
Returns
GDAL color interpretation.
GDAL.gdalgetcolorinterpretationname
— MethodGDALGetColorInterpretationName(GDALColorInterp eInterp) -> const char *
Get name of color interpretation.
Parameters
- eInterp: color interpretation to get name of.
Returns
string corresponding to color interpretation or NULL pointer if invalid enumerator given.
GDAL.gdalgetdatacoveragestatus
— MethodGDALGetDataCoverageStatus(GDALRasterBandH hBand,
int nXOff,
int nYOff,
int nXSize,
int nYSize,
int nMaskFlagStop,
double * pdfDataPct) -> int
Get the coverage status of a sub-window of the raster.
Parameters
- hBand: raster band
- nXOff: The pixel offset to the top left corner of the region of the band to be queried. 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 queried. This would be zero to start from the top.
- nXSize: The width of the region of the band to be queried in pixels.
- nYSize: The height of the region of the band to be queried in lines.
- nMaskFlagStop: 0, or a binary-or'ed mask of possible values GDALDATACOVERAGESTATUSUNIMPLEMENTED, GDALDATACOVERAGESTATUSDATA and GDALDATACOVERAGESTATUSEMPTY. As soon as the computation of the coverage matches the mask, the computation will be stopped. *pdfDataPct will not be valid in that case.
- pdfDataPct: Optional output parameter whose pointed value will be set to the (approximate) percentage in [0,100] of pixels in the queried sub-window that have valid values. The implementation might not always be able to compute it, in which case it will be set to a negative value.
Returns
a binary-or'ed combination of possible values GDALDATACOVERAGESTATUSUNIMPLEMENTED, GDALDATACOVERAGESTATUSDATA and GDALDATACOVERAGESTATUSEMPTY
GDAL.gdalgetdatasetdriver
— MethodGDALGetDatasetDriver(GDALDatasetH hDataset) -> GDALDriverH
Fetch the driver to which this dataset relates.
GDAL.gdalgetdatatypebyname
— MethodGDALGetDataTypeByName(const char * pszName) -> GDALDataType
Get data type by symbolic name.
Parameters
- pszName: string containing the symbolic name of the type.
Returns
GDAL data type.
GDAL.gdalgetdatatypename
— MethodGDALGetDataTypeName(GDALDataType eDataType) -> const char *
Get name of data type.
Parameters
- eDataType: type to get name of.
Returns
string corresponding to existing data type or NULL pointer if invalid type given.
GDAL.gdalgetdatatypesize
— MethodGDALGetDataTypeSize(GDALDataType eDataType) -> int
Get data type size in bits.
Parameters
- eDataType: type, such as GDT_Byte.
Returns
the number of bits or zero if it is not recognised.
GDAL.gdalgetdatatypesizebits
— MethodGDALGetDataTypeSizeBits(GDALDataType eDataType) -> int
Get data type size in bits.
Parameters
- eDataType: type, such as GDT_Byte.
Returns
the number of bits or zero if it is not recognised.
GDAL.gdalgetdatatypesizebytes
— MethodGDALGetDataTypeSizeBytes(GDALDataType eDataType) -> int
Get data type size in bytes.
Parameters
- eDataType: type, such as GDT_Byte.
Returns
the number of bytes or zero if it is not recognised.
GDAL.gdalgetdefaulthistogram
— MethodGDALGetDefaultHistogram(GDALRasterBandH hBand,
double * pdfMin,
double * pdfMax,
int * pnBuckets,
int ** ppanHistogram,
int bForce,
GDALProgressFunc pfnProgress,
void * pProgressData) -> CPLErr
Fetch default raster histogram.
GDAL.gdalgetdefaulthistogramex
— MethodGDALGetDefaultHistogramEx(GDALRasterBandH hBand,
double * pdfMin,
double * pdfMax,
int * pnBuckets,
GUIntBig ** ppanHistogram,
int bForce,
GDALProgressFunc pfnProgress,
void * pProgressData) -> CPLErr
Fetch default raster histogram.
GDAL.gdalgetdefaultrat
— MethodGDALGetDefaultRAT(GDALRasterBandH hBand) -> GDALRasterAttributeTableH
Fetch default Raster Attribute Table.
GDAL.gdalgetdescription
— MethodGDALGetDescription(GDALMajorObjectH hObject) -> const char *
Fetch object description.
GDAL.gdalgetdriver
— MethodGDALGetDriver(int iDriver) -> GDALDriverH
Fetch driver by index.
GDAL.gdalgetdriverbyname
— MethodGDALGetDriverByName(const char * pszName) -> GDALDriverH
Fetch a driver based on the short name.
GDAL.gdalgetdrivercount
— MethodGDALGetDriverCount() -> int
Fetch the number of registered drivers.
GDAL.gdalgetdrivercreationoptionlist
— MethodGDALGetDriverCreationOptionList(GDALDriverH hDriver) -> const char *
Return the list of creation options of the driver.
Parameters
- hDriver: the handle of the driver
Returns
an XML string that describes the list of creation options or empty string. The returned string should not be freed and is owned by the driver.
GDAL.gdalgetdriverhelptopic
— MethodGDALGetDriverHelpTopic(GDALDriverH hDriver) -> const char *
Return the URL to the help that describes the driver.
Parameters
- hDriver: the handle of the driver
Returns
the URL to the help that describes the driver or NULL. The returned string should not be freed and is owned by the driver.
GDAL.gdalgetdriverlongname
— MethodGDALGetDriverLongName(GDALDriverH hDriver) -> const char *
Return the long name of a driver.
Parameters
- hDriver: the handle of the driver
Returns
the long name of the driver or empty string. The returned string should not be freed and is owned by the driver.
GDAL.gdalgetdrivershortname
— MethodGDALGetDriverShortName(GDALDriverH hDriver) -> const char *
Return the short name of a driver.
Parameters
- hDriver: the handle of the driver
Returns
the short name of the driver. The returned string should not be freed and is owned by the driver.
GDAL.gdalgetfilelist
— MethodGDALGetFileList(GDALDatasetH hDS) -> char **
Fetch files forming dataset.
GDAL.gdalgetgcpcount
— MethodGDALGetGCPCount(GDALDatasetH hDS) -> int
Get number of GCPs.
GDAL.gdalgetgcpprojection
— MethodGDALGetGCPProjection(GDALDatasetH hDS) -> const char *
Get output projection for GCPs.
GDAL.gdalgetgcps
— MethodGDALGetGCPs(GDALDatasetH hDS) -> const GDAL_GCP *
Fetch GCPs.
GDAL.gdalgetgcpspatialref
— MethodGDALGetGCPSpatialRef(GDALDatasetH hDS) -> OGRSpatialReferenceH
Get output spatial reference system for GCPs.
GDAL.gdalgetgeotransform
— MethodGDALGetGeoTransform(GDALDatasetH hDS,
double * padfTransform) -> CPLErr
Fetch the affine transformation coefficients.
GDAL.gdalgetinternalhandle
— MethodGDALGetInternalHandle(GDALDatasetH hDS,
const char * pszRequest) -> void *
Fetch a format specific internally meaningful handle.
GDAL.gdalgetjpeg2000structure
— MethodGDALGetJPEG2000Structure(const char * pszFilename,
CSLConstList papszOptions) -> CPLXMLNode *
Dump the structure of a JPEG2000 file as a XML tree.
Parameters
- pszFilename: filename.
- papszOptions: NULL terminated list of options, or NULL. Allowed options are BINARYCONTENT=YES, TEXTCONTENT=YES, CODESTREAM=YES, ALL=YES, JP2BOXES=YES, CODESTREAMMARKERS=listofmarkernamescommaseparated, STOPATSOD=YES, ALLOWGETFILESIZE=NO.
Returns
XML tree (to be freed with CPLDestroyXMLNode()) or NULL in case of error
GDAL.gdalgetmaskband
— MethodGDALGetMaskBand(GDALRasterBandH hBand) -> GDALRasterBandH
Return the mask band associated with the band.
GDAL.gdalgetmaskflags
— MethodGDALGetMaskFlags(GDALRasterBandH hBand) -> int
Return the status flags of the mask band associated with the band.
GDAL.gdalgetmetadata
— MethodGDALGetMetadata(GDALMajorObjectH hObject,
const char * pszDomain) -> char **
Fetch metadata.
GDAL.gdalgetmetadatadomainlist
— MethodGDALGetMetadataDomainList(GDALMajorObjectH hObject) -> char **
Fetch list of metadata domains.
GDAL.gdalgetmetadataitem
— MethodGDALGetMetadataItem(GDALMajorObjectH hObject,
const char * pszName,
const char * pszDomain) -> const char *
Fetch single metadata item.
GDAL.gdalgetnodatareplacementvalue
— MethodGDALGetNoDataReplacementValue(GDALDataType dt,
double dfNoDataValue) -> double
Returns a replacement value for a nodata value or 0 if dfNoDataValue is out of range for the specified data type (dt).
Parameters
- dt: Data type
- dfNoDataValue: The no data value
GDAL.gdalgetnoncomplexdatatype
— MethodGDALGetNonComplexDataType(GDALDataType eDataType) -> GDALDataType
Return the base data type for the specified input.
Parameters
- eDataType: type, such as GDT_CFloat32.
Returns
GDAL data type.
GDAL.gdalgetopendatasets
— MethodGDALGetOpenDatasets(GDALDatasetH ** ppahDSList,
int * pnCount) -> void
Fetch all open GDAL dataset handles.
GDAL.gdalgetoutputdriversfordatasetname
— MethodGDALGetOutputDriversForDatasetName(const char * pszDestDataset,
int nFlagRasterVector,
bool bSingleMatch,
bool bEmitWarning) -> char **
Return a list of driver short names that are likely candidates for the provided output file name.
Parameters
- pszDestDataset: Output dataset name (might not exist).
- nFlagRasterVector: GDALOFRASTER, GDALOFVECTOR or binary-or'ed combination of both
- bSingleMatch: Whether a single match is desired, that is to say the returned list will contain at most one item, which will be the first driver in the order they are registered to match the output dataset name. Note that in this mode, if nFlagRasterVector==GDALOFRASTER and pszDestDataset has no extension, GTiff will be selected.
- bEmitWarning: Whether a warning should be emitted when bSingleMatch is true and there are more than 2 candidates.
Returns
NULL terminated list of driver short names. To be freed with CSLDestroy()
GDAL.gdalgetoverview
— MethodGDALGetOverview(GDALRasterBandH hBand,
int i) -> GDALRasterBandH
Fetch overview raster band object.
GDAL.gdalgetoverviewcount
— MethodGDALGetOverviewCount(GDALRasterBandH hBand) -> int
Return the number of overview layers available.
GDAL.gdalgetpaletteinterpretation
— MethodGDALGetPaletteInterpretation(GDALColorTableH hTable) -> GDALPaletteInterp
Fetch palette interpretation.
GDAL.gdalgetpaletteinterpretationname
— MethodGDALGetPaletteInterpretationName(GDALPaletteInterp eInterp) -> const char *
Get name of palette interpretation.
Parameters
- eInterp: palette interpretation to get name of.
Returns
string corresponding to palette interpretation.
GDAL.gdalgetprojectionref
— MethodGDALGetProjectionRef(GDALDatasetH hDS) -> const char *
Fetch the projection definition string for this dataset.
GDAL.gdalgetrandomrastersample
— MethodGDALGetRandomRasterSample(GDALRasterBandH hBand,
int nSamples,
float * pafSampleBuf) -> int
Undocumented.
Parameters
- hBand: undocumented.
- nSamples: undocumented.
- pafSampleBuf: undocumented.
Returns
undocumented
GDAL.gdalgetrasteraccess
— MethodGDALGetRasterAccess(GDALRasterBandH hBand) -> GDALAccess
Find out if we have update permission for this band.
GDAL.gdalgetrasterband
— MethodGDALGetRasterBand(GDALDatasetH hDS,
int nBandId) -> GDALRasterBandH
Fetch a band object for a dataset.
GDAL.gdalgetrasterbandxsize
— MethodGDALGetRasterBandXSize(GDALRasterBandH hBand) -> int
Fetch XSize of raster.
GDAL.gdalgetrasterbandysize
— MethodGDALGetRasterBandYSize(GDALRasterBandH hBand) -> int
Fetch YSize of raster.
GDAL.gdalgetrastercategorynames
— MethodGDALGetRasterCategoryNames(GDALRasterBandH hBand) -> char **
Fetch the list of category names for this raster.
GDAL.gdalgetrastercolorinterpretation
— MethodGDALGetRasterColorInterpretation(GDALRasterBandH hBand) -> GDALColorInterp
How should this band be interpreted as color?
GDAL.gdalgetrastercolortable
— MethodGDALGetRasterColorTable(GDALRasterBandH hBand) -> GDALColorTableH
Fetch the color table associated with band.
GDAL.gdalgetrastercount
— MethodGDALGetRasterCount(GDALDatasetH hDS) -> int
Fetch the number of raster bands on this dataset.
GDAL.gdalgetrasterdatatype
— MethodGDALGetRasterDataType(GDALRasterBandH hBand) -> GDALDataType
Fetch the pixel data type for this band.
GDAL.gdalgetrasterhistogram
— MethodGDALGetRasterHistogram(GDALRasterBandH hBand,
double dfMin,
double dfMax,
int nBuckets,
int * panHistogram,
int bIncludeOutOfRange,
int bApproxOK,
GDALProgressFunc pfnProgress,
void * pProgressData) -> CPLErr
Compute raster histogram.
GDAL.gdalgetrasterhistogramex
— MethodGDALGetRasterHistogramEx(GDALRasterBandH hBand,
double dfMin,
double dfMax,
int nBuckets,
GUIntBig * panHistogram,
int bIncludeOutOfRange,
int bApproxOK,
GDALProgressFunc pfnProgress,
void * pProgressData) -> CPLErr
Compute raster histogram.
GDAL.gdalgetrastermaximum
— MethodGDALGetRasterMaximum(GDALRasterBandH hBand,
int * pbSuccess) -> double
Fetch the maximum value for this band.
GDAL.gdalgetrasterminimum
— MethodGDALGetRasterMinimum(GDALRasterBandH hBand,
int * pbSuccess) -> double
Fetch the minimum value for this band.
GDAL.gdalgetrasternodatavalue
— MethodGDALGetRasterNoDataValue(GDALRasterBandH hBand,
int * pbSuccess) -> double
Fetch the no data value for this band.
GDAL.gdalgetrasternodatavalueasint64
— MethodGDALGetRasterNoDataValueAsInt64(GDALRasterBandH hBand,
int * pbSuccess) -> int64_t
Fetch the no data value for this band.
GDAL.gdalgetrasternodatavalueasuint64
— MethodGDALGetRasterNoDataValueAsUInt64(GDALRasterBandH hBand,
int * pbSuccess) -> uint64_t
Fetch the no data value for this band.
GDAL.gdalgetrasteroffset
— MethodGDALGetRasterOffset(GDALRasterBandH hBand,
int * pbSuccess) -> double
Fetch the raster value offset.
GDAL.gdalgetrastersampleoverview
— MethodGDALGetRasterSampleOverview(GDALRasterBandH hBand,
int nDesiredSamples) -> GDALRasterBandH
Fetch best sampling overview.
GDAL.gdalgetrastersampleoverviewex
— MethodGDALGetRasterSampleOverviewEx(GDALRasterBandH hBand,
GUIntBig nDesiredSamples) -> GDALRasterBandH
Fetch best sampling overview.
GDAL.gdalgetrasterscale
— MethodGDALGetRasterScale(GDALRasterBandH hBand,
int * pbSuccess) -> double
Fetch the raster value scale.
GDAL.gdalgetrasterstatistics
— MethodGDALGetRasterStatistics(GDALRasterBandH hBand,
int bApproxOK,
int bForce,
double * pdfMin,
double * pdfMax,
double * pdfMean,
double * pdfStdDev) -> CPLErr
Fetch image statistics.
GDAL.gdalgetrasterunittype
— MethodGDALGetRasterUnitType(GDALRasterBandH hBand) -> const char *
Return raster unit type.
GDAL.gdalgetrasterxsize
— MethodGDALGetRasterXSize(GDALDatasetH hDataset) -> int
Fetch raster width in pixels.
GDAL.gdalgetrasterysize
— MethodGDALGetRasterYSize(GDALDatasetH hDataset) -> int
Fetch raster height in pixels.
GDAL.gdalgetspatialref
— MethodGDALGetSpatialRef(GDALDatasetH hDS) -> OGRSpatialReferenceH
Fetch the spatial reference for this dataset.
GDAL.gdalgetsubdatasetinfo
— Methodgdalgetsubdatasetinfo(pszFileName)
Returns a new GDALSubdatasetInfo
object with methods to extract and manipulate subdataset information. If the pszFileName argument is not recognized by any driver as a subdataset descriptor, NULL is returned. The returned object must be freed with GDALDestroySubdatasetInfo
().
This method does not check if the subdataset actually exists.
\since GDAL 3.8
Arguments
pszFileName
: File name with subdataset information
Returns
Opaque pointer to a GDALSubdatasetInfo
object or NULL if no drivers accepted the file name.
GDAL.gdalgettransformerdstgeotransform
— MethodGDALGetTransformerDstGeoTransform(void * pTransformArg,
double * padfGeoTransform) -> void
Get ApproxTransformer or GenImgProj output geotransform.
Parameters
- pTransformArg: transformer handle.
- padfGeoTransform: (output) the destination geotransform to return (six doubles).
GDAL.gdalgetvirtualmemauto
— MethodGDALGetVirtualMemAuto(GDALRasterBandH hBand,
GDALRWFlag eRWFlag,
int * pnPixelSpace,
GIntBig * pnLineSpace,
CSLConstList papszOptions) -> CPLVirtualMem *
Create a CPLVirtualMem object from a GDAL raster band object.
GDAL.gdalgrid
— MethodGDALGrid(const char * pszDest,
GDALDatasetH hSrcDataset,
const GDALGridOptions * psOptionsIn,
int * pbUsageError) -> GDALDatasetH
Create raster from the scattered data.
Parameters
- pszDest: the destination dataset path.
- hSrcDataset: the source dataset handle.
- psOptionsIn: the options struct returned by GDALGridOptionsNew() or NULL.
- pbUsageError: pointer to a integer output variable to store if any usage error has occurred or NULL.
Returns
the output dataset (new dataset that must be closed using GDALClose()) or NULL in case of error.
GDAL.gdalgridcontextcreate
— MethodGDALGridContextCreate(GDALGridAlgorithm eAlgorithm,
const void * poOptions,
GUInt32 nPoints,
const double * padfX,
const double * padfY,
const double * padfZ,
int bCallerWillKeepPointArraysAlive) -> GDALGridContext *
Creates a context to do regular gridding from the scattered data.
Parameters
- eAlgorithm: Gridding method.
- poOptions: Options to control chosen gridding method.
- nPoints: Number of elements in input arrays.
- padfX: Input array of X coordinates.
- padfY: Input array of Y coordinates.
- padfZ: Input array of Z values.
- bCallerWillKeepPointArraysAlive: Whether the provided padfX, padfY, padfZ arrays will still be "alive" during the calls to GDALGridContextProcess(). Setting to TRUE prevent them from being duplicated in the context. If unsure, set to FALSE.
Returns
the context (to be freed with GDALGridContextFree()) or NULL in case or error.
GDAL.gdalgridcontextfree
— MethodGDALGridContextFree(GDALGridContext * psContext) -> void
Free a context used created by GDALGridContextCreate()
Parameters
- psContext: the context.
GDAL.gdalgridcontextprocess
— MethodGDALGridContextProcess(GDALGridContext * psContext,
double dfXMin,
double dfXMax,
double dfYMin,
double dfYMax,
GUInt32 nXSize,
GUInt32 nYSize,
GDALDataType eType,
void * pData,
GDALProgressFunc pfnProgress,
void * pProgressArg) -> CPLErr
Do the gridding of a window of a raster.
Parameters
- psContext: Gridding context.
- dfXMin: Lowest X border of output grid.
- dfXMax: Highest X border of output grid.
- dfYMin: Lowest Y border of output grid.
- dfYMax: Highest Y border of output grid.
- nXSize: Number of columns in output grid.
- nYSize: Number of rows in output grid.
- eType: Data type of output array.
- pData: Pointer to array where the computed grid will be stored.
- pfnProgress: a GDALProgressFunc() compatible callback function for reporting progress or NULL.
- pProgressArg: argument to be passed to pfnProgress. May be NULL.
Returns
CENone on success or CEFailure if something goes wrong.
GDAL.gdalgridcreate
— MethodGDALGridCreate(GDALGridAlgorithm eAlgorithm,
const void * poOptions,
GUInt32 nPoints,
const double * padfX,
const double * padfY,
const double * padfZ,
double dfXMin,
double dfXMax,
double dfYMin,
double dfYMax,
GUInt32 nXSize,
GUInt32 nYSize,
GDALDataType eType,
void * pData,
GDALProgressFunc pfnProgress,
void * pProgressArg) -> CPLErr
Create regular grid from the scattered data.
Parameters
- eAlgorithm: Gridding method.
- poOptions: Options to control chosen gridding method.
- nPoints: Number of elements in input arrays.
- padfX: Input array of X coordinates.
- padfY: Input array of Y coordinates.
- padfZ: Input array of Z values.
- dfXMin: Lowest X border of output grid.
- dfXMax: Highest X border of output grid.
- dfYMin: Lowest Y border of output grid.
- dfYMax: Highest Y border of output grid.
- nXSize: Number of columns in output grid.
- nYSize: Number of rows in output grid.
- eType: Data type of output array.
- pData: Pointer to array where the computed grid will be stored.
- pfnProgress: a GDALProgressFunc() compatible callback function for reporting progress or NULL.
- pProgressArg: argument to be passed to pfnProgress. May be NULL.
Returns
CENone on success or CEFailure if something goes wrong.
GDAL.gdalgridoptionsfree
— MethodGDALGridOptionsFree(GDALGridOptions * psOptions) -> void
Frees the GDALGridOptions struct.
Parameters
- psOptions: the options struct for GDALGrid().
GDAL.gdalgridoptionsnew
— MethodGDALGridOptionsNew(char ** papszArgv,
GDALGridOptionsForBinary * psOptionsForBinary) -> GDALGridOptions *
Allocates a GDALGridOptions struct.
Parameters
- papszArgv: NULL terminated list of options (potentially including filename and open options too), or NULL. The accepted options are the ones of the gdal_translate utility.
- psOptionsForBinary: (output) may be NULL (and should generally be NULL), otherwise (gdaltranslatebin.cpp use case) must be allocated with GDALGridOptionsForBinaryNew() prior to this function. Will be filled with potentially present filename, open options,...
Returns
pointer to the allocated GDALGridOptions struct. Must be freed with GDALGridOptionsFree().
GDAL.gdalgridoptionssetprogress
— MethodGDALGridOptionsSetProgress(GDALGridOptions * psOptions,
GDALProgressFunc pfnProgress,
void * pProgressData) -> void
Set a progress function.
Parameters
- psOptions: the options struct for GDALGrid().
- pfnProgress: the progress callback.
- pProgressData: the user data for the progress callback.
GDAL.gdalgroupcreateattribute
— MethodGDALGroupCreateAttribute(GDALGroupH hGroup,
const char * pszName,
size_t nDimensions,
const GUInt64 * panDimensions,
GDALExtendedDataTypeH hEDT,
CSLConstList papszOptions) -> GDALAttributeH
Create a attribute within a group.
Returns
the attribute, to be freed with GDALAttributeRelease(), or nullptr.
GDAL.gdalgroupcreatedimension
— MethodGDALGroupCreateDimension(GDALGroupH hGroup,
const char * pszName,
const char * pszType,
const char * pszDirection,
GUInt64 nSize,
CSLConstList papszOptions) -> GDALDimensionH
Create a dimension within a group.
Returns
the dimension, to be freed with GDALDimensionRelease(), or nullptr.
GDAL.gdalgroupcreategroup
— MethodGDALGroupCreateGroup(GDALGroupH hGroup,
const char * pszSubGroupName,
CSLConstList papszOptions) -> GDALGroupH
Create a sub-group within a group.
Returns
the sub-group, to be freed with GDALGroupRelease(), or nullptr.
GDAL.gdalgroupcreatemdarray
— MethodGDALGroupCreateMDArray(GDALGroupH hGroup,
const char * pszName,
size_t nDimensions,
GDALDimensionH * pahDimensions,
GDALExtendedDataTypeH hEDT,
CSLConstList papszOptions) -> GDALMDArrayH
Create a multidimensional array within a group.
Returns
the array, to be freed with GDALMDArrayRelease(), or nullptr.
GDAL.gdalgroupdeleteattribute
— MethodGDALGroupDeleteAttribute(GDALGroupH hGroup,
const char * pszName,
CSLConstList papszOptions) -> bool
Delete an attribute from a group.
Returns
true in case of success.
GDAL.gdalgroupdeletegroup
— MethodGDALGroupDeleteGroup(GDALGroupH hGroup,
const char * pszSubGroupName,
CSLConstList papszOptions) -> bool
Delete a sub-group from a group.
Returns
true in case of success.
GDAL.gdalgroupdeletemdarray
— MethodGDALGroupDeleteMDArray(GDALGroupH hGroup,
const char * pszName,
CSLConstList papszOptions) -> bool
Delete an array from a group.
Returns
true in case of success.
GDAL.gdalgroupgetattribute
— MethodGDALGroupGetAttribute(GDALGroupH hGroup,
const char * pszName) -> GDALAttributeH
Return an attribute by its name.
GDAL.gdalgroupgetattributes
— MethodGDALGroupGetAttributes(GDALGroupH hGroup,
size_t * pnCount,
CSLConstList papszOptions) -> GDALAttributeH *
Return the list of attributes contained in this group.
Parameters
- hGroup: Group.
- pnCount: Pointer to the number of values returned. Must NOT be NULL.
- papszOptions: Driver specific options determining how attributes should be retrieved. Pass nullptr for default behavior.
Returns
an array of *pnCount attributes.
GDAL.gdalgroupgetdimensions
— MethodGDALGroupGetDimensions(GDALGroupH hGroup,
size_t * pnCount,
CSLConstList papszOptions) -> GDALDimensionH *
Return the list of dimensions contained in this group and used by its arrays.
Parameters
- hGroup: Group.
- pnCount: Pointer to the number of values returned. Must NOT be NULL.
- papszOptions: Driver specific options determining how dimensions should be retrieved. Pass nullptr for default behavior.
Returns
an array of *pnCount dimensions.
GDAL.gdalgroupgetfullname
— MethodGDALGroupGetFullName(GDALGroupH hGroup) -> const char *
Return the full name of the group.
GDAL.gdalgroupgetgroupnames
— MethodGDALGroupGetGroupNames(GDALGroupH hGroup,
CSLConstList papszOptions) -> char **
Return the list of sub-groups contained in this group.
Returns
the group names, to be freed with CSLDestroy()
GDAL.gdalgroupgetmdarraynames
— MethodGDALGroupGetMDArrayNames(GDALGroupH hGroup,
CSLConstList papszOptions) -> char **
Return the list of multidimensional array names contained in this group.
Returns
the array names, to be freed with CSLDestroy()
GDAL.gdalgroupgetname
— MethodGDALGroupGetName(GDALGroupH hGroup) -> const char *
Return the name of the group.
GDAL.gdalgroupgetstructuralinfo
— MethodGDALGroupGetStructuralInfo(GDALGroupH hGroup) -> CSLConstList
Return structural information on the group.
GDAL.gdalgroupgetvectorlayernames
— MethodGDALGroupGetVectorLayerNames(GDALGroupH hGroup,
CSLConstList papszOptions) -> char **
Return the list of layer names contained in this group.
Returns
the group names, to be freed with CSLDestroy()
GDAL.gdalgroupopengroup
— MethodGDALGroupOpenGroup(GDALGroupH hGroup,
const char * pszSubGroupName,
CSLConstList papszOptions) -> GDALGroupH
Open and return a sub-group.
Returns
the sub-group, to be freed with GDALGroupRelease(), or nullptr.
GDAL.gdalgroupopengroupfromfullname
— MethodGDALGroupOpenGroupFromFullname(GDALGroupH hGroup,
const char * pszFullname,
CSLConstList papszOptions) -> GDALGroupH
Open and return a sub-group from its fully qualified name.
Returns
the sub-group, to be freed with GDALGroupRelease(), or nullptr.
GDAL.gdalgroupopenmdarray
— MethodGDALGroupOpenMDArray(GDALGroupH hGroup,
const char * pszMDArrayName,
CSLConstList papszOptions) -> GDALMDArrayH
Open and return a multidimensional array.
Returns
the array, to be freed with GDALMDArrayRelease(), or nullptr.
GDAL.gdalgroupopenmdarrayfromfullname
— MethodGDALGroupOpenMDArrayFromFullname(GDALGroupH hGroup,
const char * pszFullname,
CSLConstList papszOptions) -> GDALMDArrayH
Open and return a multidimensional array from its fully qualified name.
Returns
the array, to be freed with GDALMDArrayRelease(), or nullptr.
GDAL.gdalgroupopenvectorlayer
— MethodGDALGroupOpenVectorLayer(GDALGroupH hGroup,
const char * pszVectorLayerName,
CSLConstList papszOptions) -> OGRLayerH
Open and return a vector layer.
Returns
the vector layer, or nullptr.
GDAL.gdalgrouprelease
— MethodGDALGroupRelease(GDALGroupH hGroup) -> void
Release the GDAL in-memory object associated with a GDALGroupH.
GDAL.gdalgrouprename
— MethodGDALGroupRename(GDALGroupH hGroup,
const char * pszNewName) -> bool
Rename the group.
Returns
true in case of success
GDAL.gdalgroupresolvemdarray
— MethodGDALGroupResolveMDArray(GDALGroupH hGroup,
const char * pszName,
const char * pszStartingPoint,
CSLConstList papszOptions) -> GDALMDArrayH
Locate an array in a group and its subgroups by name.
GDAL.gdalgroupsubsetdimensionfromselection
— MethodGDALGroupSubsetDimensionFromSelection(GDALGroupH hGroup,
const char * pszSelection,
CSLConstList papszOptions) -> GDALGroupH
Return a virtual group whose one dimension has been subset according to a selection.
Returns
a virtual group, to be freed with GDALGroupRelease(), or nullptr.
GDAL.gdalhasarbitraryoverviews
— MethodGDALHasArbitraryOverviews(GDALRasterBandH hBand) -> int
Check for arbitrary overviews.
GDAL.gdalhastriangulation
— MethodGDALHasTriangulation() -> int
Returns if GDAL is built with Delaunay triangulation support.
Returns
TRUE if GDAL is built with Delaunay triangulation support.
GDAL.gdalidentifydriver
— MethodGDALIdentifyDriver(const char * pszFilename,
CSLConstList papszFileList) -> GDALDriverH
Identify the driver that can open a dataset.
Parameters
- 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.
Returns
A GDALDriverH handle or NULL on failure. For C++ applications this handle can be cast to a GDALDriver *.
GDAL.gdalidentifydriverex
— MethodGDALIdentifyDriverEx(const char * pszFilename,
unsigned int nIdentifyFlags,
const char *const * papszAllowedDrivers,
const char *const * papszFileList) -> GDALDriverH
Identify the driver that can open a dataset.
Parameters
- 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.
- nIdentifyFlags: a combination of GDALOFRASTER for raster drivers or GDALOFVECTOR for vector drivers. If none of the value is specified, both kinds are implied.
- papszAllowedDrivers: NULL to consider all candidate drivers, or a NULL terminated list of strings with the driver short names that must be considered.
- 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.
Returns
A GDALDriverH handle or NULL on failure. For C++ applications this handle can be cast to a GDALDriver *.
GDAL.gdalinfo
— MethodGDALInfo(GDALDatasetH hDataset,
const GDALInfoOptions * psOptions) -> char *
Lists various information about a GDAL supported raster dataset.
Parameters
- hDataset: the dataset handle.
- psOptions: the options structure returned by GDALInfoOptionsNew() or NULL.
Returns
string corresponding to the information about the raster dataset (must be freed with CPLFree()), or NULL in case of error.
GDAL.gdalinfooptionsfree
— MethodGDALInfoOptionsFree(GDALInfoOptions * psOptions) -> void
Frees the GDALInfoOptions struct.
Parameters
- psOptions: the options struct for GDALInfo().
GDAL.gdalinfooptionsnew
— MethodGDALInfoOptionsNew(char ** papszArgv,
GDALInfoOptionsForBinary * psOptionsForBinary) -> GDALInfoOptions *
Allocates a GDALInfoOptions struct.
Parameters
- papszArgv: NULL terminated list of options (potentially including filename and open options too), or NULL. The accepted options are the ones of the gdalinfo utility.
- psOptionsForBinary: (output) may be NULL (and should generally be NULL), otherwise (gdalinfo_bin.cpp use case) must be allocated with GDALInfoOptionsForBinaryNew() prior to this function. Will be filled with potentially present filename, open options, subdataset number...
Returns
pointer to the allocated GDALInfoOptions struct. Must be freed with GDALInfoOptionsFree().
GDAL.gdalinitgcps
— MethodGDALInitGCPs(int nCount,
GDAL_GCP * psGCP) -> void
Initialize an array of GCPs.
Parameters
- nCount: number of GCPs in psGCP
- psGCP: array of GCPs of size nCount.
GDAL.gdalinitializewarpedvrt
— MethodGDALInitializeWarpedVRT(GDALDatasetH hDS,
GDALWarpOptions * psWO) -> CPLErr
Set warp info on virtual warped dataset.
Parameters
- hDS: dataset previously created with the VRT driver, and a SUBCLASS of "VRTWarpedDataset".
- psWO: the warp options to apply. Note that ownership of the transformation information is taken over by the function though everything else remains the property of the caller.
Returns
CENone on success or CEFailure if an error occurs.
GDAL.gdalinvgeotransform
— MethodGDALInvGeoTransform(const double * gt_in,
double * gt_out) -> int
Invert Geotransform.
Parameters
- gt_in: Input geotransform (six doubles - unaltered).
- gt_out: Output geotransform (six doubles - updated).
Returns
TRUE on success or FALSE if the equation is uninvertable.
GDAL.gdalislineofsightvisible
— MethodGDALIsLineOfSightVisible(const GDALRasterBandH hBand,
const int xA,
const int yA,
const double zA,
const int xB,
const int yB,
const double zB,
int * pnxTerrainIntersection,
int * pnyTerrainIntersection,
CSLConstList papszOptions) -> bool
Check Line of Sight between two points.
Parameters
- hBand: The band to read the DEM data from. This must NOT be null.
- xA: The X location (raster column) of the first point to check on the raster.
- yA: The Y location (raster row) of the first point to check on the raster.
- zA: The Z location (height) of the first point to check.
- xB: The X location (raster column) of the second point to check on the raster.
- yB: The Y location (raster row) of the second point to check on the raster.
- zB: The Z location (height) of the second point to check.
- pnxTerrainIntersection: The X location where the LOS line intersects with terrain, or nullptr if it does not intersect terrain.
- pnyTerrainIntersection: The Y location where the LOS line intersects with terrain, or nullptr if it does not intersect terrain.
- papszOptions: Options for the line of sight algorithm (currently ignored).
Returns
True if the two points are within Line of Sight.
GDAL.gdalismaskband
— MethodGDALIsMaskBand(GDALRasterBandH hBand) -> bool
Returns whether a band is a mask band.
Returns
true if the band is a mask band.
GDAL.gdaljl_errorhandler
— MethodThe custom GDAL error handling function that we set in init
This function will get called by GDAL itself when it decides it wants to throw an error. We turn the error into a GDALError and throw it from Julia. This allows us to get GDALErrors that look similar to the ones that we throw when our own error checking code decides it should throw.
GDAL.gdalloadozimapfile
— MethodGDALLoadOziMapFile(const char * pszFilename,
double * padfGeoTransform,
char ** ppszWKT,
int * pnGCPCount,
GDAL_GCP ** ppasGCPs) -> int
Helper function for translator implementer wanting support for OZI .map.
Parameters
- pszFilename: filename of .tab file
- padfGeoTransform: output geotransform. Must hold 6 doubles.
- ppszWKT: output pointer to a string that will be allocated with CPLMalloc().
- pnGCPCount: output pointer to GCP count.
- ppasGCPs: outputer pointer to an array of GCPs.
Returns
TRUE in case of success, FALSE otherwise.
GDAL.gdalloadtabfile
— MethodGDALLoadTabFile(const char * pszFilename,
double * padfGeoTransform,
char ** ppszWKT,
int * pnGCPCount,
GDAL_GCP ** ppasGCPs) -> int
Helper function for translator implementer wanting support for MapInfo .tab files.
Parameters
- pszFilename: filename of .tab
- padfGeoTransform: output geotransform. Must hold 6 doubles.
- ppszWKT: output pointer to a string that will be allocated with CPLMalloc().
- pnGCPCount: output pointer to GCP count.
- ppasGCPs: outputer pointer to an array of GCPs.
Returns
TRUE in case of success, FALSE otherwise.
GDAL.gdalloadworldfile
— MethodGDALLoadWorldFile(const char * pszFilename,
double * padfGeoTransform) -> int
Read ESRI world file.
Parameters
- pszFilename: the world file name.
- padfGeoTransform: the six double array into which the geotransformation should be placed.
Returns
TRUE on success or FALSE on failure.
GDAL.gdalmdarrayadviseread
— MethodGDALMDArrayAdviseRead(GDALMDArrayH hArray,
const GUInt64 * arrayStartIdx,
const size_t * count) -> int
Advise driver of upcoming read requests.
Returns
TRUE in case of success.
GDAL.gdalmdarrayadvisereadex
— MethodGDALMDArrayAdviseReadEx(GDALMDArrayH hArray,
const GUInt64 * arrayStartIdx,
const size_t * count,
CSLConstList papszOptions) -> int
Advise driver of upcoming read requests.
Returns
TRUE in case of success.
GDAL.gdalmdarrayasclassicdataset
— MethodGDALMDArrayAsClassicDataset(GDALMDArrayH hArray,
size_t iXDim,
size_t iYDim) -> GDALDatasetH
Return a view of this array as a "classic" GDALDataset (ie 2D)
Parameters
- hArray: Array.
- iXDim: Index of the dimension that will be used as the X/width axis.
- iYDim: Index of the dimension that will be used as the Y/height axis.
Returns
a new GDALDataset that must be freed with GDALClose(), or nullptr
GDAL.gdalmdarrayasclassicdatasetex
— MethodGDALMDArrayAsClassicDatasetEx(GDALMDArrayH hArray,
size_t iXDim,
size_t iYDim,
GDALGroupH hRootGroup,
CSLConstList papszOptions) -> GDALDatasetH
Return a view of this array as a "classic" GDALDataset (ie 2D)
Parameters
- hArray: Array.
- iXDim: Index of the dimension that will be used as the X/width axis.
- iYDim: Index of the dimension that will be used as the Y/height axis. Ignored if the dimension count is 1.
- hRootGroup: Root group, or NULL. Used with the BAND_METADATA option.
- papszOptions: Cf GDALMDArray::AsClassicDataset()
Returns
a new GDALDataset that must be freed with GDALClose(), or nullptr
GDAL.gdalmdarraycache
— MethodGDALMDArrayCache(GDALMDArrayH hArray,
CSLConstList papszOptions) -> int
Cache the content of the array into an auxiliary filename.
GDAL.gdalmdarraycomputestatistics
— MethodGDALMDArrayComputeStatistics(GDALMDArrayH hArray,
GDALDatasetH,
int bApproxOK,
double * pdfMin,
double * pdfMax,
double * pdfMean,
double * pdfStdDev,
GUInt64 * pnValidCount,
GDALProgressFunc pfnProgress,
void * pProgressData) -> int
Compute statistics.
GDAL.gdalmdarraycomputestatisticsex
— MethodGDALMDArrayComputeStatisticsEx(GDALMDArrayH hArray,
GDALDatasetH,
int bApproxOK,
double * pdfMin,
double * pdfMax,
double * pdfMean,
double * pdfStdDev,
GUInt64 * pnValidCount,
GDALProgressFunc pfnProgress,
void * pProgressData,
CSLConstList papszOptions) -> int
Compute statistics.
GDAL.gdalmdarraycreateattribute
— MethodGDALMDArrayCreateAttribute(GDALMDArrayH hArray,
const char * pszName,
size_t nDimensions,
const GUInt64 * panDimensions,
GDALExtendedDataTypeH hEDT,
CSLConstList papszOptions) -> GDALAttributeH
Create a attribute within an array.
Returns
the attribute, to be freed with GDALAttributeRelease(), or nullptr.
GDAL.gdalmdarraydeleteattribute
— MethodGDALMDArrayDeleteAttribute(GDALMDArrayH hArray,
const char * pszName,
CSLConstList papszOptions) -> bool
Delete an attribute from an array.
Returns
true in case of success.
GDAL.gdalmdarraygetattribute
— MethodGDALMDArrayGetAttribute(GDALMDArrayH hArray,
const char * pszName) -> GDALAttributeH
Return an attribute by its name.
GDAL.gdalmdarraygetattributes
— MethodGDALMDArrayGetAttributes(GDALMDArrayH hArray,
size_t * pnCount,
CSLConstList papszOptions) -> GDALAttributeH *
Return the list of attributes contained in this array.
Parameters
- hArray: Array.
- pnCount: Pointer to the number of values returned. Must NOT be NULL.
- papszOptions: Driver specific options determining how attributes should be retrieved. Pass nullptr for default behavior.
Returns
an array of *pnCount attributes.
GDAL.gdalmdarraygetblocksize
— MethodGDALMDArrayGetBlockSize(GDALMDArrayH hArray,
size_t * pnCount) -> GUInt64 *
Return the "natural" block size of the array along all dimensions.
Returns
the block size, in number of elements along each dimension.
GDAL.gdalmdarraygetcoordinatevariables
— MethodGDALMDArrayGetCoordinateVariables(GDALMDArrayH hArray,
size_t * pnCount) -> GDALMDArrayH *
Return coordinate variables.
Parameters
- hArray: Array.
- pnCount: Pointer to the number of values returned. Must NOT be NULL.
Returns
an array of *pnCount arrays.
GDAL.gdalmdarraygetdatatype
— MethodGDALMDArrayGetDataType(GDALMDArrayH hArray) -> GDALExtendedDataTypeH
Return the data type.
GDAL.gdalmdarraygetdimensioncount
— MethodGDALMDArrayGetDimensionCount(GDALMDArrayH hArray) -> size_t
Return the number of dimensions.
GDAL.gdalmdarraygetdimensions
— MethodGDALMDArrayGetDimensions(GDALMDArrayH hArray,
size_t * pnCount) -> GDALDimensionH *
Return the dimensions of the array.
Parameters
- hArray: Array.
- pnCount: Pointer to the number of values returned. Must NOT be NULL.
Returns
an array of *pnCount dimensions.
GDAL.gdalmdarraygetfullname
— MethodGDALMDArrayGetFullName(GDALMDArrayH hArray) -> const char *
Return array full name.
GDAL.gdalmdarraygetgridded
— MethodGDALMDArrayGetGridded(GDALMDArrayH hArray,
const char * pszGridOptions,
GDALMDArrayH hXArray,
GDALMDArrayH hYArray,
CSLConstList papszOptions) -> GDALMDArrayH
Return a gridded array from scattered point data, that is from an array whose last dimension is the indexing variable of X and Y arrays.
GDAL.gdalmdarraygetmask
— MethodGDALMDArrayGetMask(GDALMDArrayH hArray,
CSLConstList papszOptions) -> GDALMDArrayH
Return an array that is a mask for the current array.
GDAL.gdalmdarraygetname
— MethodGDALMDArrayGetName(GDALMDArrayH hArray) -> const char *
Return array name.
GDAL.gdalmdarraygetnodatavalueasdouble
— MethodGDALMDArrayGetNoDataValueAsDouble(GDALMDArrayH hArray,
int * pbHasNoDataValue) -> double
Return the nodata value as a double.
Parameters
- hArray: Array handle.
- pbHasNoDataValue: Pointer to a output boolean that will be set to true if a nodata value exists and can be converted to double. Might be nullptr.
Returns
the nodata value as a double. A 0.0 value might also indicate the absence of a nodata value or an error in the conversion (*pbHasNoDataValue will be set to false then).
GDAL.gdalmdarraygetnodatavalueasint64
— MethodGDALMDArrayGetNoDataValueAsInt64(GDALMDArrayH hArray,
int * pbHasNoDataValue) -> int64_t
Return the nodata value as a Int64.
Parameters
- hArray: Array handle.
- pbHasNoDataValue: Pointer to a output boolean that will be set to true if a nodata value exists and can be converted to Int64. Might be nullptr.
Returns
the nodata value as a Int64.
GDAL.gdalmdarraygetnodatavalueasuint64
— MethodGDALMDArrayGetNoDataValueAsUInt64(GDALMDArrayH hArray,
int * pbHasNoDataValue) -> uint64_t
Return the nodata value as a UInt64.
Parameters
- hArray: Array handle.
- pbHasNoDataValue: Pointer to a output boolean that will be set to true if a nodata value exists and can be converted to UInt64. Might be nullptr.
Returns
the nodata value as a UInt64.
GDAL.gdalmdarraygetoffset
— MethodGDALMDArrayGetOffset(GDALMDArrayH hArray,
int * pbHasValue) -> double
Get the scale value to apply to raw values.
Returns
the scale value
GDAL.gdalmdarraygetoffsetex
— MethodGDALMDArrayGetOffsetEx(GDALMDArrayH hArray,
int * pbHasValue,
GDALDataType * peStorageType) -> double
Get the scale value to apply to raw values.
Returns
the scale value
GDAL.gdalmdarraygetprocessingchunksize
— MethodGDALMDArrayGetProcessingChunkSize(GDALMDArrayH hArray,
size_t * pnCount,
size_t nMaxChunkMemory) -> size_t *
Return an optimal chunk size for read/write operations, given the natural block size and memory constraints specified.
Parameters
- hArray: Array.
- pnCount: Pointer to the number of values returned. Must NOT be NULL.
- nMaxChunkMemory: Maximum amount of memory, in bytes, to use for the chunk.
Returns
the chunk size, in number of elements along each dimension.
GDAL.gdalmdarraygetrawnodatavalue
— MethodGDALMDArrayGetRawNoDataValue(GDALMDArrayH hArray) -> const void *
Return the nodata value as a "raw" value.
Returns
nullptr or a pointer to GetDataType().GetSize() bytes.
GDAL.gdalmdarraygetresampled
— MethodGDALMDArrayGetResampled(GDALMDArrayH hArray,
size_t nNewDimCount,
const GDALDimensionH * pahNewDims,
GDALRIOResampleAlg resampleAlg,
OGRSpatialReferenceH hTargetSRS,
CSLConstList papszOptions) -> GDALMDArrayH
Return an array that is a resampled / reprojected view of the current array.
GDAL.gdalmdarraygetscale
— MethodGDALMDArrayGetScale(GDALMDArrayH hArray,
int * pbHasValue) -> double
Get the scale value to apply to raw values.
Returns
the scale value
GDAL.gdalmdarraygetscaleex
— MethodGDALMDArrayGetScaleEx(GDALMDArrayH hArray,
int * pbHasValue,
GDALDataType * peStorageType) -> double
Get the scale value to apply to raw values.
Returns
the scale value
GDAL.gdalmdarraygetspatialref
— MethodGDALMDArrayGetSpatialRef(GDALMDArrayH hArray) -> OGRSpatialReferenceH
Return the spatial reference system object associated with the array.
GDAL.gdalmdarraygetstatistics
— MethodGDALMDArrayGetStatistics(GDALMDArrayH hArray,
GDALDatasetH,
int bApproxOK,
int bForce,
double * pdfMin,
double * pdfMax,
double * pdfMean,
double * pdfStdDev,
GUInt64 * pnValidCount,
GDALProgressFunc pfnProgress,
void * pProgressData) -> CPLErr
Fetch statistics.
GDAL.gdalmdarraygetstructuralinfo
— MethodGDALMDArrayGetStructuralInfo(GDALMDArrayH hArray) -> CSLConstList
Return structural information on the array.
GDAL.gdalmdarraygettotalelementscount
— MethodGDALMDArrayGetTotalElementsCount(GDALMDArrayH hArray) -> GUInt64
Return the total number of values in the array.
GDAL.gdalmdarraygetunit
— MethodGDALMDArrayGetUnit(GDALMDArrayH hArray) -> const char *
Return the array unit.
GDAL.gdalmdarraygetunscaled
— MethodGDALMDArrayGetUnscaled(GDALMDArrayH hArray) -> GDALMDArrayH
Return an array that is the unscaled version of the current one.
GDAL.gdalmdarraygetview
— MethodGDALMDArrayGetView(GDALMDArrayH hArray,
const char * pszViewExpr) -> GDALMDArrayH
Return a view of the array using slicing or field access.
GDAL.gdalmdarrayread
— MethodGDALMDArrayRead(GDALMDArrayH hArray,
const GUInt64 * arrayStartIdx,
const size_t * count,
const GInt64 * arrayStep,
const GPtrDiff_t * bufferStride,
GDALExtendedDataTypeH bufferDataType,
void * pDstBuffer,
const void * pDstBufferAllocStart,
size_t nDstBufferAllocSize) -> int
Read part or totality of a multidimensional array.
Returns
TRUE in case of success.
GDAL.gdalmdarrayrelease
— MethodGDALMDArrayRelease(GDALMDArrayH hMDArray) -> void
Release the GDAL in-memory object associated with a GDALMDArray.
GDAL.gdalmdarrayrename
— MethodGDALMDArrayRename(GDALMDArrayH hArray,
const char * pszNewName) -> bool
Rename the array.
Returns
true in case of success
GDAL.gdalmdarrayresize
— MethodGDALMDArrayResize(GDALMDArrayH hArray,
const GUInt64 * panNewDimSizes,
CSLConstList papszOptions) -> bool
Resize an array to new dimensions.
Parameters
- hArray: Array.
- panNewDimSizes: Array of GetDimensionCount() values containing the new size of each indexing dimension.
- papszOptions: Options. (Driver specific)
Returns
true in case of success.
GDAL.gdalmdarraysetnodatavalueasdouble
— MethodGDALMDArraySetNoDataValueAsDouble(GDALMDArrayH hArray,
double dfNoDataValue) -> int
Set the nodata value as a double.
Returns
TRUE in case of success.
GDAL.gdalmdarraysetnodatavalueasint64
— MethodGDALMDArraySetNoDataValueAsInt64(GDALMDArrayH hArray,
int64_t nNoDataValue) -> int
Set the nodata value as a Int64.
Returns
TRUE in case of success.
GDAL.gdalmdarraysetnodatavalueasuint64
— MethodGDALMDArraySetNoDataValueAsUInt64(GDALMDArrayH hArray,
uint64_t nNoDataValue) -> int
Set the nodata value as a UInt64.
Returns
TRUE in case of success.
GDAL.gdalmdarraysetoffset
— MethodGDALMDArraySetOffset(GDALMDArrayH hArray,
double dfOffset) -> int
Set the scale value to apply to raw values.
Returns
TRUE in case of success.
GDAL.gdalmdarraysetoffsetex
— MethodGDALMDArraySetOffsetEx(GDALMDArrayH hArray,
double dfOffset,
GDALDataType eStorageType) -> int
Set the scale value to apply to raw values.
Returns
TRUE in case of success.
GDAL.gdalmdarraysetrawnodatavalue
— MethodGDALMDArraySetRawNoDataValue(GDALMDArrayH hArray,
const void * pNoData) -> int
Set the nodata value as a "raw" value.
Returns
TRUE in case of success.
GDAL.gdalmdarraysetscale
— MethodGDALMDArraySetScale(GDALMDArrayH hArray,
double dfScale) -> int
Set the scale value to apply to raw values.
Returns
TRUE in case of success.
GDAL.gdalmdarraysetscaleex
— MethodGDALMDArraySetScaleEx(GDALMDArrayH hArray,
double dfScale,
GDALDataType eStorageType) -> int
Set the scale value to apply to raw values.
Returns
TRUE in case of success.
GDAL.gdalmdarraysetspatialref
— MethodGDALMDArraySetSpatialRef(GDALMDArrayH hArray,
OGRSpatialReferenceH hSRS) -> int
Assign a spatial reference system object to the array.
Returns
TRUE in case of success.
GDAL.gdalmdarraysetunit
— MethodGDALMDArraySetUnit(GDALMDArrayH hArray,
const char * pszUnit) -> int
Set the variable unit.
Parameters
- hArray: array.
- pszUnit: unit name.
Returns
TRUE in case of success.
GDAL.gdalmdarraytranspose
— MethodGDALMDArrayTranspose(GDALMDArrayH hArray,
size_t nNewAxisCount,
const int * panMapNewAxisToOldAxis) -> GDALMDArrayH
Return a view of the array whose axis have been reordered.
GDAL.gdalmdarraywrite
— MethodGDALMDArrayWrite(GDALMDArrayH hArray,
const GUInt64 * arrayStartIdx,
const size_t * count,
const GInt64 * arrayStep,
const GPtrDiff_t * bufferStride,
GDALExtendedDataTypeH bufferDataType,
const void * pSrcBuffer,
const void * pSrcBufferAllocStart,
size_t nSrcBufferAllocSize) -> int
Write part or totality of a multidimensional array.
Returns
TRUE in case of success.
GDAL.gdalmultidiminfo
— MethodGDALMultiDimInfo(GDALDatasetH hDataset,
const GDALMultiDimInfoOptions * psOptionsIn) -> char *
Lists various information about a GDAL multidimensional dataset.
Parameters
- hDataset: the dataset handle.
- psOptionsIn: the options structure returned by GDALMultiDimInfoOptionsNew() or NULL.
Returns
string corresponding to the information about the raster dataset (must be freed with CPLFree()), or NULL in case of error.
GDAL.gdalmultidiminfooptionsfree
— MethodGDALMultiDimInfoOptionsFree(GDALMultiDimInfoOptions * psOptions) -> void
Frees the GDALMultiDimInfoOptions struct.
Parameters
- psOptions: the options struct for GDALMultiDimInfo().
GDAL.gdalmultidiminfooptionsnew
— MethodGDALMultiDimInfoOptionsNew(char ** papszArgv,
GDALMultiDimInfoOptionsForBinary * psOptionsForBinary) -> GDALMultiDimInfoOptions *
Allocates a GDALMultiDimInfo struct.
Parameters
- papszArgv: NULL terminated list of options (potentially including filename and open options too), or NULL. The accepted options are the ones of the gdalmdiminfo utility.
- psOptionsForBinary: should be nullptr, unless called from gdalmultidiminfo_bin.cpp
Returns
pointer to the allocated GDALMultiDimInfoOptions struct. Must be freed with GDALMultiDimInfoOptionsFree().
GDAL.gdalmultidimtranslate
— MethodGDALMultiDimTranslate(const char * pszDest,
GDALDatasetH hDstDS,
int nSrcCount,
GDALDatasetH * pahSrcDS,
const GDALMultiDimTranslateOptions * psOptions,
int * pbUsageError) -> GDALDatasetH
Converts raster data between different formats.
Parameters
- pszDest: the destination dataset path or NULL.
- hDstDS: the destination dataset or NULL.
- nSrcCount: the number of input datasets.
- pahSrcDS: the list of input datasets.
- psOptions: the options struct returned by GDALMultiDimTranslateOptionsNew() or NULL.
- pbUsageError: pointer to a integer output variable to store if any usage error has occurred or NULL.
Returns
the output dataset (new dataset that must be closed using GDALClose(), or hDstDS is not NULL) or NULL in case of error.
GDAL.gdalmultidimtranslateoptionsfree
— MethodGDALMultiDimTranslateOptionsFree(GDALMultiDimTranslateOptions * psOptions) -> void
Frees the GDALMultiDimTranslateOptions struct.
Parameters
- psOptions: the options struct for GDALMultiDimTranslate().
GDAL.gdalmultidimtranslateoptionsnew
— MethodGDALMultiDimTranslateOptionsNew(char ** papszArgv,
GDALMultiDimTranslateOptionsForBinary * psOptionsForBinary) -> GDALMultiDimTranslateOptions *
Allocates a GDALMultiDimTranslateOptions struct.
Parameters
- papszArgv: NULL terminated list of options (potentially including filename and open options too), or NULL. The accepted options are the ones of the gdalmdimtranslate utility.
- psOptionsForBinary: should be nullptr, unless called from gdalmdimtranslate_bin.cpp
Returns
pointer to the allocated GDALMultiDimTranslateOptions struct. Must be freed with GDALMultiDimTranslateOptionsFree().
GDAL.gdalmultidimtranslateoptionssetprogress
— MethodGDALMultiDimTranslateOptionsSetProgress(GDALMultiDimTranslateOptions * psOptions,
GDALProgressFunc pfnProgress,
void * pProgressData) -> void
Set a progress function.
Parameters
- psOptions: the options struct for GDALMultiDimTranslate().
- pfnProgress: the progress callback.
- pProgressData: the user data for the progress callback.
GDAL.gdalnearblack
— MethodGDALNearblack(const char * pszDest,
GDALDatasetH hDstDS,
GDALDatasetH hSrcDataset,
const GDALNearblackOptions * psOptionsIn,
int * pbUsageError) -> GDALDatasetH
Convert nearly black/white borders to exact value.
Parameters
- pszDest: the destination dataset path or NULL.
- hDstDS: the destination dataset or NULL. Might be equal to hSrcDataset.
- hSrcDataset: the source dataset handle.
- psOptionsIn: the options struct returned by GDALNearblackOptionsNew() or NULL.
- pbUsageError: pointer to a integer output variable to store if any usage error has occurred or NULL.
Returns
the output dataset (new dataset that must be closed using GDALClose(), or hDstDS when it is not NULL) or NULL in case of error.
GDAL.gdalnearblackoptionsfree
— MethodGDALNearblackOptionsFree(GDALNearblackOptions * psOptions) -> void
Frees the GDALNearblackOptions struct.
Parameters
- psOptions: the options struct for GDALNearblack().
GDAL.gdalnearblackoptionsnew
— MethodGDALNearblackOptionsNew(char ** papszArgv,
GDALNearblackOptionsForBinary * psOptionsForBinary) -> GDALNearblackOptions *
Allocates a GDALNearblackOptions struct.
Parameters
- papszArgv: NULL terminated list of options (potentially including filename and open options too), or NULL. The accepted options are the ones of the nearblack utility.
- psOptionsForBinary: (output) may be NULL (and should generally be NULL), otherwise (gdaltranslatebin.cpp use case) must be allocated with GDALNearblackOptionsForBinaryNew() prior to this function. Will be filled with potentially present filename, open options,...
Returns
pointer to the allocated GDALNearblackOptions struct. Must be freed with GDALNearblackOptionsFree().
GDAL.gdalnearblackoptionssetprogress
— MethodGDALNearblackOptionsSetProgress(GDALNearblackOptions * psOptions,
GDALProgressFunc pfnProgress,
void * pProgressData) -> void
Set a progress function.
Parameters
- psOptions: the options struct for GDALNearblack().
- pfnProgress: the progress callback.
- pProgressData: the user data for the progress callback.
GDAL.gdalopen
— MethodGDALOpen(const char * pszFilename,
GDALAccess eAccess) -> GDALDatasetH
Open a raster file as a GDALDataset.
Parameters
- 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 GAUpdate or GAReadOnly. Many drivers support only read only access.
Returns
A GDALDatasetH handle or NULL on failure. For C++ applications this handle can be cast to a GDALDataset *.
GDAL.gdalopenex
— MethodGDALOpenEx(const char * pszFilename,
unsigned int nOpenFlags,
const char *const * papszAllowedDrivers,
const char *const * papszOpenOptions,
const char *const * papszSiblingFiles) -> GDALDatasetH
Open a raster or vector file as a GDALDataset.
Parameters
- 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.
- nOpenFlags: a combination of GDALOF flags that may be combined through logical or operator.
Driver kind:
GDALOFRASTER for raster drivers,
GDALOFMULTIDIM_RASTER for multidimensional raster drivers,
GDALOFVECTOR for vector drivers,
GDALOFGNM for Geographic Network Model drivers.
GDALOFRASTER and GDALOFMULTIDIMRASTER are generally mutually exclusive. If none of the value is specified, GDALOFRASTER | GDALOFVECTOR | GDALOF_GNM is implied.
Access mode: GDALOFREADONLY (exclusive)or GDALOFUPDATE.
Shared mode: GDALOFSHARED. If set, it allows the sharing of GDALDataset handles for a dataset with other callers that have set GDALOFSHARED. In particular, GDALOpenEx() will first consult its list of currently open and shared GDALDataset's, and if the GetDescription() name for one exactly matches the pszFilename passed to GDALOpenEx() it will be referenced and returned, if GDALOpenEx() is called from the same thread.
Verbose error: GDALOFVERBOSE_ERROR. If set, a failed attempt to open the file will lead to an error message to be reported.
- papszAllowedDrivers: NULL to consider all candidate drivers, or a NULL terminated list of strings with the driver short names that must be considered.
- papszOpenOptions: NULL, or a NULL terminated list of strings with open options passed to candidate drivers. An option exists for all drivers, OVERVIEWLEVEL=level, to select a particular overview level of a dataset. The level index starts at 0. The level number can be suffixed by "only" to specify that only this overview level must be visible, and not sub-levels. Open options are validated by default, and a warning is emitted in case the option is not recognized. In some scenarios, it might be not desirable (e.g. when not knowing which driver will open the file), so the special open option VALIDATEOPENOPTIONS can be set to NO to avoid such warnings. Alternatively, since GDAL 2.1, an option name can be preceded by the @ character to indicate that it may not cause a warning if the driver doesn't declare this option. Starting with GDAL 3.3, OVERVIEWLEVEL=NONE is supported to indicate that no overviews should be exposed.
- papszSiblingFiles: NULL, or a NULL terminated list of strings that are filenames that are auxiliary to the main filename. If NULL is passed, a probing of the file system will be done.
Returns
A GDALDatasetH handle or NULL on failure. For C++ applications this handle can be cast to a GDALDataset *.
GDAL.gdalopenshared
— MethodGDALOpenShared(const char * pszFilename,
GDALAccess eAccess) -> GDALDatasetH
Open a raster file as a GDALDataset.
Parameters
- 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 GAUpdate or GAReadOnly. Many drivers support only read only access.
Returns
A GDALDatasetH handle or NULL on failure. For C++ applications this handle can be cast to a GDALDataset *.
GDAL.gdalopenverticalshiftgrid
— Methodgdalopenverticalshiftgrid(pszProj4Geoidgrids, pbError)
GDAL.gdaloverviewmagnitudecorrection
— MethodGDALOverviewMagnitudeCorrection(GDALRasterBandH hBaseBand,
int nOverviewCount,
GDALRasterBandH * pahOverviews,
GDALProgressFunc pfnProgress,
void * pProgressData) -> CPLErr
Undocumented.
Parameters
- hBaseBand: undocumented.
- nOverviewCount: undocumented.
- pahOverviews: undocumented.
- pfnProgress: undocumented.
- pProgressData: undocumented.
Returns
undocumented
GDAL.gdalpackeddmstodec
— MethodGDALPackedDMSToDec(double dfPacked) -> double
Convert a packed DMS value (DDDMMMSSS.SS) into decimal degrees.
GDAL.gdalpolygonize
— MethodGDALPolygonize(GDALRasterBandH hSrcBand,
GDALRasterBandH hMaskBand,
OGRLayerH hOutLayer,
int iPixValField,
char ** papszOptions,
GDALProgressFunc pfnProgress,
void * pProgressArg) -> CPLErr
Create polygon coverage from raster data.
Parameters
- hSrcBand: the source raster band to be processed.
- hMaskBand: an optional mask band. All pixels in the mask band with a value other than zero will be considered suitable for collection as polygons.
- hOutLayer: the vector feature layer to which the polygons should be written.
- iPixValField: the attribute field index indicating the feature attribute into which the pixel value of the polygon should be written. Or -1 to indicate that the pixel value must not be written.
- papszOptions: a name/value list of additional options
8CONNECTED=8: May be set to "8" to use 8 connectedness. Otherwise 4 connectedness will be applied to the algorithm
DATASETFORGEOREF=dataset_name: Name of a dataset from which to read the geotransform. This useful if hSrcBand has no related dataset, which is typical for mask bands.
- pfnProgress: callback for reporting algorithm progress matching the GDALProgressFunc() semantics. May be NULL.
- pProgressArg: callback argument passed to pfnProgress.
Returns
CENone on success or CEFailure on a failure.
GDAL.gdalrasteradviseread
— MethodGDALRasterAdviseRead(GDALRasterBandH hBand,
int nXOff,
int nYOff,
int nXSize,
int nYSize,
int nBufXSize,
int nBufYSize,
GDALDataType eDT,
CSLConstList papszOptions) -> CPLErr
Advise driver of upcoming read requests.
GDAL.gdalrasterbandasmdarray
— MethodGDALRasterBandAsMDArray(GDALRasterBandH hBand) -> GDALMDArrayH
Return a view of this raster band as a 2D multidimensional GDALMDArray.
Returns
a new array, or NULL.
GDAL.gdalrasterbandcopywholeraster
— MethodGDALRasterBandCopyWholeRaster(GDALRasterBandH hSrcBand,
GDALRasterBandH hDstBand,
const char *const *const papszOptions,
GDALProgressFunc pfnProgress,
void * pProgressData) -> CPLErr
Copy a whole raster band.
Parameters
- 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.
Returns
CENone on success, or CEFailure on failure.
GDAL.gdalrasterbandgettiledvirtualmem
— MethodGDALRasterBandGetTiledVirtualMem(GDALRasterBandH hBand,
GDALRWFlag eRWFlag,
int nXOff,
int nYOff,
int nXSize,
int nYSize,
int nTileXSize,
int nTileYSize,
GDALDataType eBufType,
size_t nCacheSize,
int bSingleThreadUsage,
CSLConstList papszOptions) -> CPLVirtualMem *
Create a CPLVirtualMem object from a GDAL rasterband object, with tiling organization.
Parameters
- hBand: Rasterband object
- eRWFlag: Either GFRead to read a region of data, or GFWrite 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.
Returns
a virtual memory object that must be freed by CPLVirtualMemFree(), or NULL in case of failure.
GDAL.gdalrasterbandgetvirtualmem
— MethodGDALRasterBandGetVirtualMem(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,
CSLConstList papszOptions) -> CPLVirtualMem *
Create a CPLVirtualMem object from a GDAL raster band object.
Parameters
- hBand: Rasterband object
- eRWFlag: Either GFRead to read a region of data, or GFWrite 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.
Returns
a virtual memory object that must be freed by CPLVirtualMemFree(), or NULL in case of failure.
GDAL.gdalrasterio
— MethodGDALRasterIO(GDALRasterBandH hBand,
GDALRWFlag eRWFlag,
int nXOff,
int nYOff,
int nXSize,
int nYSize,
void * pData,
int nBufXSize,
int nBufYSize,
GDALDataType eBufType,
int nPixelSpace,
int nLineSpace) -> CPLErr
Read/write a region of image data for this band.
GDAL.gdalrasterioex
— MethodGDALRasterIOEx(GDALRasterBandH hBand,
GDALRWFlag eRWFlag,
int nXOff,
int nYOff,
int nXSize,
int nYSize,
void * pData,
int nBufXSize,
int nBufYSize,
GDALDataType eBufType,
GSpacing nPixelSpace,
GSpacing nLineSpace,
GDALRasterIOExtraArg * psExtraArg) -> CPLErr
Read/write a region of image data for this band.
GDAL.gdalrasterize
— MethodGDALRasterize(const char * pszDest,
GDALDatasetH hDstDS,
GDALDatasetH hSrcDataset,
const GDALRasterizeOptions * psOptionsIn,
int * pbUsageError) -> GDALDatasetH
Burns vector geometries into a raster.
Parameters
- pszDest: the destination dataset path or NULL.
- hDstDS: the destination dataset or NULL.
- hSrcDataset: the source dataset handle.
- psOptionsIn: the options struct returned by GDALRasterizeOptionsNew() or NULL.
- pbUsageError: pointer to a integer output variable to store if any usage error has occurred or NULL.
Returns
the output dataset (new dataset that must be closed using GDALClose(), or hDstDS is not NULL) or NULL in case of error.
GDAL.gdalrasterizegeometries
— Methodgdalrasterizegeometries(hDS, nBandCount, panBandList, nGeomCount, pahGeometries, pfnTransformer, pTransformArg, padfGeomBurnValues, papszOptions, pfnProgress, pProgressArg)
GDAL.gdalrasterizegeometriesint64
— MethodGDALRasterizeGeometriesInt64(GDALDatasetH hDS,
int nBandCount,
const int * panBandList,
int nGeomCount,
const OGRGeometryH * pahGeometries,
GDALTransformerFunc pfnTransformer,
void * pTransformArg,
const int64_t * panGeomBurnValues,
CSLConstList papszOptions,
GDALProgressFunc pfnProgress,
void * pProgressArg) -> CPLErr
Burn geometries into raster.
GDAL.gdalrasterizelayers
— MethodGDALRasterizeLayers(GDALDatasetH hDS,
int nBandCount,
int * panBandList,
int nLayerCount,
OGRLayerH * pahLayers,
GDALTransformerFunc pfnTransformer,
void * pTransformArg,
double * padfLayerBurnValues,
char ** papszOptions,
GDALProgressFunc pfnProgress,
void * pProgressArg) -> CPLErr
Burn geometries from the specified list of layers into raster.
Parameters
- hDS: output data, must be opened in update mode.
- nBandCount: the number of bands to be updated.
- panBandList: the list of bands to be updated.
- nLayerCount: the number of layers being passed in pahLayers array.
- pahLayers: the array of layers to burn in.
- pfnTransformer: transformation to apply to geometries to put into pixel/line coordinates on raster. If NULL a geotransform based one will be created internally.
- pTransformArg: callback data for transformer.
- padfLayerBurnValues: the array of values to burn into the raster. There should be nBandCount values for each layer.
- papszOptions: special options controlling rasterization:
"ATTRIBUTE": Identifies an attribute field on the features to be used for a burn in value. The value will be burned into all output bands. If specified, padfLayerBurnValues will not be used and can be a NULL pointer.
"CHUNKYSIZE": The height in lines of the chunk to operate on. The larger the chunk size the less times we need to make a pass through all the shapes. If it is not set or set to zero the default chunk size will be used. Default size will be estimated based on the GDAL cache buffer size using formula: cachesizebytes/scanlinesizebytes, so the chunk will not exceed the cache.
"ALL_TOUCHED": May be set to TRUE to set all pixels touched by the line or polygons, not just those whose center is within the polygon or that are selected by brezenhams line algorithm. Defaults to FALSE.
"BURNVALUEFROM": May be set to "Z" to use the Z values of the geometries. The value from padfLayerBurnValues or the attribute field value is added to this before burning. In default case dfBurnValue is burned as it is. This is implemented properly only for points and lines for now. Polygons will be burned using the Z value from the first point. The M value may be supported in the future.
"MERGE_ALG": May be REPLACE (the default) or ADD. REPLACE results in overwriting of value, while ADD adds the new value to the existing raster, suitable for heatmaps for instance.
- pfnProgress: the progress function to report completion.
- pProgressArg: callback data for progress function.
Returns
CENone on success or CEFailure on error.
GDAL.gdalrasterizelayersbuf
— MethodGDALRasterizeLayersBuf(void * pData,
int nBufXSize,
int nBufYSize,
GDALDataType eBufType,
int nPixelSpace,
int nLineSpace,
int nLayerCount,
OGRLayerH * pahLayers,
const char * pszDstProjection,
double * padfDstGeoTransform,
GDALTransformerFunc pfnTransformer,
void * pTransformArg,
double dfBurnValue,
char ** papszOptions,
GDALProgressFunc pfnProgress,
void * pProgressArg) -> CPLErr
Burn geometries from the specified list of layer into raster.
Parameters
- pData: pointer to the output data array.
- nBufXSize: width of the output data array in pixels.
- nBufYSize: height of the output data array in pixels.
- eBufType: data type of the output data array.
- nPixelSpace: The byte offset from the start of one pixel value in pData to the start of the next pixel value within a scanline. If defaulted (0) the size of the datatype eBufType is used.
- nLineSpace: The byte offset from the start of one scanline in pData to the start of the next. If defaulted the size of the datatype eBufType * nBufXSize is used.
- nLayerCount: the number of layers being passed in pahLayers array.
- pahLayers: the array of layers to burn in.
- pszDstProjection: WKT defining the coordinate system of the target raster.
- padfDstGeoTransform: geotransformation matrix of the target raster.
- pfnTransformer: transformation to apply to geometries to put into pixel/line coordinates on raster. If NULL a geotransform based one will be created internally.
- pTransformArg: callback data for transformer.
- dfBurnValue: the value to burn into the raster.
- papszOptions: special options controlling rasterization:
"ATTRIBUTE": Identifies an attribute field on the features to be used for a burn in value. The value will be burned into all output bands. If specified, padfLayerBurnValues will not be used and can be a NULL pointer.
"ALL_TOUCHED": May be set to TRUE to set all pixels touched by the line or polygons, not just those whose center is within the polygon or that are selected by brezenhams line algorithm. Defaults to FALSE.
"BURNVALUEFROM": May be set to "Z" to use the Z values of the geometries. dfBurnValue or the attribute field value is added to this before burning. In default case dfBurnValue is burned as it is. This is implemented properly only for points and lines for now. Polygons will be burned using the Z value from the first point. The M value may be supported in the future.
"MERGE_ALG": May be REPLACE (the default) or ADD. REPLACE results in overwriting of value, while ADD adds the new value to the existing raster, suitable for heatmaps for instance.
- pfnProgress: the progress function to report completion.
- pProgressArg: callback data for progress function.
Returns
CENone on success or CEFailure on error.
GDAL.gdalrasterizeoptionsfree
— MethodGDALRasterizeOptionsFree(GDALRasterizeOptions * psOptions) -> void
Frees the GDALRasterizeOptions struct.
Parameters
- psOptions: the options struct for GDALRasterize().
GDAL.gdalrasterizeoptionsnew
— MethodGDALRasterizeOptionsNew(char ** papszArgv,
GDALRasterizeOptionsForBinary * psOptionsForBinary) -> GDALRasterizeOptions *
Allocates a GDALRasterizeOptions struct.
Parameters
- papszArgv: NULL terminated list of options (potentially including filename and open options too), or NULL. The accepted options are the ones of the gdal_rasterize utility.
- psOptionsForBinary: (output) may be NULL (and should generally be NULL), otherwise (gdaltranslatebin.cpp use case) must be allocated with GDALRasterizeOptionsForBinaryNew() prior to this function. Will be filled with potentially present filename, open options,...
Returns
pointer to the allocated GDALRasterizeOptions struct. Must be freed with GDALRasterizeOptionsFree().
GDAL.gdalrasterizeoptionssetprogress
— MethodGDALRasterizeOptionsSetProgress(GDALRasterizeOptions * psOptions,
GDALProgressFunc pfnProgress,
void * pProgressData) -> void
Set a progress function.
Parameters
- psOptions: the options struct for GDALRasterize().
- pfnProgress: the progress callback.
- pProgressData: the user data for the progress callback.
GDAL.gdalratchangesarewrittentofile
— MethodGDALRATChangesAreWrittenToFile(GDALRasterAttributeTableH hRAT) -> int
Determine whether changes made to this RAT are reflected directly in the dataset.
GDAL.gdalratclone
— MethodGDALRATClone(const GDALRasterAttributeTableH hRAT) -> GDALRasterAttributeTableH
Copy Raster Attribute Table.
GDAL.gdalratcreatecolumn
— MethodGDALRATCreateColumn(GDALRasterAttributeTableH hRAT,
const char * pszFieldName,
GDALRATFieldType eFieldType,
GDALRATFieldUsage eFieldUsage) -> CPLErr
Create new column.
GDAL.gdalratdumpreadable
— MethodGDALRATDumpReadable(GDALRasterAttributeTableH hRAT,
FILE * fp) -> void
Dump RAT in readable form.
GDAL.gdalratgetcolofusage
— MethodGDALRATGetColOfUsage(GDALRasterAttributeTableH hRAT,
GDALRATFieldUsage eUsage) -> int
Fetch column index for given usage.
GDAL.gdalratgetcolumncount
— MethodGDALRATGetColumnCount(GDALRasterAttributeTableH hRAT) -> int
Fetch table column count.
GDAL.gdalratgetlinearbinning
— MethodGDALRATGetLinearBinning(GDALRasterAttributeTableH hRAT,
double * pdfRow0Min,
double * pdfBinSize) -> int
Get linear binning information.
GDAL.gdalratgetnameofcol
— MethodGDALRATGetNameOfCol(GDALRasterAttributeTableH hRAT,
int iCol) -> const char *
Fetch name of indicated column.
Parameters
- hRAT: RAT handle.
- iCol: column index.
Returns
name.
GDAL.gdalratgetrowcount
— MethodGDALRATGetRowCount(GDALRasterAttributeTableH hRAT) -> int
Fetch row count.
GDAL.gdalratgetrowofvalue
— MethodGDALRATGetRowOfValue(GDALRasterAttributeTableH hRAT,
double dfValue) -> int
Get row for pixel value.
GDAL.gdalratgettabletype
— MethodGDALRATGetTableType(GDALRasterAttributeTableH hRAT) -> GDALRATTableType
Get Rat Table Type.
GDAL.gdalratgettypeofcol
— MethodGDALRATGetTypeOfCol(GDALRasterAttributeTableH hRAT,
int iCol) -> GDALRATFieldType
Fetch column type.
Parameters
- hRAT: RAT handle.
- iCol: column index.
Returns
type.
GDAL.gdalratgetusageofcol
— MethodGDALRATGetUsageOfCol(GDALRasterAttributeTableH hRAT,
int iCol) -> GDALRATFieldUsage
Fetch column usage value.
Parameters
- hRAT: RAT handle.
- iCol: column index.
Returns
usage.
GDAL.gdalratgetvalueasdouble
— MethodGDALRATGetValueAsDouble(GDALRasterAttributeTableH hRAT,
int iRow,
int iField) -> double
Fetch field value as a double.
GDAL.gdalratgetvalueasint
— MethodGDALRATGetValueAsInt(GDALRasterAttributeTableH hRAT,
int iRow,
int iField) -> int
Fetch field value as a integer.
GDAL.gdalratgetvalueasstring
— MethodGDALRATGetValueAsString(GDALRasterAttributeTableH hRAT,
int iRow,
int iField) -> const char *
Fetch field value as a string.
GDAL.gdalratinitializefromcolortable
— MethodGDALRATInitializeFromColorTable(GDALRasterAttributeTableH hRAT,
GDALColorTableH hCT) -> CPLErr
Initialize from color table.
GDAL.gdalratremovestatistics
— MethodGDALRATRemoveStatistics(GDALRasterAttributeTableH hRAT) -> void
Remove Statistics from RAT.
GDAL.gdalratserializejson
— MethodGDALRATSerializeJSON(GDALRasterAttributeTableH hRAT) -> void *
Serialize Raster Attribute Table in Json format.
GDAL.gdalratsetlinearbinning
— MethodGDALRATSetLinearBinning(GDALRasterAttributeTableH hRAT,
double dfRow0Min,
double dfBinSize) -> CPLErr
Set linear binning information.
GDAL.gdalratsetrowcount
— MethodGDALRATSetRowCount(GDALRasterAttributeTableH hRAT,
int nNewCount) -> void
Set row count.
Parameters
- hRAT: RAT handle.
- nNewCount: the new number of rows.
GDAL.gdalratsettabletype
— MethodGDALRATSetTableType(GDALRasterAttributeTableH hRAT,
const GDALRATTableType eInTableType) -> CPLErr
Set RAT Table Type.
GDAL.gdalratsetvalueasdouble
— MethodGDALRATSetValueAsDouble(GDALRasterAttributeTableH hRAT,
int iRow,
int iField,
double dfValue) -> void
Set field value from double.
GDAL.gdalratsetvalueasint
— MethodGDALRATSetValueAsInt(GDALRasterAttributeTableH hRAT,
int iRow,
int iField,
int nValue) -> void
Set field value from integer.
GDAL.gdalratsetvalueasstring
— MethodGDALRATSetValueAsString(GDALRasterAttributeTableH hRAT,
int iRow,
int iField,
const char * pszValue) -> void
Set field value from string.
Parameters
- hRAT: RAT handle.
- iRow: row index.
- iField: field index.
- pszValue: value.
GDAL.gdalrattranslatetocolortable
— MethodGDALRATTranslateToColorTable(GDALRasterAttributeTableH hRAT,
int nEntryCount) -> GDALColorTableH
Translate to a color table.
GDAL.gdalratvaluesioasdouble
— MethodGDALRATValuesIOAsDouble(GDALRasterAttributeTableH hRAT,
GDALRWFlag eRWFlag,
int iField,
int iStartRow,
int iLength,
double * pdfData) -> CPLErr
Read or Write a block of doubles to/from the Attribute Table.
GDAL.gdalratvaluesioasinteger
— MethodGDALRATValuesIOAsInteger(GDALRasterAttributeTableH hRAT,
GDALRWFlag eRWFlag,
int iField,
int iStartRow,
int iLength,
int * pnData) -> CPLErr
Read or Write a block of ints to/from the Attribute Table.
GDAL.gdalratvaluesioasstring
— MethodGDALRATValuesIOAsString(GDALRasterAttributeTableH hRAT,
GDALRWFlag eRWFlag,
int iField,
int iStartRow,
int iLength,
char ** papszStrList) -> CPLErr
Read or Write a block of strings to/from the Attribute Table.
GDAL.gdalreadblock
— MethodGDALReadBlock(GDALRasterBandH hBand,
int nXOff,
int nYOff,
void * pData) -> CPLErr
Read a block of image data efficiently.
GDAL.gdalreadozimapfile
— MethodGDALReadOziMapFile(const char * pszBaseFilename,
double * padfGeoTransform,
char ** ppszWKT,
int * pnGCPCount,
GDAL_GCP ** ppasGCPs) -> int
Helper function for translator implementer wanting support for OZI .map.
Parameters
- pszBaseFilename: filename whose basename will help building the .map filename.
- padfGeoTransform: output geotransform. Must hold 6 doubles.
- ppszWKT: output pointer to a string that will be allocated with CPLMalloc().
- pnGCPCount: output pointer to GCP count.
- ppasGCPs: outputer pointer to an array of GCPs.
Returns
TRUE in case of success, FALSE otherwise.
GDAL.gdalreadtabfile
— MethodGDALReadTabFile(const char * pszBaseFilename,
double * padfGeoTransform,
char ** ppszWKT,
int * pnGCPCount,
GDAL_GCP ** ppasGCPs) -> int
Helper function for translator implementer wanting support for MapInfo .tab files.
Parameters
- pszBaseFilename: filename whose basename will help building the .tab filename.
- padfGeoTransform: output geotransform. Must hold 6 doubles.
- ppszWKT: output pointer to a string that will be allocated with CPLMalloc().
- pnGCPCount: output pointer to GCP count.
- ppasGCPs: outputer pointer to an array of GCPs.
Returns
TRUE in case of success, FALSE otherwise.
GDAL.gdalreadworldfile
— MethodGDALReadWorldFile(const char * pszBaseFilename,
const char * pszExtension,
double * padfGeoTransform) -> int
Read ESRI world file.
Parameters
- pszBaseFilename: the target raster file.
- pszExtension: the extension to use (i.e. "wld") or NULL to derive it from the pszBaseFilename
- padfGeoTransform: the six double array into which the geotransformation should be placed.
Returns
TRUE on success or FALSE on failure.
GDAL.gdalreferencedataset
— MethodGDALReferenceDataset(GDALDatasetH hDataset) -> int
Add one to dataset reference count.
GDAL.gdalregenerateoverviews
— MethodGDALRegenerateOverviews(GDALRasterBandH hSrcBand,
int nOverviewCount,
GDALRasterBandH * pahOvrBands,
const char * pszResampling,
GDALProgressFunc pfnProgress,
void * pProgressData) -> CPLErr
Generate downsampled overviews.
Parameters
- 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 (e.g. "AVERAGE").
- pfnProgress: progress report function.
- pProgressData: progress function callback data.
Returns
CENone on success or CEFailure on failure.
GDAL.gdalregenerateoverviewsex
— MethodGDALRegenerateOverviewsEx(GDALRasterBandH hSrcBand,
int nOverviewCount,
GDALRasterBandH * pahOvrBands,
const char * pszResampling,
GDALProgressFunc pfnProgress,
void * pProgressData,
CSLConstList papszOptions) -> CPLErr
Generate downsampled overviews.
Parameters
- 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 (e.g. "AVERAGE").
- pfnProgress: progress report function.
- pProgressData: progress function callback data.
- papszOptions: NULL terminated list of options as key=value pairs, or NULL
Returns
CENone on success or CEFailure on failure.
GDAL.gdalregisterdriver
— MethodGDALRegisterDriver(GDALDriverH hDriver) -> int
Register a driver for use.
GDAL.gdalregisterplugin
— MethodGDALRegisterPlugin(const char * name) -> CPLErr
Register a plugin by name, returning an error if not found.
GDAL.gdalregisterplugins
— MethodGDALRegisterPlugins(void) -> void
Register drivers and support code available as a plugin.
GDAL.gdalrelationshipcreate
— MethodGDALRelationshipCreate(const char * pszName,
const char * pszLeftTableName,
const char * pszRightTableName,
GDALRelationshipCardinality eCardinality) -> GDALRelationshipH
Creates a new relationship.
Parameters
- pszName: relationship name
- pszLeftTableName: left table name
- pszRightTableName: right table name
- eCardinality: cardinality of relationship
Returns
a new handle that should be freed with GDALDestroyRelationship(), or NULL in case of error.
GDAL.gdalrelationshipgetbackwardpathlabel
— MethodGDALRelationshipGetBackwardPathLabel(GDALRelationshipH hRelationship) -> const char *
Get the label of the backward path for the relationship.
Returns
backward path label
GDAL.gdalrelationshipgetcardinality
— MethodGDALRelationshipGetCardinality(GDALRelationshipH hRelationship) -> GDALRelationshipCardinality
Get the cardinality of the relationship.
Returns
cardinality.
GDAL.gdalrelationshipgetforwardpathlabel
— MethodGDALRelationshipGetForwardPathLabel(GDALRelationshipH hRelationship) -> const char *
Get the label of the forward path for the relationship.
Returns
forward path label
GDAL.gdalrelationshipgetleftmappingtablefields
— MethodGDALRelationshipGetLeftMappingTableFields(GDALRelationshipH hRelationship) -> char **
Get the names of the mapping table fields which correspond to the participating fields from the left table in the relationship.
Returns
the field names, to be freed with CSLDestroy()
GDAL.gdalrelationshipgetlefttablefields
— MethodGDALRelationshipGetLeftTableFields(GDALRelationshipH hRelationship) -> char **
Get the names of the participating fields from the left table in the relationship.
Returns
the field names, to be freed with CSLDestroy()
GDAL.gdalrelationshipgetlefttablename
— MethodGDALRelationshipGetLeftTableName(GDALRelationshipH hRelationship) -> const char *
Get the name of the left (or base/origin) table in the relationship.
Returns
left table name.
GDAL.gdalrelationshipgetmappingtablename
— MethodGDALRelationshipGetMappingTableName(GDALRelationshipH hRelationship) -> const char *
Get the name of the mapping table for many-to-many relationships.
Returns
mapping table name.
GDAL.gdalrelationshipgetname
— MethodGDALRelationshipGetName(GDALRelationshipH hRelationship) -> const char *
Get the name of the relationship.
Returns
name.
GDAL.gdalrelationshipgetrelatedtabletype
— MethodGDALRelationshipGetRelatedTableType(GDALRelationshipH hRelationship) -> const char *
Get the type string of the related table.
Returns
related table type
GDAL.gdalrelationshipgetrightmappingtablefields
— MethodGDALRelationshipGetRightMappingTableFields(GDALRelationshipH hRelationship) -> char **
Get the names of the mapping table fields which correspond to the participating fields from the right table in the relationship.
Returns
the field names, to be freed with CSLDestroy()
GDAL.gdalrelationshipgetrighttablefields
— MethodGDALRelationshipGetRightTableFields(GDALRelationshipH hRelationship) -> char **
Get the names of the participating fields from the right table in the relationship.
Returns
the field names, to be freed with CSLDestroy()
GDAL.gdalrelationshipgetrighttablename
— MethodGDALRelationshipGetRightTableName(GDALRelationshipH hRelationship) -> const char *
Get the name of the right (or related/destination) table in the relationship.
Returns
right table name.
GDAL.gdalrelationshipgettype
— MethodGDALRelationshipGetType(GDALRelationshipH hRelationship) -> GDALRelationshipType
Get the type of the relationship.
Returns
relationship type.
GDAL.gdalrelationshipsetbackwardpathlabel
— MethodGDALRelationshipSetBackwardPathLabel(GDALRelationshipH hRelationship,
const char * pszLabel) -> void
Sets the label of the backward path for the relationship.
Parameters
- hRelationship: handle to the relationship to apply the new label to.
- pszLabel: the label to set.
GDAL.gdalrelationshipsetforwardpathlabel
— MethodGDALRelationshipSetForwardPathLabel(GDALRelationshipH hRelationship,
const char * pszLabel) -> void
Sets the label of the forward path for the relationship.
Parameters
- hRelationship: handle to the relationship to apply the new label to.
- pszLabel: the label to set.
GDAL.gdalrelationshipsetleftmappingtablefields
— MethodGDALRelationshipSetLeftMappingTableFields(GDALRelationshipH hRelationship,
CSLConstList papszFields) -> void
Sets the names of the mapping table fields which correspond to the participating fields from the left table in the relationship.
Parameters
- hRelationship: handle to the relationship to apply the left table fields to.
- papszFields: the names of the fields.
GDAL.gdalrelationshipsetlefttablefields
— MethodGDALRelationshipSetLeftTableFields(GDALRelationshipH hRelationship,
CSLConstList papszFields) -> void
Sets the names of the participating fields from the left table in the relationship.
Parameters
- hRelationship: handle to the relationship to apply the left table fields to.
- papszFields: the names of the fields.
GDAL.gdalrelationshipsetmappingtablename
— MethodGDALRelationshipSetMappingTableName(GDALRelationshipH hRelationship,
const char * pszName) -> void
Sets the name of the mapping table for many-to-many relationships.
Parameters
- hRelationship: handle to the relationship to apply the new mapping name to.
- pszName: the mapping table name to set.
GDAL.gdalrelationshipsetrelatedtabletype
— MethodGDALRelationshipSetRelatedTableType(GDALRelationshipH hRelationship,
const char * pszType) -> void
Sets the type string of the related table.
Parameters
- hRelationship: handle to the relationship to apply the new type to.
- pszType: the type to set.
GDAL.gdalrelationshipsetrightmappingtablefields
— MethodGDALRelationshipSetRightMappingTableFields(GDALRelationshipH hRelationship,
CSLConstList papszFields) -> void
Sets the names of the mapping table fields which correspond to the participating fields from the right table in the relationship.
Parameters
- hRelationship: handle to the relationship to apply the right table fields to.
- papszFields: the names of the fields.
GDAL.gdalrelationshipsetrighttablefields
— MethodGDALRelationshipSetRightTableFields(GDALRelationshipH hRelationship,
CSLConstList papszFields) -> void
Sets the names of the participating fields from the right table in the relationship.
Parameters
- hRelationship: handle to the relationship to apply the right table fields to.
- papszFields: the names of the fields.
GDAL.gdalrelationshipsettype
— MethodGDALRelationshipSetType(GDALRelationshipH hRelationship,
GDALRelationshipType eType) -> void
Sets the type of the relationship.
GDAL.gdalreleasearrays
— MethodGDALReleaseArrays(GDALMDArrayH * arrays,
size_t nCount) -> void
Free the return of GDALMDArrayGetCoordinateVariables()
Parameters
- arrays: return pointer of above methods
- nCount: *pnCount value returned by above methods
GDAL.gdalreleaseattributes
— MethodGDALReleaseAttributes(GDALAttributeH * attributes,
size_t nCount) -> void
Free the return of GDALGroupGetAttributes() or GDALMDArrayGetAttributes()
Parameters
- attributes: return pointer of above methods
- nCount: *pnCount value returned by above methods
GDAL.gdalreleasedataset
— MethodGDALReleaseDataset(GDALDatasetH hDataset) -> int
Drop a reference to this object, and destroy if no longer referenced.
GDAL.gdalreleasedimensions
— MethodGDALReleaseDimensions(GDALDimensionH * dims,
size_t nCount) -> void
Free the return of GDALGroupGetDimensions() or GDALMDArrayGetDimensions()
Parameters
- dims: return pointer of above methods
- nCount: *pnCount value returned by above methods
GDAL.gdalrenamedataset
— MethodGDALRenameDataset(GDALDriverH hDriver,
const char * pszNewName,
const char * pszOldName) -> CPLErr
Rename a dataset.
GDAL.gdalreprojectimage
— Methodgdalreprojectimage(hSrcDS, pszSrcWKT, hDstDS, pszDstWKT, eResampleAlg, dfWarpMemoryLimit, dfMaxError, pfnProgress, pProgressArg, psOptions)
GDAL.gdalreprojectiontransform
— MethodGDALReprojectionTransform(void * pTransformArg,
int bDstToSrc,
int nPointCount,
double * padfX,
double * padfY,
double * padfZ,
int * panSuccess) -> int
Perform reprojection transformation.
GDAL.gdalrpctransform
— MethodGDALRPCTransform(void * pTransformArg,
int bDstToSrc,
int nPointCount,
double * padfX,
double * padfY,
double * padfZ,
int * panSuccess) -> int
RPC transform.
GDAL.gdalscaledprogress
— MethodGDALScaledProgress(double dfComplete,
const char * pszMessage,
void * pData) -> int
Scaled progress transformer.
GDAL.gdalserializetransformer
— Methodgdalserializetransformer(pfnFunc, pTransformArg)
Doxygen_Suppress
GDAL.gdalserializewarpoptions
— Methodgdalserializewarpoptions(arg1)
Doxygen_Suppress
GDAL.gdalsetcachemax
— MethodGDALSetCacheMax(int nNewSizeInBytes) -> void
Set maximum cache memory.
Parameters
- nNewSizeInBytes: the maximum number of bytes for caching.
GDAL.gdalsetcachemax64
— MethodGDALSetCacheMax64(GIntBig nNewSizeInBytes) -> void
Set maximum cache memory.
Parameters
- nNewSizeInBytes: the maximum number of bytes for caching.
GDAL.gdalsetcolorentry
— MethodGDALSetColorEntry(GDALColorTableH hTable,
int i,
const GDALColorEntry * poEntry) -> void
Set entry in color table.
GDAL.gdalsetdefaulthistogram
— MethodGDALSetDefaultHistogram(GDALRasterBandH hBand,
double dfMin,
double dfMax,
int nBuckets,
int * panHistogram) -> CPLErr
Set default histogram.
GDAL.gdalsetdefaulthistogramex
— MethodGDALSetDefaultHistogramEx(GDALRasterBandH hBand,
double dfMin,
double dfMax,
int nBuckets,
GUIntBig * panHistogram) -> CPLErr
Set default histogram.
GDAL.gdalsetdefaultrat
— MethodGDALSetDefaultRAT(GDALRasterBandH hBand,
GDALRasterAttributeTableH hRAT) -> CPLErr
Set default Raster Attribute Table.
GDAL.gdalsetdescription
— MethodGDALSetDescription(GDALMajorObjectH hObject,
const char * pszNewDesc) -> void
Set object description.
GDAL.gdalsetgcps
— MethodGDALSetGCPs(GDALDatasetH hDS,
int nGCPCount,
const GDAL_GCP * pasGCPList,
const char * pszGCPProjection) -> CPLErr
Assign GCPs.
GDAL.gdalsetgcps2
— MethodGDALSetGCPs2(GDALDatasetH hDS,
int nGCPCount,
const GDAL_GCP * pasGCPList,
OGRSpatialReferenceH hSRS) -> CPLErr
Assign GCPs.
GDAL.gdalsetgenimgprojtransformerdstgeotransform
— MethodGDALSetGenImgProjTransformerDstGeoTransform(void * hTransformArg,
const double * padfGeoTransform) -> void
Set GenImgProj output geotransform.
Parameters
- hTransformArg: the handle to update.
- padfGeoTransform: the destination geotransform to apply (six doubles).
GDAL.gdalsetgeotransform
— MethodGDALSetGeoTransform(GDALDatasetH hDS,
double * padfTransform) -> CPLErr
Set the affine transformation coefficients.
GDAL.gdalsetmetadata
— MethodGDALSetMetadata(GDALMajorObjectH hObject,
CSLConstList papszMD,
const char * pszDomain) -> CPLErr
Set metadata.
GDAL.gdalsetmetadataitem
— MethodGDALSetMetadataItem(GDALMajorObjectH hObject,
const char * pszName,
const char * pszValue,
const char * pszDomain) -> CPLErr
Set single metadata item.
GDAL.gdalsetprojection
— MethodGDALSetProjection(GDALDatasetH hDS,
const char * pszProjection) -> CPLErr
Set the projection reference string for this dataset.
GDAL.gdalsetrastercategorynames
— MethodGDALSetRasterCategoryNames(GDALRasterBandH hBand,
CSLConstList papszNames) -> CPLErr
Set the category names for this band.
GDAL.gdalsetrastercolorinterpretation
— MethodGDALSetRasterColorInterpretation(GDALRasterBandH hBand,
GDALColorInterp eColorInterp) -> CPLErr
Set color interpretation of a band.
GDAL.gdalsetrastercolortable
— MethodGDALSetRasterColorTable(GDALRasterBandH hBand,
GDALColorTableH hCT) -> CPLErr
Set the raster color table.
GDAL.gdalsetrasternodatavalue
— MethodGDALSetRasterNoDataValue(GDALRasterBandH hBand,
double dfValue) -> CPLErr
Set the no data value for this band.
GDAL.gdalsetrasternodatavalueasint64
— MethodGDALSetRasterNoDataValueAsInt64(GDALRasterBandH hBand,
int64_t nValue) -> CPLErr
Set the no data value for this band.
GDAL.gdalsetrasternodatavalueasuint64
— MethodGDALSetRasterNoDataValueAsUInt64(GDALRasterBandH hBand,
uint64_t nValue) -> CPLErr
Set the no data value for this band.
GDAL.gdalsetrasteroffset
— MethodGDALSetRasterOffset(GDALRasterBandH hBand,
double dfNewOffset) -> CPLErr
Set scaling offset.
GDAL.gdalsetrasterscale
— MethodGDALSetRasterScale(GDALRasterBandH hBand,
double dfNewOffset) -> CPLErr
Set scaling ratio.
GDAL.gdalsetrasterstatistics
— MethodGDALSetRasterStatistics(GDALRasterBandH hBand,
double dfMin,
double dfMax,
double dfMean,
double dfStdDev) -> CPLErr
Set statistics on band.
GDAL.gdalsetrasterunittype
— MethodGDALSetRasterUnitType(GDALRasterBandH hBand,
const char * pszNewValue) -> CPLErr
Set unit type.
GDAL.gdalsetspatialref
— MethodGDALSetSpatialRef(GDALDatasetH hDS,
OGRSpatialReferenceH hSRS) -> CPLErr
Set the spatial reference system for this dataset.
GDAL.gdalsettransformerdstgeotransform
— MethodGDALSetTransformerDstGeoTransform(void * pTransformArg,
const double * padfGeoTransform) -> void
Set ApproxTransformer or GenImgProj output geotransform.
Parameters
- pTransformArg: the handle to update.
- padfGeoTransform: the destination geotransform to apply (six doubles).
GDAL.gdalsievefilter
— MethodGDALSieveFilter(GDALRasterBandH hSrcBand,
GDALRasterBandH hMaskBand,
GDALRasterBandH hDstBand,
int nSizeThreshold,
int nConnectedness,
char ** papszOptions,
GDALProgressFunc pfnProgress,
void * pProgressArg) -> CPLErr
Removes small raster polygons.
Parameters
- hSrcBand: the source raster band to be processed.
- hMaskBand: an optional mask band. All pixels in the mask band with a value other than zero will be considered suitable for inclusion in polygons.
- hDstBand: the output raster band. It may be the same as hSrcBand to update the source in place.
- nSizeThreshold: raster polygons with sizes smaller than this will be merged into their largest neighbour.
- nConnectedness: either 4 indicating that diagonal pixels are not considered directly adjacent for polygon membership purposes or 8 indicating they are.
- papszOptions: algorithm options in name=value list form. None currently supported.
- pfnProgress: callback for reporting algorithm progress matching the GDALProgressFunc() semantics. May be NULL.
- pProgressArg: callback argument passed to pfnProgress.
Returns
CENone on success or CEFailure if an error occurs.
GDAL.gdalsimpleimagewarp
— MethodGDALSimpleImageWarp(GDALDatasetH hSrcDS,
GDALDatasetH hDstDS,
int nBandCount,
int * panBandList,
GDALTransformerFunc pfnTransform,
void * pTransformArg,
GDALProgressFunc pfnProgress,
void * pProgressArg,
char ** papszWarpOptions) -> int
Perform simple image warp.
Parameters
- hSrcDS: the source image dataset.
- hDstDS: the destination image dataset.
- nBandCount: the number of bands to be warped. If zero, all bands will be processed.
- panBandList: the list of bands to translate.
- pfnTransform: the transformation function to call. See GDALTransformerFunc().
- pTransformArg: the callback handle to pass to pfnTransform.
- pfnProgress: the function used to report progress. See GDALProgressFunc().
- pProgressArg: the callback handle to pass to pfnProgress.
- papszWarpOptions: additional options controlling the warp.
Returns
TRUE if the operation completes, or FALSE if an error occurs.
GDAL.gdalsubdatasetinfogetpathcomponent
— Methodgdalsubdatasetinfogetpathcomponent(hInfo)
Returns the file path component of a subdataset descriptor effectively stripping the information about the subdataset and returning the "parent" dataset descriptor. The returned string must be freed with CPLFree
().
This method does not check if the subdataset actually exists.
\since GDAL 3.8
Arguments
hInfo
: Pointer toGDALSubdatasetInfo
object
Returns
The original string with the subdataset information removed.
GDAL.gdalsubdatasetinfogetsubdatasetcomponent
— Methodgdalsubdatasetinfogetsubdatasetcomponent(hInfo)
Returns the subdataset component of a subdataset descriptor descriptor. The returned string must be freed with CPLFree
().
This method does not check if the subdataset actually exists.
\since GDAL 3.8
Arguments
hInfo
: Pointer toGDALSubdatasetInfo
object
Returns
The subdataset name.
GDAL.gdalsubdatasetinfomodifypathcomponent
— Methodgdalsubdatasetinfomodifypathcomponent(hInfo, pszNewPath)
Replaces the path component of a subdataset descriptor. The returned string must be freed with CPLFree
().
This method does not check if the subdataset actually exists.
\since GDAL 3.8
Arguments
hInfo
: Pointer toGDALSubdatasetInfo
objectpszNewPath
: New path.
Returns
The original subdataset descriptor with the old path component replaced by newPath.
GDAL.gdalsuggestedwarpoutput
— MethodGDALSuggestedWarpOutput(GDALDatasetH hSrcDS,
GDALTransformerFunc pfnTransformer,
void * pTransformArg,
double * padfGeoTransformOut,
int * pnPixels,
int * pnLines) -> CPLErr
Suggest output file size.
Parameters
- hSrcDS: the input image (it is assumed the whole input image is being transformed).
- pfnTransformer: the transformer function.
- pTransformArg: the callback data for the transformer function.
- padfGeoTransformOut: the array of six doubles in which the suggested geotransform is returned.
- pnPixels: int in which the suggest pixel width of output is returned.
- pnLines: int in which the suggest pixel height of output is returned.
Returns
CENone if successful or CEFailure otherwise.
GDAL.gdalsuggestedwarpoutput2
— MethodGDALSuggestedWarpOutput2(GDALDatasetH hSrcDS,
GDALTransformerFunc pfnTransformer,
void * pTransformArg,
double * padfGeoTransformOut,
int * pnPixels,
int * pnLines,
double * padfExtent,
int nOptions) -> CPLErr
Suggest output file size.
Parameters
- hSrcDS: the input image (it is assumed the whole input image is being transformed).
- pfnTransformer: the transformer function.
- pTransformArg: the callback data for the transformer function.
- padfGeoTransformOut: the array of six doubles in which the suggested geotransform is returned.
- pnPixels: int in which the suggest pixel width of output is returned.
- pnLines: int in which the suggest pixel height of output is returned.
- padfExtent: Four entry array to return extents as (xmin, ymin, xmax, ymax).
- nOptions: Options flags. Zero or GDALSWOROUNDUPSIZE to ask *pnPixels and *pnLines to be rounded up instead of being rounded to the closes integer, or GDALSWOFORCESQUAREPIXEL to indicate that the generated pixel size is a square.
Returns
CENone if successful or CEFailure otherwise.
GDAL.gdalswapwords
— MethodGDALSwapWords(void * pData,
int nWordSize,
int nWordCount,
int nWordSkip) -> void
Byte swap words in-place.
Parameters
- 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.
GDAL.gdalswapwordsex
— MethodGDALSwapWordsEx(void * pData,
int nWordSize,
size_t nWordCount,
int nWordSkip) -> void
Byte swap words in-place.
Parameters
- 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.
GDAL.gdaltermprogress
— MethodGDALTermProgress(double dfComplete,
const char * pszMessage,
void * pProgressArg) -> int
Simple progress report to terminal.
Parameters
- dfComplete: completion ratio from 0.0 to 1.0.
- pszMessage: optional message.
- pProgressArg: ignored callback data argument.
Returns
Always returns TRUE indicating the process should continue.
GDAL.gdaltileindex
— MethodGDALTileIndex(const char * pszDest,
int nSrcCount,
const char *const * papszSrcDSNames,
const GDALTileIndexOptions * psOptionsIn,
int * pbUsageError) -> GDALDatasetH
Build a tile index from a list of datasets.
Parameters
- pszDest: the destination dataset path.
- nSrcCount: the number of input datasets.
- papszSrcDSNames: the list of input dataset names
- psOptionsIn: the options struct returned by GDALTileIndexOptionsNew() or NULL.
- pbUsageError: pointer to a integer output variable to store if any usage error has occurred.
Returns
the output dataset (new dataset that must be closed using GDALClose()) or NULL in case of error.
GDAL.gdaltileindexoptionsfree
— MethodGDALTileIndexOptionsFree(GDALTileIndexOptions * psOptions) -> void
Frees the GDALTileIndexOptions struct.
Parameters
- psOptions: the options struct for GDALTileIndex().
GDAL.gdaltileindexoptionsnew
— MethodGDALTileIndexOptionsNew(char ** papszArgv,
GDALTileIndexOptionsForBinary * psOptionsForBinary) -> GDALTileIndexOptions *
Allocates a GDALTileIndexOptions struct.
Parameters
- papszArgv: NULL terminated list of options (potentially including filename and open options too), or NULL. The accepted options are the ones of the gdaltindex utility.
- psOptionsForBinary: (output) may be NULL (and should generally be NULL), otherwise (gdaltindex_bin.cpp use case) must be allocated with GDALTileIndexOptionsForBinaryNew() prior to this function. Will be filled with potentially present filename, open options,...
Returns
pointer to the allocated GDALTileIndexOptions struct. Must be freed with GDALTileIndexOptionsFree().
GDAL.gdaltpstransform
— MethodGDALTPSTransform(void * pTransformArg,
int bDstToSrc,
int nPointCount,
double * x,
double * y,
double * z,
int * panSuccess) -> int
Transforms point based on GCP derived polynomial model.
Parameters
- pTransformArg: return value from GDALCreateTPSTransformer().
- bDstToSrc: TRUE if transformation is from the destination (georeferenced) coordinates to pixel/line or FALSE when transforming from pixel/line to georeferenced coordinates.
- nPointCount: the number of values in the x, y and z arrays.
- x: array containing the X values to be transformed.
- y: array containing the Y values to be transformed.
- z: array containing the Z values to be transformed.
- panSuccess: array in which a flag indicating success (TRUE) or failure (FALSE) of the transformation are placed.
Returns
TRUE.
GDAL.gdaltransformgeolocations
— Methodgdaltransformgeolocations(hXBand, hYBand, hZBand, pfnTransformer, pTransformArg, pfnProgress, pProgressArg, papszOptions)
GDAL.gdaltranslate
— MethodGDALTranslate(const char * pszDest,
GDALDatasetH hSrcDataset,
const GDALTranslateOptions * psOptionsIn,
int * pbUsageError) -> GDALDatasetH
Converts raster data between different formats.
Parameters
- pszDest: the destination dataset path.
- hSrcDataset: the source dataset handle.
- psOptionsIn: the options struct returned by GDALTranslateOptionsNew() or NULL.
- pbUsageError: pointer to a integer output variable to store if any usage error has occurred or NULL.
Returns
the output dataset (new dataset that must be closed using GDALClose()) or NULL in case of error. If the output format is a VRT dataset, then the returned VRT dataset has a reference to hSrcDataset. Hence hSrcDataset should be closed after the returned dataset if using GDALClose(). A safer alternative is to use GDALReleaseDataset() instead of using GDALClose(), in which case you can close datasets in any order.
GDAL.gdaltranslateoptionsfree
— MethodGDALTranslateOptionsFree(GDALTranslateOptions * psOptions) -> void
Frees the GDALTranslateOptions struct.
Parameters
- psOptions: the options struct for GDALTranslate().
GDAL.gdaltranslateoptionsnew
— MethodGDALTranslateOptionsNew(char ** papszArgv,
GDALTranslateOptionsForBinary * psOptionsForBinary) -> GDALTranslateOptions *
Allocates a GDALTranslateOptions struct.
Parameters
- papszArgv: NULL terminated list of options (potentially including filename and open options too), or NULL. The accepted options are the ones of the gdal_translate utility.
- psOptionsForBinary: (output) may be NULL (and should generally be NULL), otherwise (gdaltranslatebin.cpp use case) must be allocated with GDALTranslateOptionsForBinaryNew() prior to this function. Will be filled with potentially present filename, open options,...
Returns
pointer to the allocated GDALTranslateOptions struct. Must be freed with GDALTranslateOptionsFree().
GDAL.gdaltranslateoptionssetprogress
— MethodGDALTranslateOptionsSetProgress(GDALTranslateOptions * psOptions,
GDALProgressFunc pfnProgress,
void * pProgressData) -> void
Set a progress function.
Parameters
- psOptions: the options struct for GDALTranslate().
- pfnProgress: the progress callback.
- pProgressData: the user data for the progress callback.
GDAL.gdaltriangulationcomputebarycentriccoefficients
— MethodGDALTriangulationComputeBarycentricCoefficients(GDALTriangulation * psDT,
const double * padfX,
const double * padfY) -> int
Computes barycentric coefficients for each triangles of the triangulation.
Parameters
- psDT: triangulation.
- padfX: x coordinates of the points. Must be identical to the one passed to GDALTriangulationCreateDelaunay().
- padfY: y coordinates of the points. Must be identical to the one passed to GDALTriangulationCreateDelaunay().
Returns
TRUE in case of success.
GDAL.gdaltriangulationcomputebarycentriccoordinates
— MethodGDALTriangulationComputeBarycentricCoordinates(const GDALTriangulation * psDT,
int nFacetIdx,
double dfX,
double dfY,
double * pdfL1,
double * pdfL2,
double * pdfL3) -> int
Computes the barycentric coordinates of a point.
Parameters
- psDT: triangulation.
- nFacetIdx: index of the triangle in the triangulation
- dfX: x coordinate of the point.
- dfY: y coordinate of the point.
- pdfL1: (output) pointer to the 1st barycentric coordinate.
- pdfL2: (output) pointer to the 2nd barycentric coordinate.
- pdfL3: (output) pointer to the 2nd barycentric coordinate.
Returns
TRUE in case of success.
GDAL.gdaltriangulationcreatedelaunay
— MethodGDALTriangulationCreateDelaunay(int nPoints,
const double * padfX,
const double * padfY) -> GDALTriangulation *
Computes a Delaunay triangulation of the passed points.
Parameters
- nPoints: number of points
- padfX: x coordinates of the points.
- padfY: y coordinates of the points.
Returns
triangulation that must be freed with GDALTriangulationFree(), or NULL in case of error.
GDAL.gdaltriangulationfindfacetbruteforce
— MethodGDALTriangulationFindFacetBruteForce(const GDALTriangulation * psDT,
double dfX,
double dfY,
int * panOutputFacetIdx) -> int
Returns the index of the triangle that contains the point by iterating over all triangles.
Parameters
- psDT: triangulation.
- dfX: x coordinate of the point.
- dfY: y coordinate of the point.
- panOutputFacetIdx: (output) pointer to the index of the triangle, or -1 in case of failure.
Returns
index >= 0 of the triangle in case of success, -1 otherwise.
GDAL.gdaltriangulationfindfacetdirected
— MethodGDALTriangulationFindFacetDirected(const GDALTriangulation * psDT,
int nFacetIdx,
double dfX,
double dfY,
int * panOutputFacetIdx) -> int
Returns the index of the triangle that contains the point by walking in the triangulation.
Parameters
- psDT: triangulation.
- nFacetIdx: index of first triangle to start with. Must be >= 0 && < psDT->nFacets
- dfX: x coordinate of the point.
- dfY: y coordinate of the point.
- panOutputFacetIdx: (output) pointer to the index of the triangle, or -1 in case of failure.
Returns
TRUE in case of success, FALSE otherwise.
GDAL.gdaltriangulationfree
— MethodGDALTriangulationFree(GDALTriangulation * psDT) -> void
Free a triangulation.
Parameters
- psDT: triangulation.
GDAL.gdalusetransformer
— MethodGDALUseTransformer(void * pTransformArg,
int bDstToSrc,
int nPointCount,
double * x,
double * y,
double * z,
int * panSuccess) -> int
GDAL.gdalvalidatecreationoptions
— MethodGDALValidateCreationOptions(GDALDriverH hDriver,
CSLConstList papszCreationOptions) -> int
Validate the list of creation options that are handled by a driver.
Parameters
- 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
Returns
TRUE if the list of creation options is compatible with the Create() and CreateCopy() method of the driver, FALSE otherwise.
GDAL.gdalvectorinfo
— MethodGDALVectorInfo(GDALDatasetH hDataset,
const GDALVectorInfoOptions * psOptions) -> char *
Lists various information about a GDAL supported vector dataset.
Parameters
- hDataset: the dataset handle.
- psOptions: the options structure returned by GDALVectorInfoOptionsNew() or NULL.
Returns
string corresponding to the information about the raster dataset (must be freed with CPLFree()), or NULL in case of error.
GDAL.gdalvectorinfooptionsfree
— MethodGDALVectorInfoOptionsFree(GDALVectorInfoOptions * psOptions) -> void
Frees the GDALVectorInfoOptions struct.
Parameters
- psOptions: the options struct for GDALVectorInfo().
GDAL.gdalvectorinfooptionsnew
— MethodGDALVectorInfoOptionsNew(char ** papszArgv,
GDALVectorInfoOptionsForBinary * psOptionsForBinary) -> GDALVectorInfoOptions *
Allocates a GDALVectorInfoOptions struct.
Parameters
- papszArgv: NULL terminated list of options (potentially including filename and open options too), or NULL. The accepted options are the ones of the ogrinfo utility.
- psOptionsForBinary: (output) may be NULL (and should generally be NULL), otherwise (ogrinfo_bin.cpp use case) must be allocated with GDALVectorInfoOptionsForBinaryNew() prior to this function. Will be filled with potentially present filename, open options, subdataset number...
Returns
pointer to the allocated GDALVectorInfoOptions struct. Must be freed with GDALVectorInfoOptionsFree().
GDAL.gdalvectortranslate
— MethodGDALVectorTranslate(const char * pszDest,
GDALDatasetH hDstDS,
int nSrcCount,
GDALDatasetH * pahSrcDS,
const GDALVectorTranslateOptions * psOptionsIn,
int * pbUsageError) -> GDALDatasetH
Converts vector data between file formats.
Parameters
- pszDest: the destination dataset path or NULL.
- hDstDS: the destination dataset or NULL.
- nSrcCount: the number of input datasets (only 1 supported currently)
- pahSrcDS: the list of input datasets.
- psOptionsIn: the options struct returned by GDALVectorTranslateOptionsNew() or NULL.
- pbUsageError: pointer to a integer output variable to store if any usage error has occurred, or NULL.
Returns
the output dataset (new dataset that must be closed using GDALClose(), or hDstDS is not NULL) or NULL in case of error.
GDAL.gdalvectortranslateoptionsfree
— MethodGDALVectorTranslateOptionsFree(GDALVectorTranslateOptions * psOptions) -> void
Frees the GDALVectorTranslateOptions struct.
Parameters
- psOptions: the options struct for GDALVectorTranslate().
GDAL.gdalvectortranslateoptionsnew
— MethodGDALVectorTranslateOptionsNew(char ** papszArgv,
GDALVectorTranslateOptionsForBinary * psOptionsForBinary) -> GDALVectorTranslateOptions *
allocates a GDALVectorTranslateOptions struct.
Parameters
- papszArgv: NULL terminated list of options (potentially including filename and open options too), or NULL. The accepted options are the ones of the ogr2ogr utility.
- psOptionsForBinary: (output) may be NULL (and should generally be NULL), otherwise (gdaltranslatebin.cpp use case) must be allocated with GDALVectorTranslateOptionsForBinaryNew() prior to this function. Will be filled with potentially present filename, open options,...
Returns
pointer to the allocated GDALVectorTranslateOptions struct. Must be freed with GDALVectorTranslateOptionsFree().
GDAL.gdalvectortranslateoptionssetprogress
— MethodGDALVectorTranslateOptionsSetProgress(GDALVectorTranslateOptions * psOptions,
GDALProgressFunc pfnProgress,
void * pProgressData) -> void
Set a progress function.
Parameters
- psOptions: the options struct for GDALVectorTranslate().
- pfnProgress: the progress callback.
- pProgressData: the user data for the progress callback.
GDAL.gdalversioninfo
— MethodGDALVersionInfo(const char * pszRequest) -> const char *
Get runtime version information.
Parameters
- pszRequest: the type of version info desired, as listed above.
Returns
an internal string containing the requested information.
GDAL.gdalviewshedgenerate
— MethodGDALViewshedGenerate(GDALRasterBandH hBand,
const char * pszDriverName,
const char * pszTargetRasterName,
CSLConstList papszCreationOptions,
double dfObserverX,
double dfObserverY,
double dfObserverHeight,
double dfTargetHeight,
double dfVisibleVal,
double dfInvisibleVal,
double dfOutOfRangeVal,
double dfNoDataVal,
double dfCurvCoeff,
GDALViewshedMode eMode,
double dfMaxDistance,
GDALProgressFunc pfnProgress,
void * pProgressArg,
GDALViewshedOutputType heightMode,
CSLConstList papszExtraOptions) -> GDALDatasetH
Create viewshed from raster DEM.
Parameters
- hBand: The band to read the DEM data from. Only the part of the raster within the specified maxdistance around the observer point is processed.
- pszDriverName: Driver name (GTiff if set to NULL)
- pszTargetRasterName: The name of the target raster to be generated. Must not be NULL
- papszCreationOptions: creation options.
- dfObserverX: observer X value (in SRS units)
- dfObserverY: observer Y value (in SRS units)
- dfObserverHeight: The height of the observer above the DEM surface.
- dfTargetHeight: The height of the target above the DEM surface. (default 0)
- dfVisibleVal: pixel value for visibility (default 255)
- dfInvisibleVal: pixel value for invisibility (default 0)
- dfOutOfRangeVal: The value to be set for the cells that fall outside of the range specified by dfMaxDistance.
- dfNoDataVal: The value to be set for the cells that have no data. If set to a negative value, nodata is not set. Note: currently, no special processing of input cells at a nodata value is done (which may result in erroneous results).
- dfCurvCoeff: Coefficient to consider the effect of the curvature and refraction. The height of the DEM is corrected according to the following formula: [Height] -= dfCurvCoeff * [Target Distance]^2 / [Earth Diameter] For the effect of the atmospheric refraction we can use 0.85714.
- eMode: The mode of the viewshed calculation. Possible values GVMDiagonal = 1, GVMEdge = 2 (default), GVMMax = 3, GVMMin = 4.
- dfMaxDistance: maximum distance range to compute viewshed. It is also used to clamp the extent of the output raster. If set to 0, then unlimited range is assumed, that is to say the computation is performed on the extent of the whole raster.
- pfnProgress: A GDALProgressFunc that may be used to report progress to the user, or to interrupt the algorithm. May be NULL if not required.
- pProgressArg: The callback data for the pfnProgress function.
- heightMode: Type of information contained in output raster. Possible values GVOTNORMAL = 1 (default), GVOTMINTARGETHEIGHTFROMDEM = 2, GVOTMINTARGETHEIGHTFROM_GROUND = 3
- papszExtraOptions: Future extra options. Must be set to NULL currently.
Returns
not NULL output dataset on success (to be closed with GDALClose()) or NULL if an error occurs.
GDAL.gdalvrtregisterprocesseddatasetfunc
— MethodGDALVRTRegisterProcessedDatasetFunc(const char * pszFuncName,
void * pUserData,
const char * pszXMLMetadata,
GDALDataType eRequestedInputDT,
const GDALDataType * paeSupportedInputDT,
size_t nSupportedInputDTSize,
const int * panSupportedInputBandCount,
size_t nSupportedInputBandCountSize,
GDALVRTProcessedDatasetFuncInit pfnInit,
GDALVRTProcessedDatasetFuncFree pfnFree,
GDALVRTProcessedDatasetFuncProcess pfnProcess,
CSLConstList papszOptions) -> CPLErr
Register a function to be used by VRTProcessedDataset.
Parameters
- pszFuncName: Function name. Must be unique and not null.
- pUserData: User data. May be nullptr. Must remain valid during the lifetime of GDAL.
- pszXMLMetadata: XML metadata describing the function arguments. May be nullptr if there are no arguments.
- eRequestedInputDT: If the pfnProcess callback only supports a single data type, it should be specified in this parameter. Otherwise set it to GDT_Unknown.
- paeSupportedInputDT: List of supported input data types. May be nullptr if all are supported or if eRequestedInputDT is set to a non GDT_Unknown value.
- nSupportedInputDTSize: Size of paeSupportedInputDT
- panSupportedInputBandCount: List of supported band count. May be nullptr if any source band count is supported.
- nSupportedInputBandCountSize: Size of panSupportedInputBandCount
- pfnInit: Initialization function called when a VRTProcessedDataset step uses the register function. This initialization function will return the output data type, output band count and potentially initialize a working structure, typically parsing arguments. May be nullptr. If not specified, it will be assumed that the input and output data types are the same, and that the input number of bands and output number of bands are the same.
- pfnFree: Free function that will free the working structure allocated by pfnInit. May be nullptr.
- pfnProcess: Processing function called to compute pixel values. Must not be nullptr.
- papszOptions: Unused currently. Must be nullptr.
Returns
CE_None in case of success, error otherwise.
GDAL.gdalwarp
— MethodGDALWarp(const char * pszDest,
GDALDatasetH hDstDS,
int nSrcCount,
GDALDatasetH * pahSrcDS,
const GDALWarpAppOptions * psOptionsIn,
int * pbUsageError) -> GDALDatasetH
Image reprojection and warping function.
Parameters
- pszDest: the destination dataset path or NULL.
- hDstDS: the destination dataset or NULL.
- nSrcCount: the number of input datasets.
- pahSrcDS: the list of input datasets. For practical purposes, the type of this argument should be considered as "const GDALDatasetH* const*", that is neither the array nor its values are mutated by this function.
- psOptionsIn: the options struct returned by GDALWarpAppOptionsNew() or NULL.
- pbUsageError: pointer to a integer output variable to store if any usage error has occurred, or NULL.
Returns
the output dataset (new dataset that must be closed using GDALClose(), or hDstDS if not NULL) or NULL in case of error. If the output format is a VRT dataset, then the returned VRT dataset has a reference to pahSrcDS[0]. Hence pahSrcDS[0] should be closed after the returned dataset if using GDALClose(). A safer alternative is to use GDALReleaseDataset() instead of using GDALClose(), in which case you can close datasets in any order.
GDAL.gdalwarpappoptionsfree
— MethodGDALWarpAppOptionsFree(GDALWarpAppOptions * psOptions) -> void
Frees the GDALWarpAppOptions struct.
Parameters
- psOptions: the options struct for GDALWarp().
GDAL.gdalwarpappoptionsnew
— MethodGDALWarpAppOptionsNew(char ** papszArgv,
GDALWarpAppOptionsForBinary * psOptionsForBinary) -> GDALWarpAppOptions *
Allocates a GDALWarpAppOptions struct.
Parameters
- papszArgv: NULL terminated list of options (potentially including filename and open options too), or NULL. The accepted options are the ones of the gdalwarp utility.
- psOptionsForBinary: (output) may be NULL (and should generally be NULL), otherwise (gdaltranslatebin.cpp use case) must be allocated with GDALWarpAppOptionsForBinaryNew() prior to this function. Will be filled with potentially present filename, open options,...
Returns
pointer to the allocated GDALWarpAppOptions struct. Must be freed with GDALWarpAppOptionsFree().
GDAL.gdalwarpappoptionssetprogress
— MethodGDALWarpAppOptionsSetProgress(GDALWarpAppOptions * psOptions,
GDALProgressFunc pfnProgress,
void * pProgressData) -> void
Set a progress function.
Parameters
- psOptions: the options struct for GDALWarp().
- pfnProgress: the progress callback.
- pProgressData: the user data for the progress callback.
GDAL.gdalwarpappoptionssetquiet
— MethodGDALWarpAppOptionsSetQuiet(GDALWarpAppOptions * psOptions,
int bQuiet) -> void
Set a progress function.
Parameters
- psOptions: the options struct for GDALWarp().
- bQuiet: whether GDALWarp() should emit messages on stdout.
GDAL.gdalwarpappoptionssetwarpoption
— MethodGDALWarpAppOptionsSetWarpOption(GDALWarpAppOptions * psOptions,
const char * pszKey,
const char * pszValue) -> void
Set a warp option.
Parameters
- psOptions: the options struct for GDALWarp().
- pszKey: key.
- pszValue: value.
GDAL.gdalwarpcutlinemasker
— MethodGDALWarpCutlineMasker(void * pMaskFuncArg,
int nBandCount,
GDALDataType eType,
int nXOff,
int nYOff,
int nXSize,
int nYSize,
GByte ** ppImageData,
int bMaskIsFloat,
void * pValidityMask) -> CPLErr
GDAL.gdalwarpcutlinemaskerex
— MethodGDALWarpCutlineMaskerEx(void * pMaskFuncArg,
int,
GDALDataType,
int nXOff,
int nYOff,
int nXSize,
int nYSize,
GByte **,
int bMaskIsFloat,
void * pValidityMask,
int * pnValidityFlag) -> CPLErr
GDAL.gdalwarpdstalphamasker
— MethodGDALWarpDstAlphaMasker(void * pMaskFuncArg,
int nBandCount,
GDALDataType,
int nXOff,
int nYOff,
int nXSize,
int nYSize,
GByte **,
int bMaskIsFloat,
void * pValidityMask) -> CPLErr
GDAL.gdalwarpinitdefaultbandmapping
— MethodGDALWarpInitDefaultBandMapping(GDALWarpOptions * psOptionsIn,
int nBandCount) -> void
Init src and dst band mappings such that Bands[i] = i+1 for nBandCount Does nothing if psOptionsIn->nBandCount is non-zero.
Parameters
- psOptionsIn: options to initialize.
- nBandCount: bands to initialize for.
GDAL.gdalwarpinitdstnodataimag
— MethodGDALWarpInitDstNoDataImag(GDALWarpOptions * psOptionsIn,
double dNoDataImag) -> void
Initialize padfDstNoDataImag with specified value.
Parameters
- psOptionsIn: options to initialize.
- dNoDataImag: value to initialize to.
GDAL.gdalwarpinitdstnodatareal
— MethodGDALWarpInitDstNoDataReal(GDALWarpOptions * psOptionsIn,
double dNoDataReal) -> void
Initialize padfDstNoDataReal with specified value.
Parameters
- psOptionsIn: options to initialize.
- dNoDataReal: value to initialize to.
GDAL.gdalwarpinitnodatareal
— MethodGDALWarpInitNoDataReal(GDALWarpOptions * psOptionsIn,
double dNoDataReal) -> void
Initialize padfSrcNoDataReal and padfDstNoDataReal with specified value.
Parameters
- psOptionsIn: options to initialize.
- dNoDataReal: value to initialize to.
GDAL.gdalwarpinitsrcnodataimag
— MethodGDALWarpInitSrcNoDataImag(GDALWarpOptions * psOptionsIn,
double dNoDataImag) -> void
Initialize padfSrcNoDataImag with specified value.
Parameters
- psOptionsIn: options to initialize.
- dNoDataImag: value to initialize to.
GDAL.gdalwarpinitsrcnodatareal
— MethodGDALWarpInitSrcNoDataReal(GDALWarpOptions * psOptionsIn,
double dNoDataReal) -> void
Initialize padfSrcNoDataReal with specified value.
Parameters
- psOptionsIn: options to initialize.
- dNoDataReal: value to initialize to.
GDAL.gdalwarpnodatamasker
— MethodGDALWarpNoDataMasker(void * pMaskFuncArg,
int nBandCount,
GDALDataType eType,
int,
int,
int nXSize,
int nYSize,
GByte ** ppImageData,
int bMaskIsFloat,
void * pValidityMask,
int * pbOutAllValid) -> CPLErr
GDAL.gdalwarpregion
— MethodGDALWarpRegion(GDALWarpOperationH hOperation,
int nDstXOff,
int nDstYOff,
int nDstXSize,
int nDstYSize,
int nSrcXOff,
int nSrcYOff,
int nSrcXSize,
int nSrcYSize) -> CPLErr
GDAL.gdalwarpregiontobuffer
— MethodGDALWarpRegionToBuffer(GDALWarpOperationH hOperation,
int nDstXOff,
int nDstYOff,
int nDstXSize,
int nDstYSize,
void * pDataBuf,
GDALDataType eBufDataType,
int nSrcXOff,
int nSrcYOff,
int nSrcXSize,
int nSrcYSize) -> CPLErr
GDAL.gdalwarpresolveworkingdatatype
— MethodGDALWarpResolveWorkingDataType(GDALWarpOptions * psOptions) -> void
If the working data type is unknown, this method will determine a valid working data type to support the data in the src and dest data sets and any noData values.
Parameters
- psOptions: options to initialize.
GDAL.gdalwarpsrcalphamasker
— MethodGDALWarpSrcAlphaMasker(void * pMaskFuncArg,
int,
GDALDataType,
int nXOff,
int nYOff,
int nXSize,
int nYSize,
GByte **,
int bMaskIsFloat,
void * pValidityMask,
int * pbOutAllOpaque) -> CPLErr
GDAL.gdalwarpsrcmaskmasker
— MethodGDALWarpSrcMaskMasker(void * pMaskFuncArg,
int,
GDALDataType,
int nXOff,
int nYOff,
int nXSize,
int nYSize,
GByte **,
int bMaskIsFloat,
void * pValidityMask) -> CPLErr
GDAL.gdalwriteblock
— MethodGDALWriteBlock(GDALRasterBandH hBand,
int nXOff,
int nYOff,
void * pData) -> CPLErr
Write a block of image data efficiently.
GDAL.gdalwriteworldfile
— MethodGDALWriteWorldFile(const char * pszBaseFilename,
const char * pszExtension,
double * padfGeoTransform) -> int
Write ESRI world file.
Parameters
- pszBaseFilename: the target raster file.
- pszExtension: the extension to use (i.e. "wld"). Must not be NULL
- padfGeoTransform: the six double array from which the geotransformation should be read.
Returns
TRUE on success or FALSE on failure.
GDAL.gwkgetfilterfunc
— MethodGWKGetFilterFunc(GDALResampleAlg eResampleAlg) -> FilterFuncType
GDAL.gwkgetfilterfunc4values
— MethodGWKGetFilterFunc4Values(GDALResampleAlg eResampleAlg) -> FilterFunc4ValuesType
GDAL.gwkgetfilterradius
— Methodgwkgetfilterradius(eResampleAlg)
Doxygen_Suppress
GDAL.maybe_throw
— MethodCheck the last error type and throw a GDALError if it is a failure
GDAL.octclone
— MethodOCTClone(OGRCoordinateTransformationH hTransform) -> OGRCoordinateTransformationH
Clone transformation object.
Returns
handle to transformation's clone or NULL on error, must be freed with OCTDestroyCoordinateTransformation
GDAL.octcoordinatetransformationoptionssetareaofinterest
— MethodOCTCoordinateTransformationOptionsSetAreaOfInterest(OGRCoordinateTransformationOptionsH hOptions,
double dfWestLongitudeDeg,
double dfSouthLatitudeDeg,
double dfEastLongitudeDeg,
double dfNorthLatitudeDeg) -> int
Sets an area of interest.
GDAL.octcoordinatetransformationoptionssetballparkallowed
— MethodOCTCoordinateTransformationOptionsSetBallparkAllowed(OGRCoordinateTransformationOptionsH hOptions,
int bAllowBallpark) -> int
Sets whether ballpark transformations are allowed.
GDAL.octcoordinatetransformationoptionssetdesiredaccuracy
— MethodOCTCoordinateTransformationOptionsSetDesiredAccuracy(OGRCoordinateTransformationOptionsH hOptions,
double dfAccuracy) -> int
Sets the desired accuracy for coordinate operations.
GDAL.octcoordinatetransformationoptionssetonlybest
— MethodOCTCoordinateTransformationOptionsSetOnlyBest(OGRCoordinateTransformationOptionsH hOptions,
bool bOnlyBest) -> int
Sets whether only the "best" operation(s) should be used.
GDAL.octcoordinatetransformationoptionssetoperation
— MethodOCTCoordinateTransformationOptionsSetOperation(OGRCoordinateTransformationOptionsH hOptions,
const char * pszCO,
int bReverseCO) -> int
Sets a coordinate operation.
GDAL.octdestroycoordinatetransformation
— MethodOCTDestroyCoordinateTransformation(OGRCoordinateTransformationH hCT) -> void
OGRCoordinateTransformation destructor.
Parameters
- hCT: the object to delete
GDAL.octdestroycoordinatetransformationoptions
— MethodOCTDestroyCoordinateTransformationOptions(OGRCoordinateTransformationOptionsH hOptions) -> void
Destroy coordinate transformation options.
GDAL.octgetinverse
— MethodOCTGetInverse(OGRCoordinateTransformationH hTransform) -> OGRCoordinateTransformationH
Inverse transformation object.
Returns
handle to inverse transformation or NULL on error, must be freed with OCTDestroyCoordinateTransformation
GDAL.octgetsourcecs
— MethodOCTGetSourceCS(OGRCoordinateTransformationH hTransform) -> OGRSpatialReferenceH
Transformation's source coordinate system reference.
Returns
handle to transformation's source coordinate system or NULL if not present.
GDAL.octgettargetcs
— MethodOCTGetTargetCS(OGRCoordinateTransformationH hTransform) -> OGRSpatialReferenceH
Transformation's target coordinate system reference.
Returns
handle to transformation's target coordinate system or NULL if not present.
GDAL.octnewcoordinatetransformation
— MethodOCTNewCoordinateTransformation(OGRSpatialReferenceH hSourceSRS,
OGRSpatialReferenceH hTargetSRS) -> OGRCoordinateTransformationH
Create transformation object.
Parameters
- hSourceSRS: source spatial reference system.
- hTargetSRS: target spatial reference system.
Returns
NULL on failure or a ready to use transformation object.
GDAL.octnewcoordinatetransformationex
— MethodOCTNewCoordinateTransformationEx(OGRSpatialReferenceH hSourceSRS,
OGRSpatialReferenceH hTargetSRS,
OGRCoordinateTransformationOptionsH hOptions) -> OGRCoordinateTransformationH
Create transformation object.
Parameters
- hSourceSRS: source spatial reference system.
- hTargetSRS: target spatial reference system.
- hOptions: Coordinate transformation options.
Returns
NULL on failure or a ready to use transformation object.
GDAL.octnewcoordinatetransformationoptions
— MethodOCTNewCoordinateTransformationOptions(void) -> OGRCoordinateTransformationOptionsH
Create coordinate transformation options.
GDAL.octtransform
— MethodOCTTransform(OGRCoordinateTransformationH hTransform,
int nCount,
double * x,
double * y,
double * z) -> int
Transform an array of points.
Parameters
- hTransform: Transformation object
- nCount: Number of points
- x: Array of nCount x values.
- y: Array of nCount y values.
- z: Array of nCount z values.
Returns
TRUE if a transformation could be found (but not all points may have necessarily succeed to transform), otherwise FALSE.
GDAL.octtransform4d
— MethodOCTTransform4D(OGRCoordinateTransformationH hTransform,
int nCount,
double * x,
double * y,
double * z,
double * t,
int * pabSuccess) -> int
Transform an array of points.
Parameters
- hTransform: Transformation object
- nCount: Number of points
- x: Array of nCount x values. Should not be NULL
- y: Array of nCount y values. Should not be NULL
- z: Array of nCount z values. Might be NULL
- t: Array of nCount time values. Might be NULL
- pabSuccess: Output array of nCount value that will be set to TRUE/FALSE. Might be NULL.
Returns
TRUE if a transformation could be found (but not all points may have necessarily succeed to transform), otherwise FALSE.
GDAL.octtransform4dwitherrorcodes
— MethodOCTTransform4DWithErrorCodes(OGRCoordinateTransformationH hTransform,
int nCount,
double * x,
double * y,
double * z,
double * t,
int * panErrorCodes) -> int
Transform an array of points.
Parameters
- hTransform: Transformation object
- nCount: Number of points
- x: Array of nCount x values. Should not be NULL
- y: Array of nCount y values. Should not be NULL
- z: Array of nCount z values. Might be NULL
- t: Array of nCount time values. Might be NULL
- panErrorCodes: Output array of nCount value that will be set to 0 for success, or a non-zero value for failure. Refer to PROJ 8 public error codes. Might be NULL
Returns
TRUE if a transformation could be found (but not all points may have necessarily succeed to transform), otherwise FALSE.
GDAL.octtransformbounds
— MethodOCTTransformBounds(OGRCoordinateTransformationH hTransform,
const double xmin,
const double ymin,
const double xmax,
const double ymax,
double * out_xmin,
double * out_ymin,
double * out_xmax,
double * out_ymax,
int densify_pts) -> int
Transform boundary.
Parameters
- hTransform: Transformation object
- xmin: Minimum bounding coordinate of the first axis in source CRS.
- ymin: Minimum bounding coordinate of the second axis in source CRS.
- xmax: Maximum bounding coordinate of the first axis in source CRS.
- ymax: Maximum bounding coordinate of the second axis in source CRS.
- out_xmin: Minimum bounding coordinate of the first axis in target CRS
- out_ymin: Minimum bounding coordinate of the second axis in target CRS.
- out_xmax: Maximum bounding coordinate of the first axis in target CRS.
- out_ymax: Maximum bounding coordinate of the second axis in target CRS.
- densify_pts: Recommended to use 21. This is the number of points to use to densify the bounding polygon in the transformation.
Returns
TRUE if successful. FALSE if failures encountered.
GDAL.octtransformex
— MethodOCTTransformEx(OGRCoordinateTransformationH hTransform,
int nCount,
double * x,
double * y,
double * z,
int * pabSuccess) -> int
Transform an array of points.
Parameters
- hTransform: Transformation object
- nCount: Number of points
- x: Array of nCount x values.
- y: Array of nCount y values.
- z: Array of nCount z values.
- pabSuccess: Output array of nCount value that will be set to TRUE/FALSE
Returns
TRUE if a transformation could be found (but not all points may have necessarily succeed to transform), otherwise FALSE.
GDAL.ogr_aretypesubtypecompatible
— MethodOGR_AreTypeSubTypeCompatible(OGRFieldType eType,
OGRFieldSubType eSubType) -> int
Return if type and subtype are compatible.
Parameters
- eType: the field type.
- eSubType: the field subtype.
Returns
TRUE if type and subtype are compatible
GDAL.ogr_codedflddomain_create
— MethodOGR_CodedFldDomain_Create(const char * pszName,
const char * pszDescription,
OGRFieldType eFieldType,
OGRFieldSubType eFieldSubType,
const OGRCodedValue * enumeration) -> OGRFieldDomainH
Creates a new coded field domain.
Parameters
- pszName: Domain name. Should not be NULL.
- pszDescription: Domain description (can be NULL)
- eFieldType: Field type. Generally numeric. Potentially OFTDateTime
- eFieldSubType: Field subtype.
- enumeration: Enumeration as (code, value) pairs. Should not be NULL. The end of the enumeration is marked by a code set to NULL. The enumeration will be copied. Each code should appear only once, but it is the responsibility of the user to check it.
Returns
a new handle that should be freed with OGRFldDomainDestroy(), or NULL in case of error.
GDAL.ogr_codedflddomain_getenumeration
— MethodOGR_CodedFldDomain_GetEnumeration(OGRFieldDomainH hFieldDomain) -> const OGRCodedValue *
Get the enumeration as (code, value) pairs.
Parameters
- hFieldDomain: Field domain handle.
Returns
the (code, value) pairs, or nullptr in case of error.
GDAL.ogr_dr_copydatasource
— MethodOGR_Dr_CopyDataSource(OGRSFDriverH,
OGRDataSourceH,
const char *,
char **) -> OGRDataSourceH
This function creates a new datasource by copying all the layers from the source datasource.
Parameters
- hDriver: handle to the driver on which data source creation is based.
- hSrcDS: source datasource
- pszNewName: the name for the new data source.
- papszOptions: a StringList of name=value options. Options are driver specific, and driver information can be found at the following url: http://www.gdal.org/ogr_formats.html
Returns
NULL is returned on failure, or a new OGRDataSource handle on success.
GDAL.ogr_dr_createdatasource
— MethodOGR_Dr_CreateDataSource(OGRSFDriverH,
const char *,
char **) -> OGRDataSourceH
This function attempts to create a new data source based on the passed driver.
Parameters
- hDriver: handle to the driver on which data source creation is based.
- pszName: the name for the new data source. UTF-8 encoded.
- papszOptions: a StringList of name=value options. Options are driver specific, and driver information can be found at the following url: http://www.gdal.org/ogr_formats.html
Returns
NULL is returned on failure, or a new OGRDataSource handle on success.
GDAL.ogr_dr_deletedatasource
— MethodOGR_Dr_DeleteDataSource(OGRSFDriverH,
const char *) -> OGRErr
Delete a datasource.
Parameters
- hDriver: handle to the driver on which data source deletion is based.
- pszDataSource: the name of the datasource to delete.
Returns
OGRERRNONE on success, and OGRERRUNSUPPORTED_OPERATION if this is not supported by this driver.
GDAL.ogr_dr_getname
— MethodOGR_Dr_GetName(OGRSFDriverH) -> const char *
Fetch name of driver (file format).
Parameters
- hDriver: handle to the driver to get the name from.
Returns
driver name. This is an internal string and should not be modified or freed.
GDAL.ogr_dr_open
— MethodOGR_Dr_Open(OGRSFDriverH,
const char *,
int) -> OGRDataSourceH
Attempt to open file with this driver.
Parameters
- hDriver: handle to the driver that is used to open file.
- pszName: the name of the file, or data source to try and open.
- bUpdate: TRUE if update access is required, otherwise FALSE (the default).
Returns
NULL on error or if the pass name is not supported by this driver, otherwise a handle to a GDALDataset. This GDALDataset should be closed by deleting the object when it is no longer needed.
GDAL.ogr_dr_testcapability
— MethodOGR_Dr_TestCapability(OGRSFDriverH,
const char *) -> int
Test if capability is available.
Parameters
- hDriver: handle to the driver to test the capability against.
- pszCap: the capability to test.
Returns
TRUE if capability available otherwise FALSE.
GDAL.ogr_ds_copylayer
— MethodOGR_DS_CopyLayer(OGRDataSourceH hDS,
OGRLayerH hSrcLayer,
const char * pszNewName,
char ** papszOptions) -> OGRLayerH
Duplicate an existing layer.
Parameters
- hDS: handle to the data source where to create the new layer
- hSrcLayer: handle to the source layer.
- pszNewName: the name of the layer to create.
- papszOptions: a StringList of name=value options. Options are driver specific.
Returns
a handle to the layer, or NULL if an error occurs.
GDAL.ogr_ds_createlayer
— MethodOGR_DS_CreateLayer(OGRDataSourceH hDS,
const char * pszName,
OGRSpatialReferenceH hSpatialRef,
OGRwkbGeometryType eType,
char ** papszOptions) -> OGRLayerH
This function attempts to create a new layer on the data source with the indicated name, coordinate system, geometry type.
Parameters
- hDS: The dataset handle.
- pszName: the name for the new layer. This should ideally not match any existing layer on the datasource.
- hSpatialRef: handle to the coordinate system to use for the new layer, or NULL if no coordinate system is available. The driver might only increase the reference counter of the object to take ownership, and not make a full copy, so do not use OSRDestroySpatialReference(), but OSRRelease() instead when you are done with the object.
- eType: the geometry type for the layer. Use wkbUnknown if there are no constraints on the types geometry to be written.
- papszOptions: a StringList of name=value options. Options are driver specific, and driver information can be found at the following url: http://www.gdal.org/ogr_formats.html
Returns
NULL is returned on failure, or a new OGRLayer handle on success.
GDAL.ogr_ds_deletelayer
— MethodOGR_DS_DeleteLayer(OGRDataSourceH hDS,
int iLayer) -> OGRErr
Delete the indicated layer from the datasource.
Parameters
- hDS: handle to the datasource
- iLayer: the index of the layer to delete.
Returns
OGRERRNONE on success, or OGRERRUNSUPPORTED_OPERATION if deleting layers is not supported for this datasource.
GDAL.ogr_ds_dereference
— MethodOGR_DS_Dereference(OGRDataSourceH hDataSource) -> int
GDAL.ogr_ds_destroy
— MethodOGR_DS_Destroy(OGRDataSourceH hDS) -> void
Closes opened datasource and releases allocated resources.
Parameters
- hDS: handle to allocated datasource object.
GDAL.ogr_ds_executesql
— MethodOGR_DS_ExecuteSQL(OGRDataSourceH hDS,
const char * pszStatement,
OGRGeometryH hSpatialFilter,
const char * pszDialect) -> OGRLayerH
Execute an SQL statement against the data store.
Parameters
- hDS: handle to the data source on which the SQL query is executed.
- pszStatement: the SQL statement to execute.
- hSpatialFilter: handle to a geometry which represents a spatial filter. Can be NULL.
- pszDialect: allows control of the statement dialect. If set to NULL, the OGR SQL engine will be used, except for RDBMS drivers that will use their dedicated SQL engine, unless OGRSQL is explicitly passed as the dialect. The SQLITE dialect can also be used.
Returns
a handle to a OGRLayer containing the results of the query. Deallocate with OGRDSReleaseResultSet().
GDAL.ogr_ds_getdriver
— MethodOGR_DS_GetDriver(OGRDataSourceH hDS) -> OGRSFDriverH
Returns the driver that the dataset was opened with.
Parameters
- hDS: handle to the datasource
Returns
NULL if driver info is not available, or pointer to a driver owned by the OGRSFDriverManager.
GDAL.ogr_ds_getlayer
— MethodOGR_DS_GetLayer(OGRDataSourceH hDS,
int iLayer) -> OGRLayerH
Fetch a layer by index.
Parameters
- hDS: handle to the data source from which to get the layer.
- iLayer: a layer number between 0 and OGRDSGetLayerCount()-1.
Returns
a handle to the layer, or NULL if iLayer is out of range or an error occurs.
GDAL.ogr_ds_getlayerbyname
— MethodOGR_DS_GetLayerByName(OGRDataSourceH hDS,
const char * pszLayerName) -> OGRLayerH
Fetch a layer by name.
Parameters
- hDS: handle to the data source from which to get the layer.
- pszLayerName: Layer the layer name of the layer to fetch.
Returns
a handle to the layer, or NULL if the layer is not found or an error occurs.
GDAL.ogr_ds_getlayercount
— MethodOGR_DS_GetLayerCount(OGRDataSourceH hDS) -> int
Get the number of layers in this data source.
Parameters
- hDS: handle to the data source from which to get the number of layers.
Returns
layer count.
GDAL.ogr_ds_getname
— MethodOGR_DS_GetName(OGRDataSourceH hDS) -> const char *
Returns the name of the data source.
Parameters
- hDS: handle to the data source to get the name from.
Returns
pointer to an internal name string which should not be modified or freed by the caller.
GDAL.ogr_ds_getrefcount
— MethodOGR_DS_GetRefCount(OGRDataSourceH hDataSource) -> int
GDAL.ogr_ds_getstyletable
— Methodogr_ds_getstyletable(arg1)
Get style table
GDAL.ogr_ds_getsummaryrefcount
— MethodOGR_DS_GetSummaryRefCount(OGRDataSourceH hDataSource) -> int
GDAL.ogr_ds_reference
— Methodogr_ds_reference(arg1)
Doxygen_Suppress
GDAL.ogr_ds_releaseresultset
— MethodOGR_DS_ReleaseResultSet(OGRDataSourceH hDS,
OGRLayerH hLayer) -> void
Release results of OGRDSExecuteSQL().
Parameters
- hDS: a handle to the data source on which was executed an SQL query.
- hLayer: handle to the result of a previous OGRDSExecuteSQL() call.
GDAL.ogr_ds_setstyletable
— Methodogr_ds_setstyletable(arg1, arg2)
Set style table
GDAL.ogr_ds_setstyletabledirectly
— Methodogr_ds_setstyletabledirectly(arg1, arg2)
Set style table (and take ownership)
GDAL.ogr_ds_synctodisk
— Methodogr_ds_synctodisk(arg1)
Flush pending changes to disk. See GDALDataset::FlushCache()
GDAL.ogr_ds_testcapability
— MethodOGR_DS_TestCapability(OGRDataSourceH hDS,
const char * pszCapability) -> int
Test if capability is available.
Parameters
- hDS: handle to the data source against which to test the capability.
- pszCapability: the capability to test.
Returns
TRUE if capability available otherwise FALSE.
GDAL.ogr_f_clone
— MethodOGR_F_Clone(OGRFeatureH hFeat) -> OGRFeatureH
Duplicate feature.
Parameters
- hFeat: handle to the feature to clone.
Returns
a handle to the new feature, exactly matching this feature.
GDAL.ogr_f_create
— MethodOGR_F_Create(OGRFeatureDefnH hDefn) -> OGRFeatureH
Feature factory.
Parameters
- hDefn: handle to the feature class (layer) definition to which the feature will adhere.
Returns
a handle to the new feature object with null fields and no geometry, or, starting with GDAL 2.1, NULL in case out of memory situation.
GDAL.ogr_f_destroy
— MethodOGR_F_Destroy(OGRFeatureH hFeat) -> void
Destroy feature.
Parameters
- hFeat: handle to the feature to destroy.
GDAL.ogr_f_dumpreadable
— MethodOGR_F_DumpReadable(OGRFeatureH hFeat,
FILE * fpOut) -> void
Dump this feature in a human readable form.
Parameters
- hFeat: handle to the feature to dump.
- fpOut: the stream to write to, such as strout.
GDAL.ogr_f_dumpreadableasstring
— MethodOGR_F_DumpReadableAsString(OGRFeatureH hFeat,
CSLConstList papszOptions) -> char *
Dump this feature in a human readable form.
Parameters
- hFeat: handle to the feature to dump.
- papszOptions: NULL terminated list of options (may be NULL)
Returns
a string with the feature representation (to be freed with CPLFree())
GDAL.ogr_f_equal
— MethodOGR_F_Equal(OGRFeatureH hFeat,
OGRFeatureH hOtherFeat) -> int
Test if two features are the same.
Parameters
- hFeat: handle to one of the feature.
- hOtherFeat: handle to the other feature to test this one against.
Returns
TRUE if they are equal, otherwise FALSE.
GDAL.ogr_f_fillunsetwithdefault
— MethodOGR_F_FillUnsetWithDefault(OGRFeatureH hFeat,
int bNotNullableOnly,
char ** papszOptions) -> void
Fill unset fields with default values that might be defined.
Parameters
- hFeat: handle to the feature.
- bNotNullableOnly: if we should fill only unset fields with a not-null constraint.
- papszOptions: unused currently. Must be set to NULL.
GDAL.ogr_f_getdefnref
— MethodOGR_F_GetDefnRef(OGRFeatureH hFeat) -> OGRFeatureDefnH
Fetch feature definition.
Parameters
- hFeat: handle to the feature to get the feature definition from.
Returns
a handle to the feature definition object on which feature depends.
GDAL.ogr_f_getfid
— MethodOGR_F_GetFID(OGRFeatureH hFeat) -> GIntBig
Get feature identifier.
Parameters
- hFeat: handle to the feature from which to get the feature identifier.
Returns
feature id or OGRNullFID if none has been assigned.
GDAL.ogr_f_getfieldasbinary
— MethodOGR_F_GetFieldAsBinary(OGRFeatureH hFeat,
int iField,
int * pnBytes) -> GByte *
Fetch field value as binary.
Parameters
- hFeat: handle to the feature that owned the field.
- iField: the field to fetch, from 0 to GetFieldCount()-1.
- pnBytes: location to place count of bytes returned.
Returns
the field value. This list is internal, and should not be modified, or freed. Its lifetime may be very brief.
GDAL.ogr_f_getfieldasdatetime
— MethodOGR_F_GetFieldAsDateTime(OGRFeatureH hFeat,
int iField,
int * pnYear,
int * pnMonth,
int * pnDay,
int * pnHour,
int * pnMinute,
int * pnSecond,
int * pnTZFlag) -> int
Fetch field value as date and time.
Parameters
- hFeat: handle to the feature that owned the field.
- iField: the field to fetch, from 0 to GetFieldCount()-1.
- pnYear: (including century)
- pnMonth: (1-12)
- pnDay: (1-31)
- pnHour: (0-23)
- pnMinute: (0-59)
- pnSecond: (0-59)
- pnTZFlag: (0=unknown, 1=localtime, 100=GMT, see data model for details)
Returns
TRUE on success or FALSE on failure.
GDAL.ogr_f_getfieldasdatetimeex
— MethodOGR_F_GetFieldAsDateTimeEx(OGRFeatureH hFeat,
int iField,
int * pnYear,
int * pnMonth,
int * pnDay,
int * pnHour,
int * pnMinute,
float * pfSecond,
int * pnTZFlag) -> int
Fetch field value as date and time.
Parameters
- hFeat: handle to the feature that owned the field.
- iField: the field to fetch, from 0 to GetFieldCount()-1.
- pnYear: (including century)
- pnMonth: (1-12)
- pnDay: (1-31)
- pnHour: (0-23)
- pnMinute: (0-59)
- pfSecond: (0-59 with millisecond accuracy)
- pnTZFlag: (0=unknown, 1=localtime, 100=GMT, see data model for details)
Returns
TRUE on success or FALSE on failure.
GDAL.ogr_f_getfieldasdouble
— MethodOGR_F_GetFieldAsDouble(OGRFeatureH hFeat,
int iField) -> double
Fetch field value as a double.
Parameters
- hFeat: handle to the feature that owned the field.
- iField: the field to fetch, from 0 to GetFieldCount()-1.
Returns
the field value.
GDAL.ogr_f_getfieldasdoublelist
— MethodOGR_F_GetFieldAsDoubleList(OGRFeatureH hFeat,
int iField,
int * pnCount) -> const double *
Fetch field value as a list of doubles.
Parameters
- hFeat: handle to the feature that owned the field.
- iField: the field to fetch, from 0 to GetFieldCount()-1.
- pnCount: an integer to put the list count (number of doubles) into.
Returns
the field value. This list is internal, and should not be modified, or freed. Its lifetime may be very brief. If *pnCount is zero on return the returned pointer may be NULL or non-NULL.
GDAL.ogr_f_getfieldasinteger
— MethodOGR_F_GetFieldAsInteger(OGRFeatureH hFeat,
int iField) -> int
Fetch field value as integer.
Parameters
- hFeat: handle to the feature that owned the field.
- iField: the field to fetch, from 0 to GetFieldCount()-1.
Returns
the field value.
GDAL.ogr_f_getfieldasinteger64
— MethodOGR_F_GetFieldAsInteger64(OGRFeatureH hFeat,
int iField) -> GIntBig
Fetch field value as integer 64 bit.
Parameters
- hFeat: handle to the feature that owned the field.
- iField: the field to fetch, from 0 to GetFieldCount()-1.
Returns
the field value.
GDAL.ogr_f_getfieldasinteger64list
— MethodOGR_F_GetFieldAsInteger64List(OGRFeatureH hFeat,
int iField,
int * pnCount) -> const GIntBig *
Fetch field value as a list of 64 bit integers.
Parameters
- hFeat: handle to the feature that owned the field.
- iField: the field to fetch, from 0 to GetFieldCount()-1.
- pnCount: an integer to put the list count (number of integers) into.
Returns
the field value. This list is internal, and should not be modified, or freed. Its lifetime may be very brief. If *pnCount is zero on return the returned pointer may be NULL or non-NULL.
GDAL.ogr_f_getfieldasintegerlist
— MethodOGR_F_GetFieldAsIntegerList(OGRFeatureH hFeat,
int iField,
int * pnCount) -> const int *
Fetch field value as a list of integers.
Parameters
- hFeat: handle to the feature that owned the field.
- iField: the field to fetch, from 0 to GetFieldCount()-1.
- pnCount: an integer to put the list count (number of integers) into.
Returns
the field value. This list is internal, and should not be modified, or freed. Its lifetime may be very brief. If *pnCount is zero on return the returned pointer may be NULL or non-NULL.
GDAL.ogr_f_getfieldasiso8601datetime
— MethodOGR_F_GetFieldAsISO8601DateTime(OGRFeatureH hFeat,
int iField,
CSLConstList papszOptions) -> const char *
Fetch OFTDateTime field value as a ISO8601 representation.
Parameters
- hFeat: handle to the feature that owned the field.
- iField: the field to fetch, from 0 to GetFieldCount()-1.
- papszOptions: NULL terminated list of strings, or NULL. No options are defined currently.
Returns
the field value. This string is internal, and should not be modified, or freed. Its lifetime may be very brief.
GDAL.ogr_f_getfieldasstring
— MethodOGR_F_GetFieldAsString(OGRFeatureH hFeat,
int iField) -> const char *
Fetch field value as a string.
Parameters
- hFeat: handle to the feature that owned the field.
- iField: the field to fetch, from 0 to GetFieldCount()-1.
Returns
the field value. This string is internal, and should not be modified, or freed. Its lifetime may be very brief.
GDAL.ogr_f_getfieldasstringlist
— MethodOGR_F_GetFieldAsStringList(OGRFeatureH hFeat,
int iField) -> char **
Fetch field value as a list of strings.
Parameters
- hFeat: handle to the feature that owned the field.
- iField: the field to fetch, from 0 to GetFieldCount()-1.
Returns
the field value. This list is internal, and should not be modified, or freed. Its lifetime may be very brief.
GDAL.ogr_f_getfieldcount
— MethodOGR_F_GetFieldCount(OGRFeatureH hFeat) -> int
Fetch number of fields on this feature This will always be the same as the field count for the OGRFeatureDefn.
Parameters
- hFeat: handle to the feature to get the fields count from.
Returns
count of fields.
GDAL.ogr_f_getfielddefnref
— MethodOGR_F_GetFieldDefnRef(OGRFeatureH hFeat,
int i) -> OGRFieldDefnH
Fetch definition for this field.
Parameters
- hFeat: handle to the feature on which the field is found.
- i: the field to fetch, from 0 to GetFieldCount()-1.
Returns
a handle to the field definition (from the OGRFeatureDefn). This is an internal reference, and should not be deleted or modified.
GDAL.ogr_f_getfieldindex
— MethodOGR_F_GetFieldIndex(OGRFeatureH hFeat,
const char * pszName) -> int
Fetch the field index given field name.
Parameters
- hFeat: handle to the feature on which the field is found.
- pszName: the name of the field to search for.
Returns
the field index, or -1 if no matching field is found.
GDAL.ogr_f_getgeometryref
— MethodOGR_F_GetGeometryRef(OGRFeatureH hFeat) -> OGRGeometryH
Fetch a handle to feature geometry.
Parameters
- hFeat: handle to the feature to get geometry from.
Returns
a handle to internal feature geometry. This object should not be modified.
GDAL.ogr_f_getgeomfieldcount
— MethodOGR_F_GetGeomFieldCount(OGRFeatureH hFeat) -> int
Fetch number of geometry fields on this feature This will always be the same as the geometry field count for the OGRFeatureDefn.
Parameters
- hFeat: handle to the feature to get the geometry fields count from.
Returns
count of geometry fields.
GDAL.ogr_f_getgeomfielddefnref
— MethodOGR_F_GetGeomFieldDefnRef(OGRFeatureH hFeat,
int i) -> OGRGeomFieldDefnH
Fetch definition for this geometry field.
Parameters
- hFeat: handle to the feature on which the field is found.
- i: the field to fetch, from 0 to GetGeomFieldCount()-1.
Returns
a handle to the field definition (from the OGRFeatureDefn). This is an internal reference, and should not be deleted or modified.
GDAL.ogr_f_getgeomfieldindex
— MethodOGR_F_GetGeomFieldIndex(OGRFeatureH hFeat,
const char * pszName) -> int
Fetch the geometry field index given geometry field name.
Parameters
- hFeat: handle to the feature on which the geometry field is found.
- pszName: the name of the geometry field to search for.
Returns
the geometry field index, or -1 if no matching geometry field is found.
GDAL.ogr_f_getgeomfieldref
— MethodOGR_F_GetGeomFieldRef(OGRFeatureH hFeat,
int iField) -> OGRGeometryH
Fetch a handle to feature geometry.
Parameters
- hFeat: handle to the feature to get geometry from.
- iField: geometry field to get.
Returns
a handle to internal feature geometry. This object should not be modified.
GDAL.ogr_f_getnativedata
— MethodOGR_F_GetNativeData(OGRFeatureH hFeat) -> const char *
Returns the native data for the feature.
Parameters
- hFeat: handle to the feature.
Returns
a string with the native data, or NULL if there is none.
GDAL.ogr_f_getnativemediatype
— MethodOGR_F_GetNativeMediaType(OGRFeatureH hFeat) -> const char *
Returns the native media type for the feature.
Parameters
- hFeat: handle to the feature.
Returns
a string with the native media type, or NULL if there is none.
GDAL.ogr_f_getrawfieldref
— MethodOGR_F_GetRawFieldRef(OGRFeatureH hFeat,
int iField) -> OGRField *
Fetch a handle to the internal field value given the index.
Parameters
- hFeat: handle to the feature on which field is found.
- iField: the field to fetch, from 0 to GetFieldCount()-1.
Returns
the returned handle is to an internal data structure, and should not be freed, or modified.
GDAL.ogr_f_getstylestring
— MethodOGR_F_GetStyleString(OGRFeatureH hFeat) -> const char *
Fetch style string for this feature.
Parameters
- hFeat: handle to the feature to get the style from.
Returns
a reference to a representation in string format, or NULL if there isn't one.
GDAL.ogr_f_getstyletable
— Methodogr_f_getstyletable(arg1)
Return style table
GDAL.ogr_f_isfieldnull
— MethodOGR_F_IsFieldNull(OGRFeatureH hFeat,
int iField) -> int
Test if a field is null.
Parameters
- hFeat: handle to the feature on which the field is.
- iField: the field to test.
Returns
TRUE if the field is null, otherwise false.
GDAL.ogr_f_isfieldset
— MethodOGR_F_IsFieldSet(OGRFeatureH hFeat,
int iField) -> int
Test if a field has ever been assigned a value or not.
Parameters
- hFeat: handle to the feature on which the field is.
- iField: the field to test.
Returns
TRUE if the field has been set, otherwise false.
GDAL.ogr_f_isfieldsetandnotnull
— MethodOGR_F_IsFieldSetAndNotNull(OGRFeatureH hFeat,
int iField) -> int
Test if a field is set and not null.
Parameters
- hFeat: handle to the feature on which the field is.
- iField: the field to test.
Returns
TRUE if the field is set and not null, otherwise false.
GDAL.ogr_f_setfid
— MethodOGR_F_SetFID(OGRFeatureH hFeat,
GIntBig nFID) -> OGRErr
Set the feature identifier.
Parameters
- hFeat: handle to the feature to set the feature id to.
- nFID: the new feature identifier value to assign.
Returns
On success OGRERR_NONE, or on failure some other value.
GDAL.ogr_f_setfieldbinary
— MethodOGR_F_SetFieldBinary(OGRFeatureH hFeat,
int iField,
int nBytes,
const void * pabyData) -> void
Set field to binary data.
Parameters
- hFeat: handle to the feature that owned the field.
- iField: the field to set, from 0 to GetFieldCount()-1.
- nBytes: the number of bytes in pabyData array.
- pabyData: the data to apply.
GDAL.ogr_f_setfielddatetime
— MethodOGR_F_SetFieldDateTime(OGRFeatureH hFeat,
int iField,
int nYear,
int nMonth,
int nDay,
int nHour,
int nMinute,
int nSecond,
int nTZFlag) -> void
Set field to datetime.
Parameters
- hFeat: handle to the feature that owned the field.
- iField: the field to set, from 0 to GetFieldCount()-1.
- nYear: (including century)
- nMonth: (1-12)
- nDay: (1-31)
- nHour: (0-23)
- nMinute: (0-59)
- nSecond: (0-59)
- nTZFlag: (0=unknown, 1=localtime, 100=GMT, see data model for details)
GDAL.ogr_f_setfielddatetimeex
— MethodOGR_F_SetFieldDateTimeEx(OGRFeatureH hFeat,
int iField,
int nYear,
int nMonth,
int nDay,
int nHour,
int nMinute,
float fSecond,
int nTZFlag) -> void
Set field to datetime.
Parameters
- hFeat: handle to the feature that owned the field.
- iField: the field to set, from 0 to GetFieldCount()-1.
- nYear: (including century)
- nMonth: (1-12)
- nDay: (1-31)
- nHour: (0-23)
- nMinute: (0-59)
- fSecond: (0-59, with millisecond accuracy)
- nTZFlag: (0=unknown, 1=localtime, 100=GMT, see data model for details)
GDAL.ogr_f_setfielddouble
— MethodOGR_F_SetFieldDouble(OGRFeatureH hFeat,
int iField,
double dfValue) -> void
Set field to double value.
Parameters
- hFeat: handle to the feature that owned the field.
- iField: the field to fetch, from 0 to GetFieldCount()-1.
- dfValue: the value to assign.
GDAL.ogr_f_setfielddoublelist
— MethodOGR_F_SetFieldDoubleList(OGRFeatureH hFeat,
int iField,
int nCount,
const double * padfValues) -> void
Set field to list of doubles value.
Parameters
- hFeat: handle to the feature that owned the field.
- iField: the field to set, from 0 to GetFieldCount()-1.
- nCount: the number of values in the list being assigned.
- padfValues: the values to assign.
GDAL.ogr_f_setfieldinteger
— MethodOGR_F_SetFieldInteger(OGRFeatureH hFeat,
int iField,
int nValue) -> void
Set field to integer value.
Parameters
- hFeat: handle to the feature that owned the field.
- iField: the field to fetch, from 0 to GetFieldCount()-1.
- nValue: the value to assign.
GDAL.ogr_f_setfieldinteger64
— MethodOGR_F_SetFieldInteger64(OGRFeatureH hFeat,
int iField,
GIntBig nValue) -> void
Set field to 64 bit integer value.
Parameters
- hFeat: handle to the feature that owned the field.
- iField: the field to fetch, from 0 to GetFieldCount()-1.
- nValue: the value to assign.
GDAL.ogr_f_setfieldinteger64list
— MethodOGR_F_SetFieldInteger64List(OGRFeatureH hFeat,
int iField,
int nCount,
const GIntBig * panValues) -> void
Set field to list of 64 bit integers value.
Parameters
- hFeat: handle to the feature that owned the field.
- iField: the field to set, from 0 to GetFieldCount()-1.
- nCount: the number of values in the list being assigned.
- panValues: the values to assign.
GDAL.ogr_f_setfieldintegerlist
— MethodOGR_F_SetFieldIntegerList(OGRFeatureH hFeat,
int iField,
int nCount,
const int * panValues) -> void
Set field to list of integers value.
Parameters
- hFeat: handle to the feature that owned the field.
- iField: the field to set, from 0 to GetFieldCount()-1.
- nCount: the number of values in the list being assigned.
- panValues: the values to assign.
GDAL.ogr_f_setfieldnull
— MethodOGR_F_SetFieldNull(OGRFeatureH hFeat,
int iField) -> void
Clear a field, marking it as null.
Parameters
- hFeat: handle to the feature on which the field is.
- iField: the field to set to null.
GDAL.ogr_f_setfieldraw
— MethodOGR_F_SetFieldRaw(OGRFeatureH hFeat,
int iField,
const OGRField * psValue) -> void
Set field.
Parameters
- hFeat: handle to the feature that owned the field.
- iField: the field to fetch, from 0 to GetFieldCount()-1.
- psValue: handle on the value to assign.
GDAL.ogr_f_setfieldstring
— MethodOGR_F_SetFieldString(OGRFeatureH hFeat,
int iField,
const char * pszValue) -> void
Set field to string value.
Parameters
- hFeat: handle to the feature that owned the field.
- iField: the field to fetch, from 0 to GetFieldCount()-1.
- pszValue: the value to assign.
GDAL.ogr_f_setfieldstringlist
— MethodOGR_F_SetFieldStringList(OGRFeatureH hFeat,
int iField,
CSLConstList papszValues) -> void
Set field to list of strings value.
Parameters
- hFeat: handle to the feature that owned the field.
- iField: the field to set, from 0 to GetFieldCount()-1.
- papszValues: the values to assign. List of NUL-terminated string, ending with a NULL pointer.
GDAL.ogr_f_setfrom
— MethodOGR_F_SetFrom(OGRFeatureH hFeat,
OGRFeatureH hOtherFeat,
int bForgiving) -> OGRErr
Set one feature from another.
Parameters
- hFeat: handle to the feature to set to.
- hOtherFeat: handle to the feature from which geometry, and field values will be copied.
- bForgiving: TRUE if the operation should continue despite lacking output fields matching some of the source fields.
Returns
OGRERR_NONE if the operation succeeds, even if some values are not transferred, otherwise an error code.
GDAL.ogr_f_setfromwithmap
— MethodOGR_F_SetFromWithMap(OGRFeatureH hFeat,
OGRFeatureH hOtherFeat,
int bForgiving,
const int * panMap) -> OGRErr
Set one feature from another.
Parameters
- hFeat: handle to the feature to set to.
- hOtherFeat: handle to the feature from which geometry, and field values will be copied.
- panMap: Array of the indices of the destination feature's fields stored at the corresponding index of the source feature's fields. A value of -1 should be used to ignore the source's field. The array should not be NULL and be as long as the number of fields in the source feature.
- bForgiving: TRUE if the operation should continue despite lacking output fields matching some of the source fields.
Returns
OGRERR_NONE if the operation succeeds, even if some values are not transferred, otherwise an error code.
GDAL.ogr_f_setgeometry
— MethodOGR_F_SetGeometry(OGRFeatureH hFeat,
OGRGeometryH hGeom) -> OGRErr
Set feature geometry.
Parameters
- hFeat: handle to the feature on which new geometry is applied to.
- hGeom: handle to the new geometry to apply to feature.
Returns
OGRERRNONE if successful, or OGRUNSUPPORTEDGEOMETRYTYPE if the geometry type is illegal for the OGRFeatureDefn (checking not yet implemented).
GDAL.ogr_f_setgeometrydirectly
— MethodOGR_F_SetGeometryDirectly(OGRFeatureH hFeat,
OGRGeometryH hGeom) -> OGRErr
Set feature geometry.
Parameters
- hFeat: handle to the feature on which to apply the geometry.
- hGeom: handle to the new geometry to apply to feature.
Returns
OGRERRNONE if successful, or OGRUNSUPPORTEDGEOMETRYTYPE if the geometry type is illegal for the OGRFeatureDefn (checking not yet implemented).
GDAL.ogr_f_setgeomfield
— MethodOGR_F_SetGeomField(OGRFeatureH hFeat,
int iField,
OGRGeometryH hGeom) -> OGRErr
Set feature geometry of a specified geometry field.
Parameters
- hFeat: handle to the feature on which new geometry is applied to.
- iField: geometry field to set.
- hGeom: handle to the new geometry to apply to feature.
Returns
OGRERRNONE if successful, or OGRUNSUPPORTEDGEOMETRYTYPE if the geometry type is illegal for the OGRFeatureDefn (checking not yet implemented).
GDAL.ogr_f_setgeomfielddirectly
— MethodOGR_F_SetGeomFieldDirectly(OGRFeatureH hFeat,
int iField,
OGRGeometryH hGeom) -> OGRErr
Set feature geometry of a specified geometry field.
Parameters
- hFeat: handle to the feature on which to apply the geometry.
- iField: geometry field to set.
- hGeom: handle to the new geometry to apply to feature.
Returns
OGRERRNONE if successful, or OGRERRFAILURE if the index is invalid, or OGRUNSUPPORTEDGEOMETRY_TYPE if the geometry type is illegal for the OGRFeatureDefn (checking not yet implemented).
GDAL.ogr_f_setnativedata
— MethodOGR_F_SetNativeData(OGRFeatureH hFeat,
const char * pszNativeData) -> void
Sets the native data for the feature.
Parameters
- hFeat: handle to the feature.
- pszNativeData: a string with the native data, or NULL if there is none.
GDAL.ogr_f_setnativemediatype
— MethodOGR_F_SetNativeMediaType(OGRFeatureH hFeat,
const char * pszNativeMediaType) -> void
Sets the native media type for the feature.
Parameters
- hFeat: handle to the feature.
- pszNativeMediaType: a string with the native media type, or NULL if there is none.
GDAL.ogr_f_setstylestring
— MethodOGR_F_SetStyleString(OGRFeatureH hFeat,
const char * pszStyle) -> void
Set feature style string.
Parameters
- hFeat: handle to the feature to set style to.
- pszStyle: the style string to apply to this feature, cannot be NULL.
GDAL.ogr_f_setstylestringdirectly
— MethodOGR_F_SetStyleStringDirectly(OGRFeatureH hFeat,
char * pszStyle) -> void
Set feature style string.
Parameters
- hFeat: handle to the feature to set style to.
- pszStyle: the style string to apply to this feature, cannot be NULL.
GDAL.ogr_f_setstyletable
— Methodogr_f_setstyletable(arg1, arg2)
Set style table
GDAL.ogr_f_setstyletabledirectly
— Methodogr_f_setstyletabledirectly(arg1, arg2)
Set style table and take ownership
GDAL.ogr_f_stealgeometry
— MethodOGR_F_StealGeometry(OGRFeatureH hFeat) -> OGRGeometryH
Take away ownership of geometry.
Parameters
- hFeat: feature from which to steal the first geometry.
Returns
the pointer to the stolen geometry.
GDAL.ogr_f_stealgeometryex
— MethodOGR_F_StealGeometryEx(OGRFeatureH hFeat,
int iGeomField) -> OGRGeometryH
Take away ownership of geometry.
Parameters
- hFeat: feature from which to steal a geometry.
- iGeomField: index of the geometry field to steal.
Returns
the pointer to the stolen geometry.
GDAL.ogr_f_unsetfield
— MethodOGR_F_UnsetField(OGRFeatureH hFeat,
int iField) -> void
Clear a field, marking it as unset.
Parameters
- hFeat: handle to the feature on which the field is.
- iField: the field to unset.
GDAL.ogr_f_validate
— MethodOGR_F_Validate(OGRFeatureH hFeat,
int nValidateFlags,
int bEmitError) -> int
Validate that a feature meets constraints of its schema.
Parameters
- hFeat: handle to the feature to validate.
- nValidateFlags: OGRFVALALL or combination of OGRFVALNULL, OGRFVALGEOMTYPE, OGRFVALWIDTH and OGRFVALALLOWNULLWHEN_DEFAULT with '|' operator
- bEmitError: TRUE if a CPLError() must be emitted when a check fails
Returns
TRUE if all enabled validation tests pass.
GDAL.ogr_fd_addfielddefn
— MethodOGR_FD_AddFieldDefn(OGRFeatureDefnH hDefn,
OGRFieldDefnH hNewField) -> void
Add a new field definition to the passed feature definition.
Parameters
- hDefn: handle to the feature definition to add the field definition to.
- hNewField: handle to the new field definition.
GDAL.ogr_fd_addgeomfielddefn
— MethodOGR_FD_AddGeomFieldDefn(OGRFeatureDefnH hDefn,
OGRGeomFieldDefnH hNewGeomField) -> void
Add a new field definition to the passed feature definition.
Parameters
- hDefn: handle to the feature definition to add the geometry field definition to.
- hNewGeomField: handle to the new field definition.
GDAL.ogr_fd_create
— MethodOGR_FD_Create(const char * pszName) -> OGRFeatureDefnH
Create a new feature definition object to hold the field definitions.
Parameters
- pszName: the name to be assigned to this layer/class. It does not need to be unique.
Returns
handle to the newly created feature definition.
GDAL.ogr_fd_deletefielddefn
— MethodOGR_FD_DeleteFieldDefn(OGRFeatureDefnH hDefn,
int iField) -> OGRErr
Delete an existing field definition.
Parameters
- hDefn: handle to the feature definition.
- iField: the index of the field definition.
Returns
OGRERR_NONE in case of success.
GDAL.ogr_fd_deletegeomfielddefn
— MethodOGR_FD_DeleteGeomFieldDefn(OGRFeatureDefnH hDefn,
int iGeomField) -> OGRErr
Delete an existing geometry field definition.
Parameters
- hDefn: handle to the feature definition.
- iGeomField: the index of the geometry field definition.
Returns
OGRERR_NONE in case of success.
GDAL.ogr_fd_dereference
— MethodOGR_FD_Dereference(OGRFeatureDefnH hDefn) -> int
Decrements the reference count by one.
Parameters
- hDefn: handle to the feature definition on witch OGRFeature are based on.
Returns
the updated reference count.
GDAL.ogr_fd_destroy
— MethodOGR_FD_Destroy(OGRFeatureDefnH hDefn) -> void
Destroy a feature definition object and release all memory associated with it.
Parameters
- hDefn: handle to the feature definition to be destroyed.
GDAL.ogr_fd_getfieldcount
— MethodOGR_FD_GetFieldCount(OGRFeatureDefnH hDefn) -> int
Fetch number of fields on the passed feature definition.
Parameters
- hDefn: handle to the feature definition to get the fields count from.
Returns
count of fields.
GDAL.ogr_fd_getfielddefn
— MethodOGR_FD_GetFieldDefn(OGRFeatureDefnH hDefn,
int iField) -> OGRFieldDefnH
Fetch field definition of the passed feature definition.
Parameters
- hDefn: handle to the feature definition to get the field definition from.
- iField: the field to fetch, between 0 and GetFieldCount()-1.
Returns
a handle to an internal field definition object or NULL if invalid index. This object should not be modified or freed by the application.
GDAL.ogr_fd_getfieldindex
— MethodOGR_FD_GetFieldIndex(OGRFeatureDefnH hDefn,
const char * pszFieldName) -> int
Find field by name.
Parameters
- hDefn: handle to the feature definition to get field index from.
- pszFieldName: the field name to search for.
Returns
the field index, or -1 if no match found.
GDAL.ogr_fd_getgeomfieldcount
— MethodOGR_FD_GetGeomFieldCount(OGRFeatureDefnH hDefn) -> int
Fetch number of geometry fields on the passed feature definition.
Parameters
- hDefn: handle to the feature definition to get the fields count from.
Returns
count of geometry fields.
GDAL.ogr_fd_getgeomfielddefn
— MethodOGR_FD_GetGeomFieldDefn(OGRFeatureDefnH hDefn,
int iGeomField) -> OGRGeomFieldDefnH
Fetch geometry field definition of the passed feature definition.
Parameters
- hDefn: handle to the feature definition to get the field definition from.
- iGeomField: the geometry field to fetch, between 0 and GetGeomFieldCount() - 1.
Returns
a handle to an internal field definition object or NULL if invalid index. This object should not be modified or freed by the application.
GDAL.ogr_fd_getgeomfieldindex
— MethodOGR_FD_GetGeomFieldIndex(OGRFeatureDefnH hDefn,
const char * pszGeomFieldName) -> int
Find geometry field by name.
Parameters
- hDefn: handle to the feature definition to get field index from.
- pszGeomFieldName: the geometry field name to search for.
Returns
the geometry field index, or -1 if no match found.
GDAL.ogr_fd_getgeomtype
— MethodOGR_FD_GetGeomType(OGRFeatureDefnH hDefn) -> OGRwkbGeometryType
Fetch the geometry base type of the passed feature definition.
Parameters
- hDefn: handle to the feature definition to get the geometry type from.
Returns
the base type for all geometry related to this definition.
GDAL.ogr_fd_getname
— MethodOGR_FD_GetName(OGRFeatureDefnH hDefn) -> const char *
Get name of the OGRFeatureDefn passed as an argument.
Parameters
- hDefn: handle to the feature definition to get the name from.
Returns
the name. This name is internal and should not be modified, or freed.
GDAL.ogr_fd_getreferencecount
— MethodOGR_FD_GetReferenceCount(OGRFeatureDefnH hDefn) -> int
Fetch current reference count.
Parameters
- hDefn: handle to the feature definition on witch OGRFeature are based on.
Returns
the current reference count.
GDAL.ogr_fd_isgeometryignored
— MethodOGR_FD_IsGeometryIgnored(OGRFeatureDefnH hDefn) -> int
Determine whether the geometry can be omitted when fetching features.
Parameters
- hDefn: handle to the feature definition on witch OGRFeature are based on.
Returns
ignore state
GDAL.ogr_fd_issame
— MethodOGR_FD_IsSame(OGRFeatureDefnH hFDefn,
OGRFeatureDefnH hOtherFDefn) -> int
Test if the feature definition is identical to the other one.
Parameters
- hFDefn: handle to the feature definition on witch OGRFeature are based on.
- hOtherFDefn: handle to the other feature definition to compare to.
Returns
TRUE if the feature definition is identical to the other one.
GDAL.ogr_fd_isstyleignored
— MethodOGR_FD_IsStyleIgnored(OGRFeatureDefnH hDefn) -> int
Determine whether the style can be omitted when fetching features.
Parameters
- hDefn: handle to the feature definition on which OGRFeature are based on.
Returns
ignore state
GDAL.ogr_fd_reference
— MethodOGR_FD_Reference(OGRFeatureDefnH hDefn) -> int
Increments the reference count by one.
Parameters
- hDefn: handle to the feature definition on witch OGRFeature are based on.
Returns
the updated reference count.
GDAL.ogr_fd_release
— MethodOGR_FD_Release(OGRFeatureDefnH hDefn) -> void
Drop a reference, and destroy if unreferenced.
Parameters
- hDefn: handle to the feature definition to be released.
GDAL.ogr_fd_reorderfielddefns
— MethodOGR_FD_ReorderFieldDefns(OGRFeatureDefnH hDefn,
const int * panMap) -> OGRErr
Reorder the field definitions in the array of the feature definition.
Parameters
- hDefn: handle to the feature definition.
- panMap: an array of GetFieldCount() elements which is a permutation of [0, GetFieldCount()-1]. panMap is such that, for each field definition at position i after reordering, its position before reordering was panMap[i].
Returns
OGRERR_NONE in case of success.
GDAL.ogr_fd_setgeometryignored
— MethodOGR_FD_SetGeometryIgnored(OGRFeatureDefnH hDefn,
int bIgnore) -> void
Set whether the geometry can be omitted when fetching features.
Parameters
- hDefn: handle to the feature definition on witch OGRFeature are based on.
- bIgnore: ignore state
GDAL.ogr_fd_setgeomtype
— MethodOGR_FD_SetGeomType(OGRFeatureDefnH hDefn,
OGRwkbGeometryType eType) -> void
Assign the base geometry type for the passed layer (the same as the feature definition).
Parameters
- hDefn: handle to the layer or feature definition to set the geometry type to.
- eType: the new type to assign.
GDAL.ogr_fd_setstyleignored
— MethodOGR_FD_SetStyleIgnored(OGRFeatureDefnH hDefn,
int bIgnore) -> void
Set whether the style can be omitted when fetching features.
Parameters
- hDefn: handle to the feature definition on witch OGRFeature are based on.
- bIgnore: ignore state
GDAL.ogr_fld_create
— MethodOGR_Fld_Create(const char * pszName,
OGRFieldType eType) -> OGRFieldDefnH
Create a new field definition.
Parameters
- pszName: the name of the new field definition.
- eType: the type of the new field definition.
Returns
handle to the new field definition.
GDAL.ogr_fld_destroy
— MethodOGR_Fld_Destroy(OGRFieldDefnH hDefn) -> void
Destroy a field definition.
Parameters
- hDefn: handle to the field definition to destroy.
GDAL.ogr_fld_getalternativenameref
— MethodOGR_Fld_GetAlternativeNameRef(OGRFieldDefnH hDefn) -> const char *
Fetch the alternative name (or "alias") for this field.
Parameters
- hDefn: handle to the field definition.
Returns
the alternative name of the field definition.
GDAL.ogr_fld_getcomment
— MethodOGR_Fld_GetComment(OGRFieldDefnH hDefn) -> const char *
Return the (optional) comment for this field.
Parameters
- hDefn: handle to the field definition
Returns
the comment, or an empty string if there is none.
GDAL.ogr_fld_getdefault
— MethodOGR_Fld_GetDefault(OGRFieldDefnH hDefn) -> const char *
Get default field value.
Parameters
- hDefn: handle to the field definition.
Returns
default field value or NULL.
GDAL.ogr_fld_getdomainname
— MethodOGR_Fld_GetDomainName(OGRFieldDefnH hDefn) -> const char *
Return the name of the field domain for this field.
Parameters
- hDefn: handle to the field definition
Returns
the field domain name, or an empty string if there is none.
GDAL.ogr_fld_getjustify
— MethodOGR_Fld_GetJustify(OGRFieldDefnH hDefn) -> OGRJustification
Get the justification for this field.
Parameters
- hDefn: handle to the field definition to get justification from.
Returns
the justification.
GDAL.ogr_fld_getnameref
— MethodOGR_Fld_GetNameRef(OGRFieldDefnH hDefn) -> const char *
Fetch name of this field.
Parameters
- hDefn: handle to the field definition.
Returns
the name of the field definition.
GDAL.ogr_fld_getprecision
— MethodOGR_Fld_GetPrecision(OGRFieldDefnH hDefn) -> int
Get the formatting precision for this field.
Parameters
- hDefn: handle to the field definition to get precision from.
Returns
the precision.
GDAL.ogr_fld_getsubtype
— MethodOGR_Fld_GetSubType(OGRFieldDefnH hDefn) -> OGRFieldSubType
Fetch subtype of this field.
Parameters
- hDefn: handle to the field definition to get subtype from.
Returns
field subtype.
GDAL.ogr_fld_gettype
— MethodOGR_Fld_GetType(OGRFieldDefnH hDefn) -> OGRFieldType
Fetch type of this field.
Parameters
- hDefn: handle to the field definition to get type from.
Returns
field type.
GDAL.ogr_fld_gettzflag
— MethodOGR_Fld_GetTZFlag(OGRFieldDefnH hDefn) -> int
Get the time zone flag.
Parameters
- hDefn: handle to the field definition .
Returns
the time zone flag.
GDAL.ogr_fld_getwidth
— MethodOGR_Fld_GetWidth(OGRFieldDefnH hDefn) -> int
Get the formatting width for this field.
Parameters
- hDefn: handle to the field definition to get width from.
Returns
the width, zero means no specified width.
GDAL.ogr_fld_isdefaultdriverspecific
— MethodOGR_Fld_IsDefaultDriverSpecific(OGRFieldDefnH hDefn) -> int
Returns whether the default value is driver specific.
Parameters
- hDefn: handle to the field definition
Returns
TRUE if the default value is driver specific.
GDAL.ogr_fld_isignored
— MethodOGR_Fld_IsIgnored(OGRFieldDefnH hDefn) -> int
Return whether this field should be omitted when fetching features.
Parameters
- hDefn: handle to the field definition
Returns
ignore state
GDAL.ogr_fld_isnullable
— MethodOGR_Fld_IsNullable(OGRFieldDefnH hDefn) -> int
Return whether this field can receive null values.
Parameters
- hDefn: handle to the field definition
Returns
TRUE if the field is authorized to be null.
GDAL.ogr_fld_isunique
— MethodOGR_Fld_IsUnique(OGRFieldDefnH hDefn) -> int
Return whether this field has a unique constraint.
Parameters
- hDefn: handle to the field definition
Returns
TRUE if the field has a unique constraint.
GDAL.ogr_fld_set
— MethodOGR_Fld_Set(OGRFieldDefnH hDefn,
const char * pszNameIn,
OGRFieldType eTypeIn,
int nWidthIn,
int nPrecisionIn,
OGRJustification eJustifyIn) -> void
Set defining parameters for a field in one call.
Parameters
- hDefn: handle to the field definition to set to.
- pszNameIn: the new name to assign.
- eTypeIn: the new type (one of the OFT values like OFTInteger).
- nWidthIn: the preferred formatting width. Defaults to zero indicating undefined.
- nPrecisionIn: number of decimals places for formatting, defaults to zero indicating undefined.
- eJustifyIn: the formatting justification (OJLeft or OJRight), defaults to OJUndefined.
GDAL.ogr_fld_setalternativename
— MethodOGR_Fld_SetAlternativeName(OGRFieldDefnH hDefn,
const char * pszAlternativeName) -> void
Reset the alternative name (or "alias") for this field.
Parameters
- hDefn: handle to the field definition to apply the new alternative name to.
- pszAlternativeName: the new alternative name to apply.
GDAL.ogr_fld_setcomment
— MethodOGR_Fld_SetComment(OGRFieldDefnH hDefn,
const char * pszComment) -> void
Set the comment for this field.
Parameters
- hDefn: handle to the field definition
- pszComment: Field comment.
GDAL.ogr_fld_setdefault
— MethodOGR_Fld_SetDefault(OGRFieldDefnH hDefn,
const char * pszDefault) -> void
Set default field value.
Parameters
- hDefn: handle to the field definition.
- pszDefault: new default field value or NULL pointer.
GDAL.ogr_fld_setdomainname
— MethodOGR_Fld_SetDomainName(OGRFieldDefnH hDefn,
const char * pszFieldName) -> void
Set the name of the field domain for this field.
Parameters
- hDefn: handle to the field definition
- pszFieldName: Field domain name.
GDAL.ogr_fld_setignored
— MethodOGR_Fld_SetIgnored(OGRFieldDefnH hDefn,
int ignore) -> void
Set whether this field should be omitted when fetching features.
Parameters
- hDefn: handle to the field definition
- ignore: ignore state
GDAL.ogr_fld_setjustify
— MethodOGR_Fld_SetJustify(OGRFieldDefnH hDefn,
OGRJustification eJustify) -> void
Set the justification for this field.
Parameters
- hDefn: handle to the field definition to set justification to.
- eJustify: the new justification.
GDAL.ogr_fld_setname
— MethodOGR_Fld_SetName(OGRFieldDefnH hDefn,
const char * pszName) -> void
Reset the name of this field.
Parameters
- hDefn: handle to the field definition to apply the new name to.
- pszName: the new name to apply.
GDAL.ogr_fld_setnullable
— MethodOGR_Fld_SetNullable(OGRFieldDefnH hDefn,
int bNullableIn) -> void
Set whether this field can receive null values.
Parameters
- hDefn: handle to the field definition
- bNullableIn: FALSE if the field must have a not-null constraint.
GDAL.ogr_fld_setprecision
— MethodOGR_Fld_SetPrecision(OGRFieldDefnH hDefn,
int nPrecision) -> void
Set the formatting precision for this field in characters.
Parameters
- hDefn: handle to the field definition to set precision to.
- nPrecision: the new precision.
GDAL.ogr_fld_setsubtype
— MethodOGR_Fld_SetSubType(OGRFieldDefnH hDefn,
OGRFieldSubType eSubType) -> void
Set the subtype of this field.
Parameters
- hDefn: handle to the field definition to set type to.
- eSubType: the new field subtype.
GDAL.ogr_fld_settype
— MethodOGR_Fld_SetType(OGRFieldDefnH hDefn,
OGRFieldType eType) -> void
Set the type of this field.
Parameters
- hDefn: handle to the field definition to set type to.
- eType: the new field type.
GDAL.ogr_fld_settzflag
— MethodOGR_Fld_SetTZFlag(OGRFieldDefnH hDefn,
int nTZFlag) -> void
Set the formatting precision for this field in characters.
Parameters
- hDefn: handle to the field definition to set precision to.
- nTZFlag: the new time zone flag.
GDAL.ogr_fld_setunique
— MethodOGR_Fld_SetUnique(OGRFieldDefnH hDefn,
int bUniqueIn) -> void
Set whether this field has a unique constraint.
Parameters
- hDefn: handle to the field definition
- bUniqueIn: TRUE if the field must have a unique constraint.
GDAL.ogr_fld_setwidth
— MethodOGR_Fld_SetWidth(OGRFieldDefnH hDefn,
int nNewWidth) -> void
Set the formatting width for this field in characters.
Parameters
- hDefn: handle to the field definition to set width to.
- nNewWidth: the new width.
GDAL.ogr_flddomain_destroy
— MethodOGR_FldDomain_Destroy(OGRFieldDomainH hFieldDomain) -> void
Destroy a field domain.
Parameters
- hFieldDomain: the field domain.
GDAL.ogr_flddomain_getdescription
— MethodOGR_FldDomain_GetDescription(OGRFieldDomainH hFieldDomain) -> const char *
Get the description of the field domain.
Parameters
- hFieldDomain: Field domain handle.
Returns
the field domain description (might be empty string).
GDAL.ogr_flddomain_getdomaintype
— MethodOGR_FldDomain_GetDomainType(OGRFieldDomainH hFieldDomain) -> OGRFieldDomainType
Get the type of the field domain.
Parameters
- hFieldDomain: Field domain handle.
Returns
the type of the field domain.
GDAL.ogr_flddomain_getfieldsubtype
— MethodOGR_FldDomain_GetFieldSubType(OGRFieldDomainH hFieldDomain) -> OGRFieldSubType
Get the field subtype of the field domain.
Parameters
- hFieldDomain: Field domain handle.
Returns
the field subtype of the field domain.
GDAL.ogr_flddomain_getfieldtype
— MethodOGR_FldDomain_GetFieldType(OGRFieldDomainH hFieldDomain) -> OGRFieldType
Get the field type of the field domain.
Parameters
- hFieldDomain: Field domain handle.
Returns
the field type of the field domain.
GDAL.ogr_flddomain_getmergepolicy
— MethodOGR_FldDomain_GetMergePolicy(OGRFieldDomainH hFieldDomain) -> OGRFieldDomainMergePolicy
Get the merge policy of the field domain.
Parameters
- hFieldDomain: Field domain handle.
Returns
the merge policy of the field domain.
GDAL.ogr_flddomain_getname
— MethodOGR_FldDomain_GetName(OGRFieldDomainH hFieldDomain) -> const char *
Get the name of the field domain.
Parameters
- hFieldDomain: Field domain handle.
Returns
the field domain name.
GDAL.ogr_flddomain_getsplitpolicy
— MethodOGR_FldDomain_GetSplitPolicy(OGRFieldDomainH hFieldDomain) -> OGRFieldDomainSplitPolicy
Get the split policy of the field domain.
Parameters
- hFieldDomain: Field domain handle.
Returns
the split policy of the field domain.
GDAL.ogr_flddomain_setmergepolicy
— MethodOGR_FldDomain_SetMergePolicy(OGRFieldDomainH hFieldDomain,
OGRFieldDomainMergePolicy policy) -> void
Set the merge policy of the field domain.
Parameters
- hFieldDomain: Field domain handle.
- policy: the merge policy of the field domain.
GDAL.ogr_flddomain_setsplitpolicy
— MethodOGR_FldDomain_SetSplitPolicy(OGRFieldDomainH hFieldDomain,
OGRFieldDomainSplitPolicy policy) -> void
Set the split policy of the field domain.
Parameters
- hFieldDomain: Field domain handle.
- policy: the split policy of the field domain.
GDAL.ogr_g_addgeometry
— MethodOGR_G_AddGeometry(OGRGeometryH hGeom,
OGRGeometryH hNewSubGeom) -> OGRErr
Add a geometry to a geometry container.
Parameters
- hGeom: existing geometry container.
- hNewSubGeom: geometry to add to the container.
Returns
OGRERRNONE if successful, or OGRERRUNSUPPORTEDGEOMETRYTYPE if the geometry type is illegal for the type of existing geometry.
GDAL.ogr_g_addgeometrydirectly
— MethodOGR_G_AddGeometryDirectly(OGRGeometryH hGeom,
OGRGeometryH hNewSubGeom) -> OGRErr
Add a geometry directly to an existing geometry container.
Parameters
- hGeom: existing geometry.
- hNewSubGeom: geometry to add to the existing geometry.
Returns
OGRERRNONE if successful, or OGRERRUNSUPPORTEDGEOMETRYTYPE if the geometry type is illegal for the type of geometry container.
GDAL.ogr_g_addpoint
— MethodOGR_G_AddPoint(OGRGeometryH hGeom,
double dfX,
double dfY,
double dfZ) -> void
Add a point to a geometry (line string or point).
Parameters
- hGeom: handle to the geometry to add a point to.
- dfX: x coordinate of point to add.
- dfY: y coordinate of point to add.
- dfZ: z coordinate of point to add.
GDAL.ogr_g_addpoint_2d
— MethodOGR_G_AddPoint_2D(OGRGeometryH hGeom,
double dfX,
double dfY) -> void
Add a point to a geometry (line string or point).
Parameters
- hGeom: handle to the geometry to add a point to.
- dfX: x coordinate of point to add.
- dfY: y coordinate of point to add.
GDAL.ogr_g_addpointm
— MethodOGR_G_AddPointM(OGRGeometryH hGeom,
double dfX,
double dfY,
double dfM) -> void
Add a point to a geometry (line string or point).
Parameters
- hGeom: handle to the geometry to add a point to.
- dfX: x coordinate of point to add.
- dfY: y coordinate of point to add.
- dfM: m coordinate of point to add.
GDAL.ogr_g_addpointzm
— MethodOGR_G_AddPointZM(OGRGeometryH hGeom,
double dfX,
double dfY,
double dfZ,
double dfM) -> void
Add a point to a geometry (line string or point).
Parameters
- hGeom: handle to the geometry to add a point to.
- dfX: x coordinate of point to add.
- dfY: y coordinate of point to add.
- dfZ: z coordinate of point to add.
- dfM: m coordinate of point to add.
GDAL.ogr_g_approximatearcangles
— MethodOGR_G_ApproximateArcAngles(double dfCenterX,
double dfCenterY,
double dfZ,
double dfPrimaryRadius,
double dfSecondaryRadius,
double dfRotation,
double dfStartAngle,
double dfEndAngle,
double dfMaxAngleStepSizeDegrees) -> OGRGeometryH
Stroke arc to linestring.
Parameters
- dfCenterX: center X
- dfCenterY: center Y
- dfZ: center Z
- dfPrimaryRadius: X radius of ellipse.
- dfSecondaryRadius: Y radius of ellipse.
- dfRotation: rotation of the ellipse clockwise.
- dfStartAngle: angle to first point on arc (clockwise of X-positive)
- dfEndAngle: angle to last point on arc (clockwise of X-positive)
- dfMaxAngleStepSizeDegrees: the largest step in degrees along the arc, zero to use the default setting.
Returns
OGRLineString geometry representing an approximation of the arc.
GDAL.ogr_g_area
— MethodOGR_G_Area(OGRGeometryH hGeom) -> double
Compute geometry area.
Parameters
- hGeom: the geometry to operate on.
Returns
the area of the geometry in square units of the spatial reference system in use, or 0.0 for unsupported geometry types.
GDAL.ogr_g_assignspatialreference
— MethodOGR_G_AssignSpatialReference(OGRGeometryH hGeom,
OGRSpatialReferenceH hSRS) -> void
Assign spatial reference to this object.
Parameters
- hGeom: handle on the geometry to apply the new spatial reference system.
- hSRS: handle on the new spatial reference system to apply.
GDAL.ogr_g_boundary
— MethodOGR_G_Boundary(OGRGeometryH hTarget) -> OGRGeometryH
Compute boundary.
Parameters
- hTarget: The Geometry to calculate the boundary of.
Returns
a handle to a newly allocated geometry now owned by the caller, or NULL on failure.
GDAL.ogr_g_buffer
— MethodOGR_G_Buffer(OGRGeometryH hTarget,
double dfDist,
int nQuadSegs) -> OGRGeometryH
Compute buffer of geometry.
Parameters
- hTarget: the geometry.
- dfDist: the buffer distance to be applied. Should be expressed into the same unit as the coordinates of the geometry.
- nQuadSegs: the number of segments used to approximate a 90 degree (quadrant) of curvature.
Returns
the newly created geometry, or NULL if an error occurs.
GDAL.ogr_g_centroid
— MethodOGR_G_Centroid(OGRGeometryH hGeom,
OGRGeometryH hCentroidPoint) -> int
Compute the geometry centroid.
Returns
OGRERRNONE on success or OGRERRFAILURE on error.
GDAL.ogr_g_clone
— MethodOGR_G_Clone(OGRGeometryH hGeom) -> OGRGeometryH
Make a copy of this object.
Parameters
- hGeom: handle on the geometry to clone from.
Returns
a handle on the copy of the geometry with the spatial reference system as the original.
GDAL.ogr_g_closerings
— MethodOGR_G_CloseRings(OGRGeometryH hGeom) -> void
Force rings to be closed.
Parameters
- hGeom: handle to the geometry.
GDAL.ogr_g_concavehull
— MethodOGR_G_ConcaveHull(OGRGeometryH hTarget,
double dfRatio,
bool bAllowHoles) -> OGRGeometryH
Compute "concave hull" of a geometry.
Parameters
- hTarget: The Geometry to calculate the concave hull of.
- dfRatio: Ratio of the area of the convex hull and the concave hull.
- bAllowHoles: Whether holes are allowed.
Returns
a handle to a newly allocated geometry now owned by the caller, or NULL on failure.
GDAL.ogr_g_contains
— MethodOGR_G_Contains(OGRGeometryH hThis,
OGRGeometryH hOther) -> int
Test for containment.
Parameters
- hThis: the geometry to compare.
- hOther: the other geometry to compare.
Returns
TRUE if hThis contains hOther geometry, otherwise FALSE.
GDAL.ogr_g_convexhull
— MethodOGR_G_ConvexHull(OGRGeometryH hTarget) -> OGRGeometryH
Compute convex hull.
Parameters
- hTarget: The Geometry to calculate the convex hull of.
Returns
a handle to a newly allocated geometry now owned by the caller, or NULL on failure.
GDAL.ogr_g_coordinatedimension
— MethodOGR_G_CoordinateDimension(OGRGeometryH hGeom) -> int
Get the dimension of the coordinates in this geometry.
Parameters
- hGeom: handle on the geometry to get the dimension of the coordinates from.
Returns
this will return 2 for XY, 3 for XYZ and XYM, and 4 for XYZM data.
GDAL.ogr_g_createfromfgf
— MethodOGR_G_CreateFromFgf(const void * pabyData,
OGRSpatialReferenceH hSRS,
OGRGeometryH * phGeometry,
int nBytes,
int * pnBytesConsumed) -> OGRErr
Create a geometry object of the appropriate type from its FGF (FDO Geometry Format) binary representation.
GDAL.ogr_g_createfromgml
— MethodOGR_G_CreateFromGML(const char * pszGML) -> OGRGeometryH
Create geometry from GML.
Parameters
- pszGML: The GML fragment for the geometry.
Returns
a geometry on success, or NULL on error.
GDAL.ogr_g_createfromgmltree
— MethodOGR_G_CreateFromGMLTree(const CPLXMLNode * psTree) -> OGRGeometryH
Create geometry from GML.
GDAL.ogr_g_createfromwkb
— MethodOGR_G_CreateFromWkb(const void * pabyData,
OGRSpatialReferenceH hSRS,
OGRGeometryH * phGeometry,
int nBytes) -> OGRErr
Create a geometry object of the appropriate type from its well known binary representation.
Parameters
- pabyData: pointer to the input BLOB data.
- hSRS: handle to the spatial reference to be assigned to the created geometry object. This may be NULL.
- phGeometry: the newly created geometry object will be assigned to the indicated handle on return. This will be NULL in case of failure. If not NULL, *phGeometry should be freed with OGRGDestroyGeometry() after use.
- nBytes: the number of bytes of data available in pabyData, or -1 if it is not known, but assumed to be sufficient.
Returns
OGRERRNONE if all goes well, otherwise any of OGRERRNOTENOUGHDATA, OGRERRUNSUPPORTEDGEOMETRYTYPE, or OGRERRCORRUPT_DATA may be returned.
GDAL.ogr_g_createfromwkbex
— MethodOGR_G_CreateFromWkbEx(const void * pabyData,
OGRSpatialReferenceH hSRS,
OGRGeometryH * phGeometry,
size_t nBytes) -> OGRErr
Create a geometry object of the appropriate type from its well known binary representation.
Parameters
- pabyData: pointer to the input BLOB data.
- hSRS: handle to the spatial reference to be assigned to the created geometry object. This may be NULL.
- phGeometry: the newly created geometry object will be assigned to the indicated handle on return. This will be NULL in case of failure. If not NULL, *phGeometry should be freed with OGRGDestroyGeometry() after use.
- nBytes: the number of bytes of data available in pabyData, or -1 if it is not known, but assumed to be sufficient.
Returns
OGRERRNONE if all goes well, otherwise any of OGRERRNOTENOUGHDATA, OGRERRUNSUPPORTEDGEOMETRYTYPE, or OGRERRCORRUPT_DATA may be returned.
GDAL.ogr_g_createfromwkt
— MethodOGR_G_CreateFromWkt(char ** ppszData,
OGRSpatialReferenceH hSRS,
OGRGeometryH * phGeometry) -> OGRErr
Create a geometry object of the appropriate type from its well known text representation.
Parameters
- ppszData: input zero terminated string containing well known text representation of the geometry to be created. The pointer is updated to point just beyond that last character consumed.
- hSRS: handle to the spatial reference to be assigned to the created geometry object. This may be NULL.
- phGeometry: the newly created geometry object will be assigned to the indicated handle on return. This will be NULL if the method fails. If not NULL, *phGeometry should be freed with OGRGDestroyGeometry() after use.
Returns
OGRERRNONE if all goes well, otherwise any of OGRERRNOTENOUGHDATA, OGRERRUNSUPPORTEDGEOMETRYTYPE, or OGRERRCORRUPT_DATA may be returned.
GDAL.ogr_g_creategeometry
— MethodOGR_G_CreateGeometry(OGRwkbGeometryType eGeometryType) -> OGRGeometryH
Create an empty geometry of desired type.
Parameters
- eGeometryType: the type code of the geometry to be created.
Returns
handle to the newly create geometry or NULL on failure. Should be freed with OGRGDestroyGeometry() after use.
GDAL.ogr_g_creategeometryfromesrijson
— Methodogr_g_creategeometryfromesrijson(arg1)
Create a OGR geometry from a ESRI JSON geometry object
GDAL.ogr_g_creategeometryfromjson
— Methodogr_g_creategeometryfromjson(arg1)
Create a OGR geometry from a GeoJSON geometry object
GDAL.ogr_g_crosses
— MethodOGR_G_Crosses(OGRGeometryH hThis,
OGRGeometryH hOther) -> int
Test for crossing.
Parameters
- hThis: the geometry to compare.
- hOther: the other geometry to compare.
Returns
TRUE if they are crossing, otherwise FALSE.
GDAL.ogr_g_delaunaytriangulation
— MethodOGR_G_DelaunayTriangulation(OGRGeometryH hThis,
double dfTolerance,
int bOnlyEdges) -> OGRGeometryH
Return a Delaunay triangulation of the vertices of the geometry.
Parameters
- hThis: the geometry.
- dfTolerance: optional snapping tolerance to use for improved robustness
- bOnlyEdges: if TRUE, will return a MULTILINESTRING, otherwise it will return a GEOMETRYCOLLECTION containing triangular POLYGONs.
Returns
the geometry resulting from the Delaunay triangulation or NULL if an error occurs.
GDAL.ogr_g_destroygeometry
— MethodOGR_G_DestroyGeometry(OGRGeometryH hGeom) -> void
Destroy geometry object.
Parameters
- hGeom: handle to the geometry to delete.
GDAL.ogr_g_difference
— MethodOGR_G_Difference(OGRGeometryH hThis,
OGRGeometryH hOther) -> OGRGeometryH
Compute difference.
Parameters
- hThis: the geometry.
- hOther: the other geometry.
Returns
a new geometry representing the difference or NULL if the difference is empty or an error occurs.
GDAL.ogr_g_disjoint
— MethodOGR_G_Disjoint(OGRGeometryH hThis,
OGRGeometryH hOther) -> int
Test for disjointness.
Parameters
- hThis: the geometry to compare.
- hOther: the other geometry to compare.
Returns
TRUE if they are disjoint, otherwise FALSE.
GDAL.ogr_g_distance
— MethodOGR_G_Distance(OGRGeometryH hFirst,
OGRGeometryH hOther) -> double
Compute distance between two geometries.
Parameters
- hFirst: the first geometry to compare against.
- hOther: the other geometry to compare against.
Returns
the distance between the geometries or -1 if an error occurs.
GDAL.ogr_g_distance3d
— MethodOGR_G_Distance3D(OGRGeometryH hFirst,
OGRGeometryH hOther) -> double
Returns the 3D distance between two geometries.
Parameters
- hFirst: the first geometry to compare against.
- hOther: the other geometry to compare against.
Returns
distance between the two geometries
GDAL.ogr_g_dumpreadable
— MethodOGR_G_DumpReadable(OGRGeometryH hGeom,
FILE * fp,
const char * pszPrefix) -> void
Dump geometry in well known text format to indicated output file.
Parameters
- hGeom: handle on the geometry to dump.
- fp: the text file to write the geometry to.
- pszPrefix: the prefix to put on each line of output.
GDAL.ogr_g_empty
— MethodOGR_G_Empty(OGRGeometryH hGeom) -> void
Clear geometry information.
Parameters
- hGeom: handle on the geometry to empty.
GDAL.ogr_g_equals
— MethodOGR_G_Equals(OGRGeometryH hGeom,
OGRGeometryH hOther) -> int
Returns TRUE if two geometries are equivalent.
Parameters
- hGeom: handle on the first geometry.
- hOther: handle on the other geometry to test against.
Returns
TRUE if equivalent or FALSE otherwise.
GDAL.ogr_g_exportenvelopetogmltree
— MethodOGR_G_ExportEnvelopeToGMLTree(OGRGeometryH hGeometry) -> CPLXMLNode *
Export the envelope of a geometry as a gml:Box.
GDAL.ogr_g_exporttogml
— MethodOGR_G_ExportToGML(OGRGeometryH hGeometry) -> char *
Convert a geometry into GML format.
Parameters
- hGeometry: handle to the geometry.
Returns
A GML fragment or NULL in case of error.
GDAL.ogr_g_exporttogmlex
— MethodOGR_G_ExportToGMLEx(OGRGeometryH hGeometry,
char ** papszOptions) -> char *
Convert a geometry into GML format.
Parameters
- hGeometry: handle to the geometry.
- papszOptions: NULL-terminated list of options.
Returns
A GML fragment or NULL in case of error.
GDAL.ogr_g_exporttogmltree
— MethodOGR_G_ExportToGMLTree(OGRGeometryH hGeometry) -> CPLXMLNode *
Convert a geometry into GML format.
GDAL.ogr_g_exporttoisowkb
— MethodOGR_G_ExportToIsoWkb(OGRGeometryH hGeom,
OGRwkbByteOrder eOrder,
unsigned char * pabyDstBuffer) -> OGRErr
Convert a geometry into SFSQL 1.2 / ISO SQL/MM Part 3 well known binary format.
Parameters
- hGeom: handle on the geometry to convert to a well know binary data from.
- eOrder: One of wkbXDR or wkbNDR indicating MSB or LSB byte order respectively.
- pabyDstBuffer: a buffer into which the binary representation is written. This buffer must be at least OGRGWkbSize() byte in size.
Returns
Currently OGRERR_NONE is always returned.
GDAL.ogr_g_exporttoisowkt
— MethodOGR_G_ExportToIsoWkt(OGRGeometryH hGeom,
char ** ppszSrcText) -> OGRErr
Convert a geometry into SFSQL 1.2 / ISO SQL/MM Part 3 well known text format.
Parameters
- hGeom: handle on the geometry to convert to a text format from.
- ppszSrcText: a text buffer is allocated by the program, and assigned to the passed pointer. After use, *ppszDstText should be freed with CPLFree().
Returns
Currently OGRERR_NONE is always returned.
GDAL.ogr_g_exporttojson
— MethodOGR_G_ExportToJson(OGRGeometryH hGeometry) -> char *
Convert a geometry into GeoJSON format.
Parameters
- hGeometry: handle to the geometry.
Returns
A GeoJSON fragment or NULL in case of error.
GDAL.ogr_g_exporttojsonex
— MethodOGR_G_ExportToJsonEx(OGRGeometryH hGeometry,
char ** papszOptions) -> char *
Convert a geometry into GeoJSON format.
Parameters
- hGeometry: handle to the geometry.
- papszOptions: a null terminated list of options.
Returns
A GeoJSON fragment or NULL in case of error.
GDAL.ogr_g_exporttokml
— MethodOGR_G_ExportToKML(OGRGeometryH hGeometry,
const char * pszAltitudeMode) -> char *
Convert a geometry into KML format.
Parameters
- hGeometry: handle to the geometry.
- pszAltitudeMode: value to write in altitudeMode element, or NULL.
Returns
A KML fragment or NULL in case of error.
GDAL.ogr_g_exporttowkb
— MethodOGR_G_ExportToWkb(OGRGeometryH hGeom,
OGRwkbByteOrder eOrder,
unsigned char * pabyDstBuffer) -> OGRErr
Convert a geometry well known binary format.
Parameters
- hGeom: handle on the geometry to convert to a well know binary data from.
- eOrder: One of wkbXDR or wkbNDR indicating MSB or LSB byte order respectively.
- pabyDstBuffer: a buffer into which the binary representation is written. This buffer must be at least OGRGWkbSize() byte in size.
Returns
Currently OGRERR_NONE is always returned.
GDAL.ogr_g_exporttowkbex
— MethodOGR_G_ExportToWkbEx(OGRGeometryH hGeom,
unsigned char * pabyDstBuffer,
const OGRwkbExportOptions * psOptions) -> OGRErr
Convert a geometry into well known binary format.
Parameters
- hGeom: handle on the geometry to convert to a well know binary data from.
- pabyDstBuffer: a buffer into which the binary representation is written. This buffer must be at least OGRGWkbSize() byte in size.
- psOptions: WKB export options.
Returns
Currently OGRERR_NONE is always returned.
GDAL.ogr_g_exporttowkt
— MethodOGR_G_ExportToWkt(OGRGeometryH hGeom,
char ** ppszSrcText) -> OGRErr
Convert a geometry into well known text format.
Parameters
- hGeom: handle on the geometry to convert to a text format from.
- ppszSrcText: a text buffer is allocated by the program, and assigned to the passed pointer. After use, *ppszDstText should be freed with CPLFree().
Returns
Currently OGRERR_NONE is always returned.
GDAL.ogr_g_flattento2d
— MethodOGR_G_FlattenTo2D(OGRGeometryH hGeom) -> void
Convert geometry to strictly 2D.
Parameters
- hGeom: handle on the geometry to convert.
GDAL.ogr_g_forceto
— MethodOGR_G_ForceTo(OGRGeometryH hGeom,
OGRwkbGeometryType eTargetType,
char ** papszOptions) -> OGRGeometryH
Convert to another geometry type.
Parameters
- hGeom: the input geometry - ownership is passed to the method.
- eTargetType: target output geometry type.
- papszOptions: options as a null-terminated list of strings or NULL.
Returns
new geometry.
GDAL.ogr_g_forcetolinestring
— MethodOGR_G_ForceToLineString(OGRGeometryH hGeom) -> OGRGeometryH
Convert to line string.
Parameters
- hGeom: handle to the geometry to convert (ownership surrendered).
Returns
the converted geometry (ownership to caller).
GDAL.ogr_g_forcetomultilinestring
— MethodOGR_G_ForceToMultiLineString(OGRGeometryH hGeom) -> OGRGeometryH
Convert to multilinestring.
Parameters
- hGeom: handle to the geometry to convert (ownership surrendered).
Returns
the converted geometry (ownership to caller).
GDAL.ogr_g_forcetomultipoint
— MethodOGR_G_ForceToMultiPoint(OGRGeometryH hGeom) -> OGRGeometryH
Convert to multipoint.
Parameters
- hGeom: handle to the geometry to convert (ownership surrendered).
Returns
the converted geometry (ownership to caller).
GDAL.ogr_g_forcetomultipolygon
— MethodOGR_G_ForceToMultiPolygon(OGRGeometryH hGeom) -> OGRGeometryH
Convert to multipolygon.
Parameters
- hGeom: handle to the geometry to convert (ownership surrendered).
Returns
the converted geometry (ownership to caller).
GDAL.ogr_g_forcetopolygon
— MethodOGR_G_ForceToPolygon(OGRGeometryH hGeom) -> OGRGeometryH
Convert to polygon.
Parameters
- hGeom: handle to the geometry to convert (ownership surrendered).
Returns
the converted geometry (ownership to caller).
GDAL.ogr_g_geodesicarea
— MethodOGR_G_GeodesicArea(OGRGeometryH hGeom) -> double
Compute geometry area, considered as a surface on the underlying ellipsoid of the SRS attached to the geometry.
Parameters
- hGeom: the geometry to operate on.
Returns
the area, or a negative value in case of error (unsupported geometry type, no SRS attached, etc.)
GDAL.ogr_g_getarea
— MethodOGR_G_GetArea(OGRGeometryH hGeom) -> double
Compute geometry area (deprecated)
GDAL.ogr_g_getboundary
— MethodOGR_G_GetBoundary(OGRGeometryH hTarget) -> OGRGeometryH
Compute boundary (deprecated)
GDAL.ogr_g_getcoordinatedimension
— MethodOGR_G_GetCoordinateDimension(OGRGeometryH hGeom) -> int
Get the dimension of the coordinates in this geometry.
Parameters
- hGeom: handle on the geometry to get the dimension of the coordinates from.
Returns
this will return 2 or 3.
GDAL.ogr_g_getcurvegeometry
— MethodOGR_G_GetCurveGeometry(OGRGeometryH hGeom,
char ** papszOptions) -> OGRGeometryH
Return curve version of this geometry.
Parameters
- hGeom: the geometry to operate on.
- papszOptions: options as a null-terminated list of strings. Unused for now. Must be set to NULL.
Returns
a new geometry.
GDAL.ogr_g_getdimension
— MethodOGR_G_GetDimension(OGRGeometryH hGeom) -> int
Get the dimension of this geometry.
Parameters
- hGeom: handle on the geometry to get the dimension from.
Returns
0 for points, 1 for lines and 2 for surfaces.
GDAL.ogr_g_getenvelope
— MethodOGR_G_GetEnvelope(OGRGeometryH hGeom,
OGREnvelope * psEnvelope) -> void
Computes and returns the bounding envelope for this geometry in the passed psEnvelope structure.
Parameters
- hGeom: handle of the geometry to get envelope from.
- psEnvelope: the structure in which to place the results.
GDAL.ogr_g_getenvelope3d
— MethodOGR_G_GetEnvelope3D(OGRGeometryH hGeom,
OGREnvelope3D * psEnvelope) -> void
Computes and returns the bounding envelope (3D) for this geometry in the passed psEnvelope structure.
Parameters
- hGeom: handle of the geometry to get envelope from.
- psEnvelope: the structure in which to place the results.
GDAL.ogr_g_getgeometrycount
— MethodOGR_G_GetGeometryCount(OGRGeometryH hGeom) -> int
Fetch the number of elements in a geometry or number of geometries in container.
Parameters
- hGeom: single geometry or geometry container from which to get the number of elements.
Returns
the number of elements.
GDAL.ogr_g_getgeometryname
— MethodOGR_G_GetGeometryName(OGRGeometryH hGeom) -> const char *
Fetch WKT name for geometry type.
Parameters
- hGeom: handle on the geometry to get name from.
Returns
name used for this geometry type in well known text format.
GDAL.ogr_g_getgeometryref
— MethodOGR_G_GetGeometryRef(OGRGeometryH hGeom,
int iSubGeom) -> OGRGeometryH
Fetch geometry from a geometry container.
Parameters
- hGeom: handle to the geometry container from which to get a geometry from.
- iSubGeom: the index of the geometry to fetch, between 0 and getNumGeometries() - 1.
Returns
handle to the requested geometry.
GDAL.ogr_g_getgeometrytype
— MethodOGR_G_GetGeometryType(OGRGeometryH hGeom) -> OGRwkbGeometryType
Fetch geometry type.
Parameters
- hGeom: handle on the geometry to get type from.
Returns
the geometry type code.
GDAL.ogr_g_getlineargeometry
— MethodOGR_G_GetLinearGeometry(OGRGeometryH hGeom,
double dfMaxAngleStepSizeDegrees,
char ** papszOptions) -> OGRGeometryH
Return, possibly approximate, linear version of this geometry.
Parameters
- hGeom: the geometry to operate on.
- dfMaxAngleStepSizeDegrees: the largest step in degrees along the arc, zero to use the default setting.
- papszOptions: options as a null-terminated list of strings or NULL. See OGRGeometryFactory::curveToLineString() for valid options.
Returns
a new geometry.
GDAL.ogr_g_getm
— MethodOGR_G_GetM(OGRGeometryH hGeom,
int i) -> double
Fetch the m coordinate of a point from a geometry.
Parameters
- hGeom: handle to the geometry from which to get the M coordinate.
- i: point to get the M coordinate.
Returns
the M coordinate of this point.
GDAL.ogr_g_getpoint
— MethodOGR_G_GetPoint(OGRGeometryH hGeom,
int i,
double * pdfX,
double * pdfY,
double * pdfZ) -> void
Fetch a point in line string or a point geometry.
Parameters
- hGeom: handle to the geometry from which to get the coordinates.
- i: the vertex to fetch, from 0 to getNumPoints()-1, zero for a point.
- pdfX: value of x coordinate.
- pdfY: value of y coordinate.
- pdfZ: value of z coordinate.
GDAL.ogr_g_getpointcount
— Methodogr_g_getpointcount(arg1)
GDAL.ogr_g_getpoints
— MethodOGR_G_GetPoints(OGRGeometryH hGeom,
void * pabyX,
int nXStride,
void * pabyY,
int nYStride,
void * pabyZ,
int nZStride) -> int
Returns all points of line string.
Parameters
- hGeom: handle to the geometry from which to get the coordinates.
- pabyX: a buffer of at least (sizeof(double) * nXStride * nPointCount) bytes, may be NULL.
- nXStride: the number of bytes between 2 elements of pabyX.
- pabyY: a buffer of at least (sizeof(double) * nYStride * nPointCount) bytes, may be NULL.
- nYStride: the number of bytes between 2 elements of pabyY.
- pabyZ: a buffer of at last size (sizeof(double) * nZStride * nPointCount) bytes, may be NULL.
- nZStride: the number of bytes between 2 elements of pabyZ.
Returns
the number of points
GDAL.ogr_g_getpointszm
— MethodOGR_G_GetPointsZM(OGRGeometryH hGeom,
void * pabyX,
int nXStride,
void * pabyY,
int nYStride,
void * pabyZ,
int nZStride,
void * pabyM,
int nMStride) -> int
Returns all points of line string.
Parameters
- hGeom: handle to the geometry from which to get the coordinates.
- pabyX: a buffer of at least (nXStride * nPointCount) bytes, may be NULL.
- nXStride: the number of bytes between 2 elements of pabyX.
- pabyY: a buffer of at least (nYStride * nPointCount) bytes, may be NULL.
- nYStride: the number of bytes between 2 elements of pabyY.
- pabyZ: a buffer of at last size (nZStride * nPointCount) bytes, may be NULL.
- nZStride: the number of bytes between 2 elements of pabyZ.
- pabyM: a buffer of at last size (nMStride * nPointCount) bytes, may be NULL.
- nMStride: the number of bytes between 2 elements of pabyM.
Returns
the number of points
GDAL.ogr_g_getpointzm
— MethodOGR_G_GetPointZM(OGRGeometryH hGeom,
int i,
double * pdfX,
double * pdfY,
double * pdfZ,
double * pdfM) -> void
Fetch a point in line string or a point geometry.
Parameters
- hGeom: handle to the geometry from which to get the coordinates.
- i: the vertex to fetch, from 0 to getNumPoints()-1, zero for a point.
- pdfX: value of x coordinate.
- pdfY: value of y coordinate.
- pdfZ: value of z coordinate.
- pdfM: value of m coordinate.
GDAL.ogr_g_getspatialreference
— MethodOGR_G_GetSpatialReference(OGRGeometryH hGeom) -> OGRSpatialReferenceH
Returns spatial reference system for geometry.
Parameters
- hGeom: handle on the geometry to get spatial reference from.
Returns
a reference to the spatial reference geometry, which should not be modified.
GDAL.ogr_g_getx
— MethodOGR_G_GetX(OGRGeometryH hGeom,
int i) -> double
Fetch the x coordinate of a point from a Point or a LineString/LinearRing geometry.
Parameters
- hGeom: handle to the geometry from which to get the x coordinate.
- i: point to get the x coordinate.
Returns
the X coordinate of this point.
GDAL.ogr_g_gety
— MethodOGR_G_GetY(OGRGeometryH hGeom,
int i) -> double
Fetch the x coordinate of a point from a Point or a LineString/LinearRing geometry.
Parameters
- hGeom: handle to the geometry from which to get the y coordinate.
- i: point to get the Y coordinate.
Returns
the Y coordinate of this point.
GDAL.ogr_g_getz
— MethodOGR_G_GetZ(OGRGeometryH hGeom,
int i) -> double
Fetch the z coordinate of a point from a Point or a LineString/LinearRing geometry.
Parameters
- hGeom: handle to the geometry from which to get the Z coordinate.
- i: point to get the Z coordinate.
Returns
the Z coordinate of this point.
GDAL.ogr_g_hascurvegeometry
— MethodOGR_G_HasCurveGeometry(OGRGeometryH hGeom,
int bLookForNonLinear) -> int
Returns if this geometry is or has curve geometry.
Parameters
- hGeom: the geometry to operate on.
- bLookForNonLinear: set it to TRUE to check if the geometry is or contains a CIRCULARSTRING.
Returns
TRUE if this geometry is or has curve geometry.
GDAL.ogr_g_importfromwkb
— MethodOGR_G_ImportFromWkb(OGRGeometryH hGeom,
const void * pabyData,
int nSize) -> OGRErr
Assign geometry from well known binary data.
Parameters
- hGeom: handle on the geometry to assign the well know binary data to.
- pabyData: the binary input data.
- nSize: the size of pabyData in bytes, or -1 if not known.
Returns
OGRERRNONE if all goes well, otherwise any of OGRERRNOTENOUGHDATA, OGRERRUNSUPPORTEDGEOMETRYTYPE, or OGRERRCORRUPT_DATA may be returned.
GDAL.ogr_g_importfromwkt
— MethodOGR_G_ImportFromWkt(OGRGeometryH hGeom,
char ** ppszSrcText) -> OGRErr
Assign geometry from well known text data.
Parameters
- hGeom: handle on the geometry to assign well know text data to.
- ppszSrcText: pointer to a pointer to the source text. The pointer is updated to pointer after the consumed text.
Returns
OGRERRNONE if all goes well, otherwise any of OGRERRNOTENOUGHDATA, OGRERRUNSUPPORTEDGEOMETRYTYPE, or OGRERRCORRUPT_DATA may be returned.
GDAL.ogr_g_intersect
— Methodogr_g_intersect(arg1, arg2)
Doxygen_Suppress
GDAL.ogr_g_intersection
— MethodOGR_G_Intersection(OGRGeometryH hThis,
OGRGeometryH hOther) -> OGRGeometryH
Compute intersection.
Parameters
- hThis: the geometry.
- hOther: the other geometry.
Returns
a new geometry representing the intersection or NULL if there is no intersection or an error occurs.
GDAL.ogr_g_intersects
— MethodOGR_G_Intersects(OGRGeometryH hGeom,
OGRGeometryH hOtherGeom) -> int
Do these features intersect?
Parameters
- hGeom: handle on the first geometry.
- hOtherGeom: handle on the other geometry to test against.
Returns
TRUE if the geometries intersect, otherwise FALSE.
GDAL.ogr_g_is3d
— MethodOGR_G_Is3D(OGRGeometryH hGeom) -> int
See whether this geometry has Z coordinates.
Parameters
- hGeom: handle on the geometry to check whether it has Z coordinates.
Returns
TRUE if the geometry has Z coordinates.
GDAL.ogr_g_isclockwise
— MethodOGR_G_IsClockwise(OGRGeometryH hGeom) -> bool
Returns true if the ring has clockwise winding (or less than 2 points)
Parameters
- hGeom: handle to a curve geometry
GDAL.ogr_g_isempty
— MethodOGR_G_IsEmpty(OGRGeometryH hGeom) -> int
Test if the geometry is empty.
Parameters
- hGeom: The Geometry to test.
Returns
TRUE if the geometry has no points, otherwise FALSE.
GDAL.ogr_g_ismeasured
— MethodOGR_G_IsMeasured(OGRGeometryH hGeom) -> int
See whether this geometry is measured.
Parameters
- hGeom: handle on the geometry to check whether it is measured.
Returns
TRUE if the geometry has M coordinates.
GDAL.ogr_g_isring
— MethodOGR_G_IsRing(OGRGeometryH hGeom) -> int
Test if the geometry is a ring.
Parameters
- hGeom: The Geometry to test.
Returns
TRUE if the geometry has no points, otherwise FALSE.
GDAL.ogr_g_issimple
— MethodOGR_G_IsSimple(OGRGeometryH hGeom) -> int
Returns TRUE if the geometry is simple.
Parameters
- hGeom: The Geometry to test.
Returns
TRUE if object is simple, otherwise FALSE.
GDAL.ogr_g_isvalid
— MethodOGR_G_IsValid(OGRGeometryH hGeom) -> int
Test if the geometry is valid.
Parameters
- hGeom: The Geometry to test.
Returns
TRUE if the geometry has no points, otherwise FALSE.
GDAL.ogr_g_length
— MethodOGR_G_Length(OGRGeometryH hGeom) -> double
Compute length of a geometry.
Parameters
- hGeom: the geometry to operate on.
Returns
the length or 0.0 for unsupported geometry types.
GDAL.ogr_g_makevalid
— MethodOGR_G_MakeValid(OGRGeometryH hGeom) -> OGRGeometryH
Attempts to make an invalid geometry valid without losing vertices.
Parameters
- hGeom: The Geometry to make valid.
Returns
a newly allocated geometry now owned by the caller, or NULL on failure.
GDAL.ogr_g_makevalidex
— MethodOGR_G_MakeValidEx(OGRGeometryH hGeom,
CSLConstList papszOptions) -> OGRGeometryH
Attempts to make an invalid geometry valid without losing vertices.
Parameters
- hGeom: The Geometry to make valid.
- papszOptions: Options.
Returns
a newly allocated geometry now owned by the caller, or NULL on failure.
GDAL.ogr_g_normalize
— MethodOGR_G_Normalize(OGRGeometryH hGeom) -> OGRGeometryH
Attempts to bring geometry into normalized/canonical form.
Parameters
- hGeom: The Geometry to normalize.
Returns
a newly allocated geometry now owned by the caller, or NULL on failure.
GDAL.ogr_g_overlaps
— MethodOGR_G_Overlaps(OGRGeometryH hThis,
OGRGeometryH hOther) -> int
Test for overlap.
Parameters
- hThis: the geometry to compare.
- hOther: the other geometry to compare.
Returns
TRUE if they are overlapping, otherwise FALSE.
GDAL.ogr_g_pointonsurface
— MethodOGR_G_PointOnSurface(OGRGeometryH hGeom) -> OGRGeometryH
Returns a point guaranteed to lie on the surface.
Parameters
- hGeom: the geometry to operate on.
Returns
a point guaranteed to lie on the surface or NULL if an error occurred.
GDAL.ogr_g_polygonize
— MethodOGR_G_Polygonize(OGRGeometryH hTarget) -> OGRGeometryH
Polygonizes a set of sparse edges.
Parameters
- hTarget: The Geometry to be polygonized.
Returns
a handle to a newly allocated geometry now owned by the caller, or NULL on failure.
GDAL.ogr_g_removegeometry
— MethodOGR_G_RemoveGeometry(OGRGeometryH hGeom,
int iGeom,
int bDelete) -> OGRErr
Remove a geometry from an exiting geometry container.
Parameters
- hGeom: the existing geometry to delete from.
- iGeom: the index of the geometry to delete. A value of -1 is a special flag meaning that all geometries should be removed.
- bDelete: if TRUE the geometry will be destroyed, otherwise it will not. The default is TRUE as the existing geometry is considered to own the geometries in it.
Returns
OGRERRNONE if successful, or OGRERRFAILURE if the index is out of range.
GDAL.ogr_g_removelowerdimensionsubgeoms
— MethodOGR_G_RemoveLowerDimensionSubGeoms(const OGRGeometryH hGeom) -> OGRGeometryH
Remove sub-geometries from a geometry collection that do not have the maximum topological dimensionality of the collection.
Parameters
- hGeom: handle to the geometry to convert
Returns
a new geometry.
GDAL.ogr_g_segmentize
— MethodOGR_G_Segmentize(OGRGeometryH hGeom,
double dfMaxLength) -> void
Modify the geometry such it has no segment longer then the given distance.
Parameters
- hGeom: handle on the geometry to segmentize
- dfMaxLength: the maximum distance between 2 points after segmentization
GDAL.ogr_g_set3d
— MethodOGR_G_Set3D(OGRGeometryH hGeom,
int bIs3D) -> void
Add or remove the Z coordinate dimension.
Parameters
- hGeom: handle on the geometry to set or unset the Z dimension.
- bIs3D: Should the geometry have a Z dimension, either TRUE or FALSE.
GDAL.ogr_g_setcoordinatedimension
— MethodOGR_G_SetCoordinateDimension(OGRGeometryH hGeom,
int nNewDimension) -> void
Set the coordinate dimension.
Parameters
- hGeom: handle on the geometry to set the dimension of the coordinates.
- nNewDimension: New coordinate dimension value, either 2 or 3.
GDAL.ogr_g_setmeasured
— MethodOGR_G_SetMeasured(OGRGeometryH hGeom,
int bIsMeasured) -> void
Add or remove the M coordinate dimension.
Parameters
- hGeom: handle on the geometry to set or unset the M dimension.
- bIsMeasured: Should the geometry have a M dimension, either TRUE or FALSE.
GDAL.ogr_g_setpoint
— MethodOGR_G_SetPoint(OGRGeometryH hGeom,
int i,
double dfX,
double dfY,
double dfZ) -> void
Set the location of a vertex in a point or linestring geometry.
Parameters
- hGeom: handle to the geometry to add a vertex to.
- i: the index of the vertex to assign (zero based) or zero for a point.
- dfX: input X coordinate to assign.
- dfY: input Y coordinate to assign.
- dfZ: input Z coordinate to assign (defaults to zero).
GDAL.ogr_g_setpoint_2d
— MethodOGR_G_SetPoint_2D(OGRGeometryH hGeom,
int i,
double dfX,
double dfY) -> void
Set the location of a vertex in a point or linestring geometry.
Parameters
- hGeom: handle to the geometry to add a vertex to.
- i: the index of the vertex to assign (zero based) or zero for a point.
- dfX: input X coordinate to assign.
- dfY: input Y coordinate to assign.
GDAL.ogr_g_setpointcount
— MethodOGR_G_SetPointCount(OGRGeometryH hGeom,
int nNewPointCount) -> void
Set number of points in a geometry.
Parameters
- hGeom: handle to the geometry.
- nNewPointCount: the new number of points for geometry.
GDAL.ogr_g_setpointm
— MethodOGR_G_SetPointM(OGRGeometryH hGeom,
int i,
double dfX,
double dfY,
double dfM) -> void
Set the location of a vertex in a point or linestring geometry.
Parameters
- hGeom: handle to the geometry to add a vertex to.
- i: the index of the vertex to assign (zero based) or zero for a point.
- dfX: input X coordinate to assign.
- dfY: input Y coordinate to assign.
- dfM: input M coordinate to assign.
GDAL.ogr_g_setpoints
— MethodOGR_G_SetPoints(OGRGeometryH hGeom,
int nPointsIn,
const void * pabyX,
int nXStride,
const void * pabyY,
int nYStride,
const void * pabyZ,
int nZStride) -> void
Assign all points in a point or a line string geometry.
Parameters
- hGeom: handle to the geometry to set the coordinates.
- nPointsIn: number of points being passed in padfX and padfY.
- pabyX: list of X coordinates (double values) of points being assigned.
- nXStride: the number of bytes between 2 elements of pabyX.
- pabyY: list of Y coordinates (double values) of points being assigned.
- nYStride: the number of bytes between 2 elements of pabyY.
- pabyZ: list of Z coordinates (double values) of points being assigned (defaults to NULL for 2D objects).
- nZStride: the number of bytes between 2 elements of pabyZ.
GDAL.ogr_g_setpointszm
— MethodOGR_G_SetPointsZM(OGRGeometryH hGeom,
int nPointsIn,
const void * pX,
int nXStride,
const void * pY,
int nYStride,
const void * pZ,
int nZStride,
const void * pM,
int nMStride) -> void
Assign all points in a point or a line string geometry.
Parameters
- hGeom: handle to the geometry to set the coordinates.
- nPointsIn: number of points being passed in padfX and padfY.
- pX: list of X coordinates (double values) of points being assigned.
- nXStride: the number of bytes between 2 elements of pX.
- pY: list of Y coordinates (double values) of points being assigned.
- nYStride: the number of bytes between 2 elements of pY.
- pZ: list of Z coordinates (double values) of points being assigned (if not NULL, upgrades the geometry to have Z coordinate).
- nZStride: the number of bytes between 2 elements of pZ.
- pM: list of M coordinates (double values) of points being assigned (if not NULL, upgrades the geometry to have M coordinate).
- nMStride: the number of bytes between 2 elements of pM.
GDAL.ogr_g_setpointzm
— MethodOGR_G_SetPointZM(OGRGeometryH hGeom,
int i,
double dfX,
double dfY,
double dfZ,
double dfM) -> void
Set the location of a vertex in a point or linestring geometry.
Parameters
- hGeom: handle to the geometry to add a vertex to.
- i: the index of the vertex to assign (zero based) or zero for a point.
- dfX: input X coordinate to assign.
- dfY: input Y coordinate to assign.
- dfZ: input Z coordinate to assign.
- dfM: input M coordinate to assign.
GDAL.ogr_g_setprecision
— MethodOGR_G_SetPrecision(OGRGeometryH hThis,
double dfGridSize,
int nFlags) -> OGRGeometryH
Set the geometry's precision, rounding all its coordinates to the precision grid, and making sure the geometry is still valid.
Parameters
- hThis: the geometry.
- dfGridSize: size of the precision grid, or 0 for FLOATING precision.
- nFlags: The bitwise OR of zero, one or several of OGRGEOSPRECNOTOPO and OGRGEOSPRECKEEPCOLLAPSED
Returns
a new geometry or NULL if an error occurs.
GDAL.ogr_g_simplify
— MethodOGR_G_Simplify(OGRGeometryH hThis,
double dTolerance) -> OGRGeometryH
Compute a simplified geometry.
Parameters
- hThis: the geometry.
- dTolerance: the distance tolerance for the simplification.
Returns
the simplified geometry or NULL if an error occurs.
GDAL.ogr_g_simplifypreservetopology
— MethodOGR_G_SimplifyPreserveTopology(OGRGeometryH hThis,
double dTolerance) -> OGRGeometryH
Simplify the geometry while preserving topology.
Parameters
- hThis: the geometry.
- dTolerance: the distance tolerance for the simplification.
Returns
the simplified geometry or NULL if an error occurs.
GDAL.ogr_g_swapxy
— MethodOGR_G_SwapXY(OGRGeometryH hGeom) -> void
Swap x and y coordinates.
Parameters
- hGeom: geometry.
GDAL.ogr_g_symdifference
— MethodOGR_G_SymDifference(OGRGeometryH hThis,
OGRGeometryH hOther) -> OGRGeometryH
Compute symmetric difference.
Parameters
- hThis: the geometry.
- hOther: the other geometry.
Returns
a new geometry representing the symmetric difference or NULL if the difference is empty or an error occurs.
GDAL.ogr_g_symmetricdifference
— MethodOGR_G_SymmetricDifference(OGRGeometryH hThis,
OGRGeometryH hOther) -> OGRGeometryH
Compute symmetric difference (deprecated)
GDAL.ogr_g_touches
— MethodOGR_G_Touches(OGRGeometryH hThis,
OGRGeometryH hOther) -> int
Test for touching.
Parameters
- hThis: the geometry to compare.
- hOther: the other geometry to compare.
Returns
TRUE if they are touching, otherwise FALSE.
GDAL.ogr_g_transform
— MethodOGR_G_Transform(OGRGeometryH hGeom,
OGRCoordinateTransformationH hTransform) -> OGRErr
Apply arbitrary coordinate transformation to geometry.
Parameters
- hGeom: handle on the geometry to apply the transform to.
- hTransform: handle on the transformation to apply.
Returns
OGRERR_NONE on success or an error code.
GDAL.ogr_g_transformto
— MethodOGR_G_TransformTo(OGRGeometryH hGeom,
OGRSpatialReferenceH hSRS) -> OGRErr
Transform geometry to new spatial reference system.
Parameters
- hGeom: handle on the geometry to apply the transform to.
- hSRS: handle on the spatial reference system to apply.
Returns
OGRERR_NONE on success, or an error code.
GDAL.ogr_g_unaryunion
— MethodOGR_G_UnaryUnion(OGRGeometryH hThis) -> OGRGeometryH
Returns the union of all components of a single geometry.
Parameters
- hThis: the geometry.
Returns
a new geometry representing the union or NULL if an error occurs.
GDAL.ogr_g_union
— MethodOGR_G_Union(OGRGeometryH hThis,
OGRGeometryH hOther) -> OGRGeometryH
Compute union.
Parameters
- hThis: the geometry.
- hOther: the other geometry.
Returns
a new geometry representing the union or NULL if an error occurs.
GDAL.ogr_g_unioncascaded
— MethodOGR_G_UnionCascaded(OGRGeometryH hThis) -> OGRGeometryH
Compute union using cascading.
Parameters
- hThis: the geometry.
Returns
a new geometry representing the union or NULL if an error occurs.
GDAL.ogr_g_value
— MethodOGR_G_Value(OGRGeometryH hGeom,
double dfDistance) -> OGRGeometryH
Fetch point at given distance along curve.
Parameters
- hGeom: curve geometry.
- dfDistance: distance along the curve at which to sample position. This distance should be between zero and get_Length() for this curve.
Returns
a point or NULL.
GDAL.ogr_g_within
— MethodOGR_G_Within(OGRGeometryH hThis,
OGRGeometryH hOther) -> int
Test for containment.
Parameters
- hThis: the geometry to compare.
- hOther: the other geometry to compare.
Returns
TRUE if hThis is within hOther, otherwise FALSE.
GDAL.ogr_g_wkbsize
— MethodOGR_G_WkbSize(OGRGeometryH hGeom) -> int
Returns size of related binary representation.
Parameters
- hGeom: handle on the geometry to get the binary size from.
Returns
size of binary representation in bytes.
GDAL.ogr_g_wkbsizeex
— MethodOGR_G_WkbSizeEx(OGRGeometryH hGeom) -> size_t
Returns size of related binary representation.
Parameters
- hGeom: handle on the geometry to get the binary size from.
Returns
size of binary representation in bytes.
GDAL.ogr_geomtransformer_create
— MethodOGR_GeomTransformer_Create(OGRCoordinateTransformationH hCT,
CSLConstList papszOptions) -> OGRGeomTransformerH
Create a geometry transformer.
Parameters
- hCT: Coordinate transformation object (will be cloned) or NULL.
- papszOptions: NULL terminated list of options, or NULL. Supported options are:
WRAPDATELINE=YES
DATELINEOFFSET=longitudegapin_degree. Defaults to 10.
Returns
transformer object to free with OGRGeomTransformerDestroy()
GDAL.ogr_geomtransformer_destroy
— MethodOGR_GeomTransformer_Destroy(OGRGeomTransformerH hTransformer) -> void
Destroy a geometry transformer allocated with OGRGeomTransformerCreate()
Parameters
- hTransformer: transformer object.
GDAL.ogr_geomtransformer_transform
— MethodOGR_GeomTransformer_Transform(OGRGeomTransformerH hTransformer,
OGRGeometryH hGeom) -> OGRGeometryH
Transforms a geometry.
Parameters
- hTransformer: transformer object.
- hGeom: Source geometry.
Returns
a new geometry (or NULL) to destroy with OGRGDestroyGeometry()
GDAL.ogr_getfieldsubtypename
— MethodOGR_GetFieldSubTypeName(OGRFieldSubType eSubType) -> const char *
Fetch human readable name for a field subtype.
Parameters
- eSubType: the field subtype to get name for.
Returns
the name.
GDAL.ogr_getfieldtypename
— MethodOGR_GetFieldTypeName(OGRFieldType eType) -> const char *
Fetch human readable name for a field type.
Parameters
- eType: the field type to get name for.
Returns
the name.
GDAL.ogr_gfld_create
— MethodOGR_GFld_Create(const char * pszName,
OGRwkbGeometryType eType) -> OGRGeomFieldDefnH
Create a new field geometry definition.
Parameters
- pszName: the name of the new field definition.
- eType: the type of the new field definition.
Returns
handle to the new field definition.
GDAL.ogr_gfld_destroy
— MethodOGR_GFld_Destroy(OGRGeomFieldDefnH hDefn) -> void
Destroy a geometry field definition.
Parameters
- hDefn: handle to the geometry field definition to destroy.
GDAL.ogr_gfld_getcoordinateprecision
— MethodOGR_GFld_GetCoordinatePrecision(OGRGeomFieldDefnH hDefn) -> OGRGeomCoordinatePrecisionH
Return the coordinate precision associated to this geometry field.
Parameters
- hDefn: handle to the field definition
Returns
the coordinate precision
GDAL.ogr_gfld_getnameref
— MethodOGR_GFld_GetNameRef(OGRGeomFieldDefnH hDefn) -> const char *
Fetch name of this field.
Parameters
- hDefn: handle to the geometry field definition.
Returns
the name of the geometry field definition.
GDAL.ogr_gfld_getspatialref
— MethodOGR_GFld_GetSpatialRef(OGRGeomFieldDefnH hDefn) -> OGRSpatialReferenceH
Fetch spatial reference system of this field.
Parameters
- hDefn: handle to the geometry field definition
Returns
a reference to the field spatial reference system. It should not be modified.
GDAL.ogr_gfld_gettype
— MethodOGR_GFld_GetType(OGRGeomFieldDefnH hDefn) -> OGRwkbGeometryType
Fetch geometry type of this field.
Parameters
- hDefn: handle to the geometry field definition to get type from.
Returns
field geometry type.
GDAL.ogr_gfld_isignored
— MethodOGR_GFld_IsIgnored(OGRGeomFieldDefnH hDefn) -> int
Return whether this field should be omitted when fetching features.
Parameters
- hDefn: handle to the geometry field definition
Returns
ignore state
GDAL.ogr_gfld_isnullable
— MethodOGR_GFld_IsNullable(OGRGeomFieldDefnH hDefn) -> int
Return whether this geometry field can receive null values.
Parameters
- hDefn: handle to the field definition
Returns
TRUE if the field is authorized to be null.
GDAL.ogr_gfld_setcoordinateprecision
— MethodOGR_GFld_SetCoordinatePrecision(OGRGeomFieldDefnH hDefn,
OGRGeomCoordinatePrecisionH hGeomCoordPrec) -> void
Set coordinate precision associated to this geometry field.
Parameters
- hDefn: handle to the field definition. Must not be NULL.
- hGeomCoordPrec: Coordinate precision. Must not be NULL.
GDAL.ogr_gfld_setignored
— MethodOGR_GFld_SetIgnored(OGRGeomFieldDefnH hDefn,
int ignore) -> void
Set whether this field should be omitted when fetching features.
Parameters
- hDefn: handle to the geometry field definition
- ignore: ignore state
GDAL.ogr_gfld_setname
— MethodOGR_GFld_SetName(OGRGeomFieldDefnH hDefn,
const char * pszName) -> void
Reset the name of this field.
Parameters
- hDefn: handle to the geometry field definition to apply the new name to.
- pszName: the new name to apply.
GDAL.ogr_gfld_setnullable
— MethodOGR_GFld_SetNullable(OGRGeomFieldDefnH hDefn,
int bNullableIn) -> void
Set whether this geometry field can receive null values.
Parameters
- hDefn: handle to the field definition
- bNullableIn: FALSE if the field must have a not-null constraint.
GDAL.ogr_gfld_setspatialref
— MethodOGR_GFld_SetSpatialRef(OGRGeomFieldDefnH hDefn,
OGRSpatialReferenceH hSRS) -> void
Set the spatial reference of this field.
Parameters
- hDefn: handle to the geometry field definition
- hSRS: the new SRS to apply.
GDAL.ogr_gfld_settype
— MethodOGR_GFld_SetType(OGRGeomFieldDefnH hDefn,
OGRwkbGeometryType eType) -> void
Set the geometry type of this field.
Parameters
- hDefn: handle to the geometry field definition to set type to.
- eType: the new field geometry type.
GDAL.ogr_globflddomain_create
— MethodOGR_GlobFldDomain_Create(const char * pszName,
const char * pszDescription,
OGRFieldType eFieldType,
OGRFieldSubType eFieldSubType,
const char * pszGlob) -> OGRFieldDomainH
Creates a new glob field domain.
Parameters
- pszName: Domain name. Should not be NULL.
- pszDescription: Domain description (can be NULL)
- eFieldType: Field type.
- eFieldSubType: Field subtype.
- pszGlob: Glob expression. Should not be NULL.
Returns
a new handle that should be freed with OGRFldDomainDestroy()
GDAL.ogr_globflddomain_getglob
— MethodOGR_GlobFldDomain_GetGlob(OGRFieldDomainH hFieldDomain) -> const char *
Get the glob expression.
Parameters
- hFieldDomain: Field domain handle.
Returns
the glob expression, or nullptr in case of error
GDAL.ogr_gt_flatten
— MethodOGR_GT_Flatten(OGRwkbGeometryType eType) -> OGRwkbGeometryType
Returns the 2D geometry type corresponding to the passed geometry type.
Parameters
- eType: Input geometry type
Returns
2D geometry type corresponding to the passed geometry type.
GDAL.ogr_gt_getcollection
— MethodOGR_GT_GetCollection(OGRwkbGeometryType eType) -> OGRwkbGeometryType
Returns the collection type that can contain the passed geometry type.
Parameters
- eType: Input geometry type
Returns
the collection type that can contain the passed geometry type or wkbUnknown
GDAL.ogr_gt_getcurve
— MethodOGR_GT_GetCurve(OGRwkbGeometryType eType) -> OGRwkbGeometryType
Returns the curve geometry type that can contain the passed geometry type.
Parameters
- eType: Input geometry type
Returns
the curve type that can contain the passed geometry type
GDAL.ogr_gt_getlinear
— MethodOGR_GT_GetLinear(OGRwkbGeometryType eType) -> OGRwkbGeometryType
Returns the non-curve geometry type that can contain the passed geometry type.
Parameters
- eType: Input geometry type
Returns
the non-curve type that can contain the passed geometry type
GDAL.ogr_gt_hasm
— MethodOGR_GT_HasM(OGRwkbGeometryType eType) -> int
Return if the geometry type is a measured type.
Parameters
- eType: Input geometry type
Returns
TRUE if the geometry type is a measured type.
GDAL.ogr_gt_hasz
— MethodOGR_GT_HasZ(OGRwkbGeometryType eType) -> int
Return if the geometry type is a 3D geometry type.
Parameters
- eType: Input geometry type
Returns
TRUE if the geometry type is a 3D geometry type.
GDAL.ogr_gt_iscurve
— MethodOGR_GT_IsCurve(OGRwkbGeometryType eGeomType) -> int
Return if a geometry type is an instance of Curve.
Parameters
- eGeomType: the geometry type
Returns
TRUE if the geometry type is an instance of Curve
GDAL.ogr_gt_isnonlinear
— MethodOGR_GT_IsNonLinear(OGRwkbGeometryType eGeomType) -> int
Return if a geometry type is a non-linear geometry type.
Parameters
- eGeomType: the geometry type
Returns
TRUE if the geometry type is a non-linear geometry type.
GDAL.ogr_gt_issubclassof
— MethodOGR_GT_IsSubClassOf(OGRwkbGeometryType eType,
OGRwkbGeometryType eSuperType) -> int
Returns if a type is a subclass of another one.
Parameters
- eType: Type.
- eSuperType: Super type
Returns
TRUE if eType is a subclass of eSuperType.
GDAL.ogr_gt_issurface
— MethodOGR_GT_IsSurface(OGRwkbGeometryType eGeomType) -> int
Return if a geometry type is an instance of Surface.
Parameters
- eGeomType: the geometry type
Returns
TRUE if the geometry type is an instance of Surface
GDAL.ogr_gt_setm
— MethodOGR_GT_SetM(OGRwkbGeometryType eType) -> OGRwkbGeometryType
Returns the measured geometry type corresponding to the passed geometry type.
Parameters
- eType: Input geometry type
Returns
measured geometry type corresponding to the passed geometry type.
GDAL.ogr_gt_setmodifier
— MethodOGR_GT_SetModifier(OGRwkbGeometryType eType,
int bHasZ,
int bHasM) -> OGRwkbGeometryType
Returns a XY, XYZ, XYM or XYZM geometry type depending on parameter.
Parameters
- eType: Input geometry type
- bHasZ: TRUE if the output geometry type must be 3D.
- bHasM: TRUE if the output geometry type must be measured.
Returns
Output geometry type.
GDAL.ogr_gt_setz
— MethodOGR_GT_SetZ(OGRwkbGeometryType eType) -> OGRwkbGeometryType
Returns the 3D geometry type corresponding to the passed geometry type.
Parameters
- eType: Input geometry type
Returns
3D geometry type corresponding to the passed geometry type.
GDAL.ogr_l_alterfielddefn
— MethodOGR_L_AlterFieldDefn(OGRLayerH hLayer,
int iField,
OGRFieldDefnH hNewFieldDefn,
int nFlags) -> OGRErr
Alter the definition of an existing field on a layer.
Parameters
- hLayer: handle to the layer.
- iField: index of the field whose definition must be altered.
- hNewFieldDefn: new field definition
- nFlags: combination of ALTERNAMEFLAG, ALTERTYPEFLAG, ALTERWIDTHPRECISIONFLAG, ALTERNULLABLEFLAG and ALTERDEFAULT_FLAG to indicate which of the name and/or type and/or width and precision fields and/or nullability from the new field definition must be taken into account.
Returns
OGRERR_NONE on success.
GDAL.ogr_l_altergeomfielddefn
— MethodOGR_L_AlterGeomFieldDefn(OGRLayerH hLayer,
int iField,
OGRGeomFieldDefnH hNewGeomFieldDefn,
int nFlags) -> OGRErr
Alter the definition of an existing geometry field on a layer.
Parameters
- hLayer: handle to the layer.
- iGeomField: index of the field whose definition must be altered.
- hNewGeomFieldDefn: new field definition
- nFlags: combination of ALTERGEOMFIELDDEFNNAMEFLAG, ALTERGEOMFIELDDEFNTYPEFLAG, ALTERGEOMFIELDDEFNNULLABLEFLAG, ALTERGEOMFIELDDEFNSRSFLAG, ALTERGEOMFIELDDEFNSRSCOORDEPOCHFLAG to indicate which of the name and/or type and/or nullability and/or SRS and/or coordinate epoch from the new field definition must be taken into account. Or ALTERGEOMFIELDDEFNALLFLAG to update all members.
Returns
OGRERR_NONE on success.
GDAL.ogr_l_clip
— MethodOGR_L_Clip(OGRLayerH pLayerInput,
OGRLayerH pLayerMethod,
OGRLayerH pLayerResult,
char ** papszOptions,
GDALProgressFunc pfnProgress,
void * pProgressArg) -> OGRErr
Clip off areas that are not covered by the method layer.
Parameters
- pLayerInput: the input layer. Should not be NULL.
- pLayerMethod: the method layer. Should not be NULL.
- pLayerResult: the layer where the features resulting from the operation are inserted. Should not be NULL. See above the note about the schema.
- papszOptions: NULL terminated list of options (may be NULL).
- pfnProgress: a GDALProgressFunc() compatible callback function for reporting progress or NULL.
- pProgressArg: argument to be passed to pfnProgress. May be NULL.
Returns
an error code if there was an error or the execution was interrupted, OGRERR_NONE otherwise.
GDAL.ogr_l_committransaction
— MethodOGR_L_CommitTransaction(OGRLayerH hLayer) -> OGRErr
For datasources which support transactions, CommitTransaction commits a transaction.
Parameters
- hLayer: handle to the layer
Returns
OGRERR_NONE on success.
GDAL.ogr_l_createfeature
— MethodOGR_L_CreateFeature(OGRLayerH hLayer,
OGRFeatureH hFeat) -> OGRErr
Create and write a new feature within a layer.
Parameters
- hLayer: handle to the layer to write the feature to.
- hFeat: the handle of the feature to write to disk.
Returns
OGRERR_NONE on success.
GDAL.ogr_l_createfield
— MethodOGR_L_CreateField(OGRLayerH hLayer,
OGRFieldDefnH hField,
int bApproxOK) -> OGRErr
Create a new field on a layer.
Parameters
- hLayer: handle to the layer to write the field definition.
- hField: handle of the field definition to write to disk.
- bApproxOK: If TRUE, the field may be created in a slightly different form depending on the limitations of the format driver.
Returns
OGRERR_NONE on success.
GDAL.ogr_l_createfieldfromarrowschema
— MethodOGR_L_CreateFieldFromArrowSchema(OGRLayerH hLayer,
const struct ArrowSchema * schema,
char ** papszOptions) -> bool
Creates a field from an ArrowSchema.
Parameters
- hLayer: Layer.
- schema: Schema of the field to create.
- papszOptions: Options (none currently). Null terminated list, or nullptr.
Returns
true in case of success
GDAL.ogr_l_creategeomfield
— MethodOGR_L_CreateGeomField(OGRLayerH hLayer,
OGRGeomFieldDefnH hFieldDefn,
int bForce) -> OGRErr
Create a new geometry field on a layer.
Parameters
- hLayer: handle to the layer to write the field definition.
- hField: handle of the geometry field definition to write to disk.
- bApproxOK: If TRUE, the field may be created in a slightly different form depending on the limitations of the format driver.
Returns
OGRERR_NONE on success.
GDAL.ogr_l_deletefeature
— MethodOGR_L_DeleteFeature(OGRLayerH hLayer,
GIntBig nFID) -> OGRErr
Delete feature from layer.
Parameters
- hLayer: handle to the layer
- nFID: the feature id to be deleted from the layer
Returns
OGRERRNONE if the operation works, otherwise an appropriate error code (e.g OGRERRNONEXISTINGFEATURE if the feature does not exist).
GDAL.ogr_l_deletefield
— MethodOGR_L_DeleteField(OGRLayerH hLayer,
int iField) -> OGRErr
Delete an existing field on a layer.
Parameters
- hLayer: handle to the layer.
- iField: index of the field to delete.
Returns
OGRERR_NONE on success.
GDAL.ogr_l_dereference
— MethodOGR_L_Dereference(OGRLayerH hLayer) -> int
GDAL.ogr_l_erase
— MethodOGR_L_Erase(OGRLayerH pLayerInput,
OGRLayerH pLayerMethod,
OGRLayerH pLayerResult,
char ** papszOptions,
GDALProgressFunc pfnProgress,
void * pProgressArg) -> OGRErr
Remove areas that are covered by the method layer.
Parameters
- pLayerInput: the input layer. Should not be NULL.
- pLayerMethod: the method layer. Should not be NULL.
- pLayerResult: the layer where the features resulting from the operation are inserted. Should not be NULL. See above the note about the schema.
- papszOptions: NULL terminated list of options (may be NULL).
- pfnProgress: a GDALProgressFunc() compatible callback function for reporting progress or NULL.
- pProgressArg: argument to be passed to pfnProgress. May be NULL.
Returns
an error code if there was an error or the execution was interrupted, OGRERR_NONE otherwise.
GDAL.ogr_l_findfieldindex
— MethodOGR_L_FindFieldIndex(OGRLayerH hLayer,
const char * pszFieldName,
int bExactMatch) -> int
Find the index of field in a layer.
Returns
field index, or -1 if the field doesn't exist
GDAL.ogr_l_getarrowstream
— MethodOGR_L_GetArrowStream(OGRLayerH hLayer,
struct ArrowArrayStream * out_stream,
char ** papszOptions) -> bool
Get a Arrow C stream.
Parameters
- hLayer: Layer
- out_stream: Output stream. Must not be NULL. The content of the structure does not need to be initialized.
- papszOptions: NULL terminated list of key=value options.
Returns
true in case of success.
GDAL.ogr_l_getdataset
— MethodOGR_L_GetDataset(OGRLayerH hLayer) -> GDALDatasetH
Return the dataset associated with this layer.
Returns
dataset, or nullptr when unknown.
GDAL.ogr_l_getextent
— MethodOGR_L_GetExtent(OGRLayerH hLayer,
OGREnvelope * psExtent,
int bForce) -> OGRErr
Fetch the extent of this layer.
Parameters
- hLayer: handle to the layer from which to get extent.
- psExtent: the structure in which the extent value will be returned.
- bForce: Flag indicating whether the extent should be computed even if it is expensive.
Returns
OGRERRNONE on success, OGRERRFAILURE if extent not known.
GDAL.ogr_l_getextent3d
— MethodOGR_L_GetExtent3D(OGRLayerH hLayer,
int iGeomField,
OGREnvelope3D * psExtent3D,
int bForce) -> OGRErr
Fetch the 3D extent of this layer, on the specified geometry field.
Parameters
- hLayer: the layer to consider.
- iGeomField: 0-based index of the geometry field to consider.
- psExtent3D: the computed 3D extent of the layer.
- bForce: if TRUE, the extent will be computed even if all the layer features have to be fetched.
Returns
OGRERR_NONE on success or an error code in case of failure.
GDAL.ogr_l_getextentex
— MethodOGR_L_GetExtentEx(OGRLayerH hLayer,
int iGeomField,
OGREnvelope * psExtent,
int bForce) -> OGRErr
Fetch the extent of this layer, on the specified geometry field.
Parameters
- hLayer: handle to the layer from which to get extent.
- iGeomField: the index of the geometry field on which to compute the extent.
- psExtent: the structure in which the extent value will be returned.
- bForce: Flag indicating whether the extent should be computed even if it is expensive.
Returns
OGRERRNONE on success, OGRERRFAILURE if extent not known.
GDAL.ogr_l_getfeature
— MethodOGR_L_GetFeature(OGRLayerH hLayer,
GIntBig nFeatureId) -> OGRFeatureH
Fetch a feature by its identifier.
Parameters
- hLayer: handle to the layer that owned the feature.
- nFeatureId: the feature id of the feature to read.
Returns
a handle to a feature now owned by the caller, or NULL on failure.
GDAL.ogr_l_getfeaturecount
— MethodOGR_L_GetFeatureCount(OGRLayerH hLayer,
int bForce) -> GIntBig
Fetch the feature count in this layer.
Parameters
- hLayer: handle to the layer that owned the features.
- bForce: Flag indicating whether the count should be computed even if it is expensive.
Returns
feature count, -1 if count not known.
GDAL.ogr_l_getfeaturesread
— Methodogr_l_getfeaturesread(arg1)
Doxygen_Suppress
GDAL.ogr_l_getfidcolumn
— Methodogr_l_getfidcolumn(arg1)
GDAL.ogr_l_getgeometrycolumn
— MethodOGR_L_GetGeometryColumn(OGRLayerH hLayer) -> const char *
This method returns the name of the underlying database column being used as the geometry column, or "" if not supported.
Parameters
- hLayer: handle to the layer
Returns
geometry column name.
GDAL.ogr_l_getgeometrytypes
— MethodOGR_L_GetGeometryTypes(OGRLayerH hLayer,
int iGeomField,
int nFlags,
int * pnEntryCount,
GDALProgressFunc pfnProgress,
void * pProgressData) -> OGRGeometryTypeCounter *
Get actual geometry types found in features.
Parameters
- hLayer: Layer.
- iGeomField: Geometry field index.
- nFlags: Hint flags. 0, or combination of OGRGGTCOUNTNOTNEEDED, OGRGGTSTOPIFMIXED, OGRGGTGEOMCOLLECTIONZ_TINZ
- pnEntryCount: Pointer to the number of entries in the returned array. Must not be NULL.
- pfnProgress: Cancellation callback. May be NULL.
- pProgressData: User data for the cancellation callback. May be NULL.
Returns
an array of *pnEntryCount that must be freed with CPLFree(), or NULL in case of error
GDAL.ogr_l_getgeomtype
— MethodOGR_L_GetGeomType(OGRLayerH hLayer) -> OGRwkbGeometryType
Return the layer geometry type.
Parameters
- hLayer: handle to the layer.
Returns
the geometry type
GDAL.ogr_l_getlayerdefn
— MethodOGR_L_GetLayerDefn(OGRLayerH hLayer) -> OGRFeatureDefnH
Fetch the schema information for this layer.
Parameters
- hLayer: handle to the layer to get the schema information.
Returns
a handle to the feature definition.
GDAL.ogr_l_getname
— MethodOGR_L_GetName(OGRLayerH hLayer) -> const char *
Return the layer name.
Parameters
- hLayer: handle to the layer.
Returns
the layer name (must not been freed)
GDAL.ogr_l_getnextfeature
— MethodOGR_L_GetNextFeature(OGRLayerH hLayer) -> OGRFeatureH
Fetch the next available feature from this layer.
Parameters
- hLayer: handle to the layer from which feature are read.
Returns
a handle to a feature, or NULL if no more features are available.
GDAL.ogr_l_getrefcount
— MethodOGR_L_GetRefCount(OGRLayerH hLayer) -> int
GDAL.ogr_l_getspatialfilter
— MethodOGR_L_GetSpatialFilter(OGRLayerH hLayer) -> OGRGeometryH
This function returns the current spatial filter for this layer.
Parameters
- hLayer: handle to the layer to get the spatial filter from.
Returns
a handle to the spatial filter geometry.
GDAL.ogr_l_getspatialref
— MethodOGR_L_GetSpatialRef(OGRLayerH hLayer) -> OGRSpatialReferenceH
Fetch the spatial reference system for this layer.
Parameters
- hLayer: handle to the layer to get the spatial reference from.
Returns
spatial reference, or NULL if there isn't one.
GDAL.ogr_l_getstyletable
— Methodogr_l_getstyletable(arg1)
Get style table
GDAL.ogr_l_getsupportedsrslist
— MethodOGR_L_GetSupportedSRSList(OGRLayerH hLayer,
int iGeomField,
int * pnCount) -> OGRSpatialReferenceH *
Get the list of SRS supported.
Parameters
- hLayer: Layer.
- iGeomField: Geometry field index.
- pnCount: Number of values in returned array. Must not be null.
Returns
list of supported SRS, to be freeds with OSRFreeSRSArray(), or nullptr
GDAL.ogr_l_identity
— MethodOGR_L_Identity(OGRLayerH pLayerInput,
OGRLayerH pLayerMethod,
OGRLayerH pLayerResult,
char ** papszOptions,
GDALProgressFunc pfnProgress,
void * pProgressArg) -> OGRErr
Identify the features of this layer with the ones from the identity layer.
Parameters
- pLayerInput: the input layer. Should not be NULL.
- pLayerMethod: the method layer. Should not be NULL.
- pLayerResult: the layer where the features resulting from the operation are inserted. Should not be NULL. See above the note about the schema.
- papszOptions: NULL terminated list of options (may be NULL).
- pfnProgress: a GDALProgressFunc() compatible callback function for reporting progress or NULL.
- pProgressArg: argument to be passed to pfnProgress. May be NULL.
Returns
an error code if there was an error or the execution was interrupted, OGRERR_NONE otherwise.
GDAL.ogr_l_intersection
— MethodOGR_L_Intersection(OGRLayerH pLayerInput,
OGRLayerH pLayerMethod,
OGRLayerH pLayerResult,
char ** papszOptions,
GDALProgressFunc pfnProgress,
void * pProgressArg) -> OGRErr
Intersection of two layers.
Parameters
- pLayerInput: the input layer. Should not be NULL.
- pLayerMethod: the method layer. Should not be NULL.
- pLayerResult: the layer where the features resulting from the operation are inserted. Should not be NULL. See above the note about the schema.
- papszOptions: NULL terminated list of options (may be NULL).
- pfnProgress: a GDALProgressFunc() compatible callback function for reporting progress or NULL.
- pProgressArg: argument to be passed to pfnProgress. May be NULL.
Returns
an error code if there was an error or the execution was interrupted, OGRERR_NONE otherwise.
GDAL.ogr_l_isarrowschemasupported
— MethodOGR_L_IsArrowSchemaSupported(OGRLayerH hLayer,
const struct ArrowSchema * schema,
char ** papszOptions,
char ** ppszErrorMsg) -> bool
Returns whether the provided ArrowSchema is supported for writing.
Parameters
- hLayer: Layer.
- schema: Schema of type struct (format = '+s')
- papszOptions: Options (none currently). Null terminated list, or nullptr.
- ppszErrorMsg: nullptr, or pointer to a string that will contain the reason of the failure, when this function returns false.
Returns
true if the ArrowSchema is supported for writing.
GDAL.ogr_l_reference
— Methodogr_l_reference(arg1)
Doxygen_Suppress
GDAL.ogr_l_rename
— MethodOGR_L_Rename(OGRLayerH hLayer,
const char * pszNewName) -> OGRErr
Rename layer.
Parameters
- hLayer: Layer to rename.
- pszNewName: New layer name. Must not be NULL.
Returns
OGRERR_NONE in case of success
GDAL.ogr_l_reorderfield
— MethodOGR_L_ReorderField(OGRLayerH hLayer,
int iOldFieldPos,
int iNewFieldPos) -> OGRErr
Reorder an existing field on a layer.
Parameters
- hLayer: handle to the layer.
- iOldFieldPos: previous position of the field to move. Must be in the range [0,GetFieldCount()-1].
- iNewFieldPos: new position of the field to move. Must be in the range [0,GetFieldCount()-1].
Returns
OGRERR_NONE on success.
GDAL.ogr_l_reorderfields
— MethodOGR_L_ReorderFields(OGRLayerH hLayer,
int * panMap) -> OGRErr
Reorder all the fields of a layer.
Parameters
- hLayer: handle to the layer.
- panMap: an array of GetLayerDefn()->OGRFeatureDefn::GetFieldCount() elements which is a permutation of [0, GetLayerDefn()->OGRFeatureDefn::GetFieldCount()-1].
Returns
OGRERR_NONE on success.
GDAL.ogr_l_resetreading
— MethodOGR_L_ResetReading(OGRLayerH hLayer) -> void
Reset feature reading to start on the first feature.
Parameters
- hLayer: handle to the layer on which features are read.
GDAL.ogr_l_rollbacktransaction
— MethodOGR_L_RollbackTransaction(OGRLayerH hLayer) -> OGRErr
For datasources which support transactions, RollbackTransaction will roll back a datasource to its state before the start of the current transaction.
Parameters
- hLayer: handle to the layer
Returns
OGRERR_NONE on success.
GDAL.ogr_l_setactivesrs
— MethodOGR_L_SetActiveSRS(OGRLayerH hLayer,
int iGeomField,
OGRSpatialReferenceH hSRS) -> OGRErr
Change the active SRS.
Parameters
- hLayer: Layer.
- iGeomField: Geometry field index.
- hSRS: SRS to use
Returns
OGRERRNONE in case of success, OGRERRFAILURE if the passed SRS is not in GetSupportedSRSList().
GDAL.ogr_l_setattributefilter
— MethodOGR_L_SetAttributeFilter(OGRLayerH hLayer,
const char * pszQuery) -> OGRErr
Set a new attribute query.
Parameters
- hLayer: handle to the layer on which attribute query will be executed.
- pszQuery: query in restricted SQL WHERE format, or NULL to clear the current query.
Returns
OGRERR_NONE if successfully installed, or an error code if the query expression is in error, or some other failure occurs.
GDAL.ogr_l_setfeature
— MethodOGR_L_SetFeature(OGRLayerH hLayer,
OGRFeatureH hFeat) -> OGRErr
Rewrite/replace an existing feature.
Parameters
- hLayer: handle to the layer to write the feature.
- hFeat: the feature to write.
Returns
OGRERRNONE if the operation works, otherwise an appropriate error code (e.g OGRERRNONEXISTINGFEATURE if the feature does not exist).
GDAL.ogr_l_setignoredfields
— MethodOGR_L_SetIgnoredFields(OGRLayerH hLayer,
const char ** papszFields) -> OGRErr
Set which fields can be omitted when retrieving features from the layer.
Parameters
- hLayer: handle to the layer
- papszFields: an array of field names terminated by NULL item. If NULL is passed, the ignored list is cleared.
Returns
OGRERR_NONE if all field names have been resolved (even if the driver does not support this method)
GDAL.ogr_l_setnextbyindex
— MethodOGR_L_SetNextByIndex(OGRLayerH hLayer,
GIntBig nIndex) -> OGRErr
Move read cursor to the nIndex'th feature in the current resultset.
Parameters
- hLayer: handle to the layer
- nIndex: the index indicating how many steps into the result set to seek.
Returns
OGRERR_NONE on success or an error code.
GDAL.ogr_l_setspatialfilter
— MethodOGR_L_SetSpatialFilter(OGRLayerH hLayer,
OGRGeometryH hGeom) -> void
Set a new spatial filter.
Parameters
- hLayer: handle to the layer on which to set the spatial filter.
- hGeom: handle to the geometry to use as a filtering region. NULL may be passed indicating that the current spatial filter should be cleared, but no new one instituted.
GDAL.ogr_l_setspatialfilterex
— MethodOGR_L_SetSpatialFilterEx(OGRLayerH hLayer,
int iGeomField,
OGRGeometryH hGeom) -> void
Set a new spatial filter.
Parameters
- hLayer: handle to the layer on which to set the spatial filter.
- iGeomField: index of the geometry field on which the spatial filter operates.
- hGeom: handle to the geometry to use as a filtering region. NULL may be passed indicating that the current spatial filter should be cleared, but no new one instituted.
GDAL.ogr_l_setspatialfilterrect
— MethodOGR_L_SetSpatialFilterRect(OGRLayerH hLayer,
double dfMinX,
double dfMinY,
double dfMaxX,
double dfMaxY) -> void
Set a new rectangular spatial filter.
Parameters
- hLayer: handle to the layer on which to set the spatial filter.
- dfMinX: the minimum X coordinate for the rectangular region.
- dfMinY: the minimum Y coordinate for the rectangular region.
- dfMaxX: the maximum X coordinate for the rectangular region.
- dfMaxY: the maximum Y coordinate for the rectangular region.
GDAL.ogr_l_setspatialfilterrectex
— MethodOGR_L_SetSpatialFilterRectEx(OGRLayerH hLayer,
int iGeomField,
double dfMinX,
double dfMinY,
double dfMaxX,
double dfMaxY) -> void
Set a new rectangular spatial filter.
Parameters
- hLayer: handle to the layer on which to set the spatial filter.
- iGeomField: index of the geometry field on which the spatial filter operates.
- dfMinX: the minimum X coordinate for the rectangular region.
- dfMinY: the minimum Y coordinate for the rectangular region.
- dfMaxX: the maximum X coordinate for the rectangular region.
- dfMaxY: the maximum Y coordinate for the rectangular region.
GDAL.ogr_l_setstyletable
— Methodogr_l_setstyletable(arg1, arg2)
Set style table
GDAL.ogr_l_setstyletabledirectly
— Methodogr_l_setstyletabledirectly(arg1, arg2)
Set style table (and take ownership)
GDAL.ogr_l_starttransaction
— MethodOGR_L_StartTransaction(OGRLayerH hLayer) -> OGRErr
For datasources which support transactions, StartTransaction creates a transaction.
Parameters
- hLayer: handle to the layer
Returns
OGRERR_NONE on success.
GDAL.ogr_l_symdifference
— MethodOGR_L_SymDifference(OGRLayerH pLayerInput,
OGRLayerH pLayerMethod,
OGRLayerH pLayerResult,
char ** papszOptions,
GDALProgressFunc pfnProgress,
void * pProgressArg) -> OGRErr
Symmetrical difference of two layers.
Parameters
- pLayerInput: the input layer. Should not be NULL.
- pLayerMethod: the method layer. Should not be NULL.
- pLayerResult: the layer where the features resulting from the operation are inserted. Should not be NULL. See above the note about the schema.
- papszOptions: NULL terminated list of options (may be NULL).
- pfnProgress: a GDALProgressFunc() compatible callback function for reporting progress or NULL.
- pProgressArg: argument to be passed to pfnProgress. May be NULL.
Returns
an error code if there was an error or the execution was interrupted, OGRERR_NONE otherwise.
GDAL.ogr_l_synctodisk
— Methodogr_l_synctodisk(arg1)
GDAL.ogr_l_testcapability
— MethodOGR_L_TestCapability(OGRLayerH hLayer,
const char * pszCap) -> int
Test if this layer supported the named capability.
Parameters
- hLayer: handle to the layer to get the capability from.
- pszCap: the name of the capability to test.
Returns
TRUE if the layer has the requested capability, or FALSE otherwise. OGRLayers will return FALSE for any unrecognized capabilities.
GDAL.ogr_l_union
— MethodOGR_L_Union(OGRLayerH pLayerInput,
OGRLayerH pLayerMethod,
OGRLayerH pLayerResult,
char ** papszOptions,
GDALProgressFunc pfnProgress,
void * pProgressArg) -> OGRErr
Union of two layers.
Parameters
- pLayerInput: the input layer. Should not be NULL.
- pLayerMethod: the method layer. Should not be NULL.
- pLayerResult: the layer where the features resulting from the operation are inserted. Should not be NULL. See above the note about the schema.
- papszOptions: NULL terminated list of options (may be NULL).
- pfnProgress: a GDALProgressFunc() compatible callback function for reporting progress or NULL.
- pProgressArg: argument to be passed to pfnProgress. May be NULL.
Returns
an error code if there was an error or the execution was interrupted, OGRERR_NONE otherwise.
GDAL.ogr_l_update
— MethodOGR_L_Update(OGRLayerH pLayerInput,
OGRLayerH pLayerMethod,
OGRLayerH pLayerResult,
char ** papszOptions,
GDALProgressFunc pfnProgress,
void * pProgressArg) -> OGRErr
Update this layer with features from the update layer.
Parameters
- pLayerInput: the input layer. Should not be NULL.
- pLayerMethod: the method layer. Should not be NULL.
- pLayerResult: the layer where the features resulting from the operation are inserted. Should not be NULL. See above the note about the schema.
- papszOptions: NULL terminated list of options (may be NULL).
- pfnProgress: a GDALProgressFunc() compatible callback function for reporting progress or NULL.
- pProgressArg: argument to be passed to pfnProgress. May be NULL.
Returns
an error code if there was an error or the execution was interrupted, OGRERR_NONE otherwise.
GDAL.ogr_l_updatefeature
— MethodOGR_L_UpdateFeature(OGRLayerH hLayer,
OGRFeatureH hFeat,
int nUpdatedFieldsCount,
const int * panUpdatedFieldsIdx,
int nUpdatedGeomFieldsCount,
const int * panUpdatedGeomFieldsIdx,
bool bUpdateStyleString) -> OGRErr
Update (part of) an existing feature.
Parameters
- hLayer: handle to the layer to write the feature.
- hFeat: the feature to update.
- nUpdatedFieldsCount: number of attribute fields to update. May be 0
- panUpdatedFieldsIdx: array of nUpdatedFieldsCount values, each between 0 and GetLayerDefn()->GetFieldCount() - 1, indicating which fields of hFeat must be updated in the layer.
- nUpdatedGeomFieldsCount: number of geometry fields to update. May be 0
- panUpdatedGeomFieldsIdx: array of nUpdatedGeomFieldsCount values, each between 0 and GetLayerDefn()->GetGeomFieldCount() - 1, indicating which geometry fields of hFeat must be updated in the layer.
- bUpdateStyleString: whether the feature style string in the layer should be updated with the one of hFeat.
Returns
OGRERRNONE if the operation works, otherwise an appropriate error code (e.g OGRERRNONEXISTINGFEATURE if the feature does not exist).
GDAL.ogr_l_upsertfeature
— MethodOGR_L_UpsertFeature(OGRLayerH hLayer,
OGRFeatureH hFeat) -> OGRErr
Rewrite/replace an existing feature or create a new feature within a layer.
Parameters
- hLayer: handle to the layer to write the feature to.
- hFeat: the handle of the feature to write to disk.
Returns
OGRERR_NONE on success.
GDAL.ogr_l_writearrowbatch
— MethodOGR_L_WriteArrowBatch(OGRLayerH hLayer,
const struct ArrowSchema * schema,
struct ArrowArray * array,
char ** papszOptions) -> bool
Writes a batch of rows from an ArrowArray.
Parameters
- hLayer: Layer.
- schema: Schema of array.
- array: Array of type struct. It may be released (array->release==NULL) after calling this method.
- papszOptions: Options. Null terminated list, or nullptr.
Returns
true in case of success
GDAL.ogr_rangeflddomain_create
— MethodOGR_RangeFldDomain_Create(const char * pszName,
const char * pszDescription,
OGRFieldType eFieldType,
OGRFieldSubType eFieldSubType,
const OGRField * psMin,
bool bMinIsInclusive,
const OGRField * psMax,
bool bMaxIsInclusive) -> OGRFieldDomainH
Creates a new range field domain.
Parameters
- pszName: Domain name. Should not be NULL.
- pszDescription: Domain description (can be NULL)
- eFieldType: Field type. Among OFTInteger, OFTInteger64, OFTReal and OFTDateTime.
- eFieldSubType: Field subtype.
- psMin: Minimum value (can be NULL). The member in the union that is read is consistent with eFieldType
- bMinIsInclusive: Whether the minimum value is included in the range.
- psMax: Maximum value (can be NULL). The member in the union that is read is consistent with eFieldType
- bMaxIsInclusive: Whether the maximum value is included in the range.
Returns
a new handle that should be freed with OGRFldDomainDestroy()
GDAL.ogr_rangeflddomain_getmax
— MethodOGR_RangeFldDomain_GetMax(OGRFieldDomainH hFieldDomain,
bool * pbIsInclusiveOut) -> const OGRField *
Get the maximum value.
Parameters
- hFieldDomain: Field domain handle.
- pbIsInclusiveOut: set to true if the maximum is included in the range.
Returns
the maximum value.
GDAL.ogr_rangeflddomain_getmin
— MethodOGR_RangeFldDomain_GetMin(OGRFieldDomainH hFieldDomain,
bool * pbIsInclusiveOut) -> const OGRField *
Get the minimum value.
Parameters
- hFieldDomain: Field domain handle.
- pbIsInclusiveOut: set to true if the minimum is included in the range.
Returns
the minimum value.
GDAL.ogr_rawfield_isnull
— MethodOGR_RawField_IsNull(const OGRField * puField) -> int
Returns whether a raw field is null.
Parameters
- puField: pointer to raw field.
GDAL.ogr_rawfield_isunset
— MethodOGR_RawField_IsUnset(const OGRField * puField) -> int
Returns whether a raw field is unset.
Parameters
- puField: pointer to raw field.
GDAL.ogr_rawfield_setnull
— MethodOGR_RawField_SetNull(OGRField * puField) -> void
Mark a raw field as null.
Parameters
- puField: pointer to raw field.
GDAL.ogr_rawfield_setunset
— MethodOGR_RawField_SetUnset(OGRField * puField) -> void
Mark a raw field as unset.
Parameters
- puField: pointer to raw field.
GDAL.ogr_sm_addpart
— MethodOGR_SM_AddPart(OGRStyleMgrH hSM,
OGRStyleToolH hST) -> int
Add a part (style tool) to the current style.
Parameters
- hSM: handle to the style manager.
- hST: the style tool defining the part to add.
Returns
TRUE on success, FALSE on errors.
GDAL.ogr_sm_addstyle
— MethodOGR_SM_AddStyle(OGRStyleMgrH hSM,
const char * pszStyleName,
const char * pszStyleString) -> int
Add a style to the current style table.
Parameters
- hSM: handle to the style manager.
- pszStyleName: the name of the style to add.
- pszStyleString: the style string to use, or NULL to use the style stored in the manager.
Returns
TRUE on success, FALSE on errors.
GDAL.ogr_sm_create
— MethodOGR_SM_Create(OGRStyleTableH hStyleTable) -> OGRStyleMgrH
OGRStyleMgr factory.
Parameters
- hStyleTable: pointer to OGRStyleTable or NULL if not working with a style table.
Returns
a handle to the new style manager object.
GDAL.ogr_sm_destroy
— MethodOGR_SM_Destroy(OGRStyleMgrH hSM) -> void
Destroy Style Manager.
Parameters
- hSM: handle to the style manager to destroy.
GDAL.ogr_sm_getpart
— MethodOGR_SM_GetPart(OGRStyleMgrH hSM,
int nPartId,
const char * pszStyleString) -> OGRStyleToolH
Fetch a part (style tool) from the current style.
Parameters
- hSM: handle to the style manager.
- nPartId: the part number (0-based index).
- pszStyleString: (optional) the style string on which to operate. If NULL then the current style string stored in the style manager is used.
Returns
OGRStyleToolH of the requested part (style tools) or NULL on error.
GDAL.ogr_sm_getpartcount
— MethodOGR_SM_GetPartCount(OGRStyleMgrH hSM,
const char * pszStyleString) -> int
Get the number of parts in a style.
Parameters
- hSM: handle to the style manager.
- pszStyleString: (optional) the style string on which to operate. If NULL then the current style string stored in the style manager is used.
Returns
the number of parts (style tools) in the style.
GDAL.ogr_sm_initfromfeature
— MethodOGR_SM_InitFromFeature(OGRStyleMgrH hSM,
OGRFeatureH hFeat) -> const char *
Initialize style manager from the style string of a feature.
Parameters
- hSM: handle to the style manager.
- hFeat: handle to the new feature from which to read the style.
Returns
a reference to the style string read from the feature, or NULL in case of error.
GDAL.ogr_sm_initstylestring
— MethodOGR_SM_InitStyleString(OGRStyleMgrH hSM,
const char * pszStyleString) -> int
Initialize style manager from the style string.
Parameters
- hSM: handle to the style manager.
- pszStyleString: the style string to use (can be NULL).
Returns
TRUE on success, FALSE on errors.
GDAL.ogr_st_create
— MethodOGR_ST_Create(OGRSTClassId eClassId) -> OGRStyleToolH
OGRStyleTool factory.
Parameters
- eClassId: subclass of style tool to create. One of OGRSTCPen (1), OGRSTCBrush (2), OGRSTCSymbol (3) or OGRSTCLabel (4).
Returns
a handle to the new style tool object or NULL if the creation failed.
GDAL.ogr_st_destroy
— MethodOGR_ST_Destroy(OGRStyleToolH hST) -> void
Destroy Style Tool.
Parameters
- hST: handle to the style tool to destroy.
GDAL.ogr_st_getparamdbl
— MethodOGR_ST_GetParamDbl(OGRStyleToolH hST,
int eParam,
int * bValueIsNull) -> double
Get Style Tool parameter value as a double.
Parameters
- hST: handle to the style tool.
- eParam: the parameter id from the enumeration corresponding to the type of this style tool (one of the OGRSTPenParam, OGRSTBrushParam, OGRSTSymbolParam or OGRSTLabelParam enumerations)
- bValueIsNull: pointer to an integer that will be set to TRUE or FALSE to indicate whether the parameter value is NULL.
Returns
the parameter value as double and sets bValueIsNull.
GDAL.ogr_st_getparamnum
— MethodOGR_ST_GetParamNum(OGRStyleToolH hST,
int eParam,
int * bValueIsNull) -> int
Get Style Tool parameter value as an integer.
Parameters
- hST: handle to the style tool.
- eParam: the parameter id from the enumeration corresponding to the type of this style tool (one of the OGRSTPenParam, OGRSTBrushParam, OGRSTSymbolParam or OGRSTLabelParam enumerations)
- bValueIsNull: pointer to an integer that will be set to TRUE or FALSE to indicate whether the parameter value is NULL.
Returns
the parameter value as integer and sets bValueIsNull.
GDAL.ogr_st_getparamstr
— MethodOGR_ST_GetParamStr(OGRStyleToolH hST,
int eParam,
int * bValueIsNull) -> const char *
Get Style Tool parameter value as string.
Parameters
- hST: handle to the style tool.
- eParam: the parameter id from the enumeration corresponding to the type of this style tool (one of the OGRSTPenParam, OGRSTBrushParam, OGRSTSymbolParam or OGRSTLabelParam enumerations)
- bValueIsNull: pointer to an integer that will be set to TRUE or FALSE to indicate whether the parameter value is NULL.
Returns
the parameter value as string and sets bValueIsNull.
GDAL.ogr_st_getrgbfromstring
— MethodOGR_ST_GetRGBFromString(OGRStyleToolH hST,
const char * pszColor,
int * pnRed,
int * pnGreen,
int * pnBlue,
int * pnAlpha) -> int
Return the r,g,b,a components of a color encoded in #RRGGBB[AA] format.
Parameters
- hST: handle to the style tool.
- pszColor: the color to parse
- pnRed: pointer to an int in which the red value will be returned
- pnGreen: pointer to an int in which the green value will be returned
- pnBlue: pointer to an int in which the blue value will be returned
- pnAlpha: pointer to an int in which the (optional) alpha value will be returned
Returns
TRUE if the color could be successfully parsed, or FALSE in case of errors.
GDAL.ogr_st_getstylestring
— MethodOGR_ST_GetStyleString(OGRStyleToolH hST) -> const char *
Get the style string for this Style Tool.
Parameters
- hST: handle to the style tool.
Returns
the style string for this style tool or "" if the hST is invalid.
GDAL.ogr_st_gettype
— MethodOGR_ST_GetType(OGRStyleToolH hST) -> OGRSTClassId
Determine type of Style Tool.
Parameters
- hST: handle to the style tool.
Returns
the style tool type, one of OGRSTCPen (1), OGRSTCBrush (2), OGRSTCSymbol (3) or OGRSTCLabel (4). Returns OGRSTCNone (0) if the OGRStyleToolH is invalid.
GDAL.ogr_st_getunit
— MethodOGR_ST_GetUnit(OGRStyleToolH hST) -> OGRSTUnitId
Get Style Tool units.
Parameters
- hST: handle to the style tool.
Returns
the style tool units.
GDAL.ogr_st_setparamdbl
— MethodOGR_ST_SetParamDbl(OGRStyleToolH hST,
int eParam,
double dfValue) -> void
Set Style Tool parameter value from a double.
Parameters
- hST: handle to the style tool.
- eParam: the parameter id from the enumeration corresponding to the type of this style tool (one of the OGRSTPenParam, OGRSTBrushParam, OGRSTSymbolParam or OGRSTLabelParam enumerations)
- dfValue: the new parameter value
GDAL.ogr_st_setparamnum
— MethodOGR_ST_SetParamNum(OGRStyleToolH hST,
int eParam,
int nValue) -> void
Set Style Tool parameter value from an integer.
Parameters
- hST: handle to the style tool.
- eParam: the parameter id from the enumeration corresponding to the type of this style tool (one of the OGRSTPenParam, OGRSTBrushParam, OGRSTSymbolParam or OGRSTLabelParam enumerations)
- nValue: the new parameter value
GDAL.ogr_st_setparamstr
— MethodOGR_ST_SetParamStr(OGRStyleToolH hST,
int eParam,
const char * pszValue) -> void
Set Style Tool parameter value from a string.
Parameters
- hST: handle to the style tool.
- eParam: the parameter id from the enumeration corresponding to the type of this style tool (one of the OGRSTPenParam, OGRSTBrushParam, OGRSTSymbolParam or OGRSTLabelParam enumerations)
- pszValue: the new parameter value
GDAL.ogr_st_setunit
— MethodOGR_ST_SetUnit(OGRStyleToolH hST,
OGRSTUnitId eUnit,
double dfGroundPaperScale) -> void
Set Style Tool units.
Parameters
- hST: handle to the style tool.
- eUnit: the new unit.
- dfGroundPaperScale: ground to paper scale factor.
GDAL.ogr_stbl_addstyle
— MethodOGR_STBL_AddStyle(OGRStyleTableH hStyleTable,
const char * pszName,
const char * pszStyleString) -> int
Add a new style in the table.
Parameters
- hStyleTable: handle to the style table.
- pszName: the name the style to add.
- pszStyleString: the style string to add.
Returns
TRUE on success, FALSE on error
GDAL.ogr_stbl_create
— MethodOGR_STBL_Create(void) -> OGRStyleTableH
OGRStyleTable factory.
Returns
a handle to the new style table object.
GDAL.ogr_stbl_destroy
— MethodOGR_STBL_Destroy(OGRStyleTableH hSTBL) -> void
Destroy Style Table.
Parameters
- hSTBL: handle to the style table to destroy.
GDAL.ogr_stbl_find
— MethodOGR_STBL_Find(OGRStyleTableH hStyleTable,
const char * pszName) -> const char *
Get a style string by name.
Parameters
- hStyleTable: handle to the style table.
- pszName: the name of the style string to find.
Returns
the style string matching the name or NULL if not found or error.
GDAL.ogr_stbl_getlaststylename
— MethodOGR_STBL_GetLastStyleName(OGRStyleTableH hStyleTable) -> const char *
Get the style name of the last style string fetched with OGRSTBLGetNextStyle.
Parameters
- hStyleTable: handle to the style table.
Returns
the Name of the last style string or NULL on error.
GDAL.ogr_stbl_getnextstyle
— MethodOGR_STBL_GetNextStyle(OGRStyleTableH hStyleTable) -> const char *
Get the next style string from the table.
Parameters
- hStyleTable: handle to the style table.
Returns
the next style string or NULL on error.
GDAL.ogr_stbl_loadstyletable
— MethodOGR_STBL_LoadStyleTable(OGRStyleTableH hStyleTable,
const char * pszFilename) -> int
Load a style table from a file.
Parameters
- hStyleTable: handle to the style table.
- pszFilename: the name of the file to load from.
Returns
TRUE on success, FALSE on error
GDAL.ogr_stbl_resetstylestringreading
— MethodOGR_STBL_ResetStyleStringReading(OGRStyleTableH hStyleTable) -> void
Reset the next style pointer to 0.
Parameters
- hStyleTable: handle to the style table.
GDAL.ogr_stbl_savestyletable
— MethodOGR_STBL_SaveStyleTable(OGRStyleTableH hStyleTable,
const char * pszFilename) -> int
Save a style table to a file.
Parameters
- hStyleTable: handle to the style table.
- pszFilename: the name of the file to save to.
Returns
TRUE on success, FALSE on error
GDAL.ogrbuildpolygonfromedges
— MethodOGRBuildPolygonFromEdges(OGRGeometryH hLines,
int bBestEffort,
int bAutoClose,
double dfTolerance,
OGRErr * peErr) -> OGRGeometryH
Build a ring from a bunch of arcs.
Parameters
- hLines: handle to an OGRGeometryCollection (or OGRMultiLineString) containing the line string geometries to be built into rings.
- bBestEffort: not yet implemented???.
- bAutoClose: indicates if the ring should be close when first and last points of the ring are the same.
- dfTolerance: tolerance into which two arcs are considered close enough to be joined.
- peErr: OGRERRNONE on success, or OGRERRFAILURE on failure.
Returns
a handle to the new geometry, a polygon.
GDAL.ogrcalloc
— MethodOGRCalloc(size_t count,
size_t size) -> void *
GDAL.ogrcleanupall
— Methodogrcleanupall()
Clean-up all drivers (including raster ones starting with GDAL 2.0. See GDALDestroyDriverManager
()
GDAL.ogrcontourwriter
— MethodOGRContourWriter(double dfLevel,
int nPoints,
double * padfX,
double * padfY,
void * pInfo) -> CPLErr
GDAL.ogrcreatepreparedgeometry
— MethodOGRCreatePreparedGeometry(OGRGeometryH hGeom) -> OGRPreparedGeometryH
Creates a prepared geometry.
Parameters
- hGeom: input geometry to prepare.
Returns
handle to a prepared geometry.
GDAL.ogrdestroypreparedgeometry
— MethodOGRDestroyPreparedGeometry(OGRPreparedGeometryH hPreparedGeom) -> void
Destroys a prepared geometry.
Parameters
- hPreparedGeom: preprated geometry.
GDAL.ogrfree
— MethodOGRFree(void * pMemory) -> void
GDAL.ogrgeomcoordinateprecisioncreate
— MethodOGRGeomCoordinatePrecisionCreate(void) -> OGRGeomCoordinatePrecisionH
Creates a new instance of OGRGeomCoordinatePrecision.
GDAL.ogrgeomcoordinateprecisiondestroy
— MethodOGRGeomCoordinatePrecisionDestroy(OGRGeomCoordinatePrecisionH hGeomCoordPrec) -> void
Destroy a OGRGeomCoordinatePrecision.
Parameters
- hGeomCoordPrec: OGRGeomCoordinatePrecision instance or nullptr
GDAL.ogrgeomcoordinateprecisiongetformats
— MethodOGRGeomCoordinatePrecisionGetFormats(OGRGeomCoordinatePrecisionH hGeomCoordPrec) -> char **
Get the list of format names for coordinate precision format specific options.
Parameters
- hGeomCoordPrec: OGRGeomCoordinatePrecision instance (must not be null)
Returns
a null-terminated list to free with CSLDestroy(), or nullptr.
GDAL.ogrgeomcoordinateprecisiongetformatspecificoptions
— MethodOGRGeomCoordinatePrecisionGetFormatSpecificOptions(OGRGeomCoordinatePrecisionH hGeomCoordPrec,
const char * pszFormatName) -> CSLConstList
Get format specific coordinate precision options.
Parameters
- hGeomCoordPrec: OGRGeomCoordinatePrecision instance (must not be null)
- pszFormatName: A format name (one of those returned by OGRGeomCoordinatePrecisionGetFormats())
Returns
a null-terminated list, or nullptr. The list must not be freed, and is owned by hGeomCoordPrec
GDAL.ogrgeomcoordinateprecisiongetmresolution
— MethodOGRGeomCoordinatePrecisionGetMResolution(OGRGeomCoordinatePrecisionH hGeomCoordPrec) -> double
Get the M resolution of a OGRGeomCoordinatePrecision.
Parameters
- hGeomCoordPrec: OGRGeomCoordinatePrecision instance (must not be null)
Returns
the the M resolution of a OGRGeomCoordinatePrecision or OGRGEOMCOORDPRECISIONUNKNOWN
GDAL.ogrgeomcoordinateprecisiongetxyresolution
— MethodOGRGeomCoordinatePrecisionGetXYResolution(OGRGeomCoordinatePrecisionH hGeomCoordPrec) -> double
Get the X/Y resolution of a OGRGeomCoordinatePrecision.
Parameters
- hGeomCoordPrec: OGRGeomCoordinatePrecision instance (must not be null)
Returns
the the X/Y resolution of a OGRGeomCoordinatePrecision or OGRGEOMCOORDPRECISIONUNKNOWN
GDAL.ogrgeomcoordinateprecisiongetzresolution
— MethodOGRGeomCoordinatePrecisionGetZResolution(OGRGeomCoordinatePrecisionH hGeomCoordPrec) -> double
Get the Z resolution of a OGRGeomCoordinatePrecision.
Parameters
- hGeomCoordPrec: OGRGeomCoordinatePrecision instance (must not be null)
Returns
the the Z resolution of a OGRGeomCoordinatePrecision or OGRGEOMCOORDPRECISIONUNKNOWN
GDAL.ogrgeomcoordinateprecisionset
— MethodOGRGeomCoordinatePrecisionSet(OGRGeomCoordinatePrecisionH hGeomCoordPrec,
double dfXYResolution,
double dfZResolution,
double dfMResolution) -> void
Set the resolution of the geometry coordinate components.
Parameters
- hGeomCoordPrec: OGRGeomCoordinatePrecision instance (must not be null)
- dfXYResolution: Resolution for for X and Y coordinates.
- dfZResolution: Resolution for for Z coordinates.
- dfMResolution: Resolution for for M coordinates.
GDAL.ogrgeomcoordinateprecisionsetformatspecificoptions
— MethodOGRGeomCoordinatePrecisionSetFormatSpecificOptions(OGRGeomCoordinatePrecisionH hGeomCoordPrec,
const char * pszFormatName,
CSLConstList papszOptions) -> void
Set format specific coordinate precision options.
Parameters
- hGeomCoordPrec: OGRGeomCoordinatePrecision instance (must not be null)
- pszFormatName: A format name (must not be null)
- papszOptions: null-terminated list of options.
GDAL.ogrgeomcoordinateprecisionsetfrommeter
— MethodOGRGeomCoordinatePrecisionSetFromMeter(OGRGeomCoordinatePrecisionH hGeomCoordPrec,
OGRSpatialReferenceH hSRS,
double dfXYMeterResolution,
double dfZMeterResolution,
double dfMResolution) -> void
Set the resolution of the geometry coordinate components.
Parameters
- hGeomCoordPrec: OGRGeomCoordinatePrecision instance (must not be null)
- hSRS: Spatial reference system, used for metric to SRS unit conversion (must not be null)
- dfXYMeterResolution: Resolution for for X and Y coordinates, in meter.
- dfZMeterResolution: Resolution for for Z coordinates, in meter.
- dfMResolution: Resolution for for M coordinates.
GDAL.ogrgeometrytypetoname
— MethodOGRGeometryTypeToName(OGRwkbGeometryType eType) -> const char *
Fetch a human readable name corresponding to an OGRwkbGeometryType value.
Parameters
- eType: the geometry type.
Returns
internal human readable string, or NULL on failure.
GDAL.ogrgetdriver
— MethodOGRGetDriver(int) -> OGRSFDriverH
Fetch the indicated driver.
Parameters
- iDriver: the driver index, from 0 to GetDriverCount()-1.
Returns
handle to the driver, or NULL if iDriver is out of range.
GDAL.ogrgetdriverbyname
— MethodOGRGetDriverByName(const char *) -> OGRSFDriverH
Fetch the indicated driver.
Parameters
- pszName: the driver name
Returns
the driver, or NULL if no driver with that name is found
GDAL.ogrgetdrivercount
— Methodogrgetdrivercount()
GDAL.ogrgetgenerate_db2_v72_byte_order
— MethodOGRGetGenerate_DB2_V72_BYTE_ORDER() -> int
GDAL.ogrgetgeosversion
— MethodOGRGetGEOSVersion(int * pnMajor,
int * pnMinor,
int * pnPatch) -> bool
Get the GEOS version.
Parameters
- pnMajor: Pointer to major version number, or NULL
- pnMinor: Pointer to minor version number, or NULL
- pnPatch: Pointer to patch version number, or NULL
Returns
TRUE if GDAL is built against GEOS
GDAL.ogrgetnonlineargeometriesenabledflag
— MethodOGRGetNonLinearGeometriesEnabledFlag(void) -> int
Get flag to enable/disable returning non-linear geometries in the C API.
GDAL.ogrgetopendscount
— Methodogrgetopendscount()
Doxygen_Suppress
GDAL.ogrhaspreparedgeometrysupport
— MethodOGRHasPreparedGeometrySupport() -> int
Returns if GEOS has prepared geometry support.
Returns
TRUE or FALSE
GDAL.ogrmalloc
— Methodogrmalloc(arg1)
Doxygen_Suppress
GDAL.ogrmergegeometrytypes
— MethodOGRMergeGeometryTypes(OGRwkbGeometryType eMain,
OGRwkbGeometryType eExtra) -> OGRwkbGeometryType
Find common geometry type.
Parameters
- eMain: the first input geometry type.
- eExtra: the second input geometry type.
Returns
the merged geometry type.
GDAL.ogrmergegeometrytypesex
— MethodOGRMergeGeometryTypesEx(OGRwkbGeometryType eMain,
OGRwkbGeometryType eExtra,
int bAllowPromotingToCurves) -> OGRwkbGeometryType
Find common geometry type.
Parameters
- eMain: the first input geometry type.
- eExtra: the second input geometry type.
- bAllowPromotingToCurves: determine if promotion to curve type must be done.
Returns
the merged geometry type.
GDAL.ogropen
— MethodOGROpen(const char *,
int,
OGRSFDriverH *) -> OGRDataSourceH
Open a file / data source with one of the registered drivers.
Parameters
- pszName: the name of the file, or data source to open.
- bUpdate: FALSE for read-only access (the default) or TRUE for read-write access.
- pahDriverList: if non-NULL, this argument will be updated with a pointer to the driver which was used to open the data source.
Returns
NULL on error or if the pass name is not supported by this driver, otherwise a handle to a GDALDataset. This GDALDataset should be closed by deleting the object when it is no longer needed.
GDAL.ogropenshared
— MethodOGROpenShared(const char *,
int,
OGRSFDriverH *) -> OGRDataSourceH
Open a file / data source with one of the registered drivers if not already opened, or increment reference count of already opened data source previously opened with OGROpenShared()
Parameters
- pszName: the name of the file, or data source to open.
- bUpdate: FALSE for read-only access (the default) or TRUE for read-write access.
- pahDriverList: if non-NULL, this argument will be updated with a pointer to the driver which was used to open the data source.
Returns
NULL on error or if the pass name is not supported by this driver, otherwise a handle to a GDALDataset. This GDALDataset should be closed by deleting the object when it is no longer needed.
GDAL.ogrparsedate
— MethodOGRParseDate(const char * pszInput,
OGRField * psField,
int nOptions) -> int
Parse date string.
Parameters
- pszInput: the input date string.
- psField: the OGRField that will be updated with the parsed result.
- nOptions: parsing options. 0 or OGRPARSEDATEOPTIONLAX
Returns
TRUE if apparently successful or FALSE on failure.
GDAL.ogrpreparedgeometrycontains
— MethodOGRPreparedGeometryContains(const OGRPreparedGeometryH hPreparedGeom,
const OGRGeometryH hOtherGeom) -> int
Returns whether a prepared geometry contains a geometry.
Parameters
- hPreparedGeom: prepared geometry.
- hOtherGeom: other geometry.
Returns
TRUE or FALSE.
GDAL.ogrpreparedgeometryintersects
— MethodOGRPreparedGeometryIntersects(const OGRPreparedGeometryH hPreparedGeom,
const OGRGeometryH hOtherGeom) -> int
Returns whether a prepared geometry intersects with a geometry.
Parameters
- hPreparedGeom: prepared geometry.
- hOtherGeom: other geometry.
Returns
TRUE or FALSE.
GDAL.ogrrealloc
— MethodOGRRealloc(void * pOld,
size_t size) -> void *
GDAL.ogrregisterall
— Methodogrregisterall()
GDAL.ogrregisterdriver
— Methodogrregisterdriver(arg1)
Doxygen_Suppress
GDAL.ogrreleasedatasource
— MethodOGRReleaseDataSource(OGRDataSourceH) -> OGRErr
Drop a reference to this datasource, and if the reference count drops to zero close (destroy) the datasource.
Parameters
- hDS: handle to the data source to release
Returns
OGRERR_NONE on success or an error code.
GDAL.ogrsetgenerate_db2_v72_byte_order
— Methodogrsetgenerate_db2_v72_byte_order(bGenerate_DB2_V72_BYTE_ORDER)
Doxygen_Suppress
GDAL.ogrsetnonlineargeometriesenabledflag
— Methodogrsetnonlineargeometriesenabledflag(bFlag)
GDAL.ogrwkbexportoptionscreate
— MethodOGRwkbExportOptionsCreate() -> OGRwkbExportOptions *
Create geometry WKB export options.
Returns
object to be freed with OGRwkbExportOptionsDestroy().
GDAL.ogrwkbexportoptionsdestroy
— MethodOGRwkbExportOptionsDestroy(OGRwkbExportOptions * psOptions) -> void
Destroy object returned by OGRwkbExportOptionsCreate()
Parameters
- psOptions: WKB export options
GDAL.ogrwkbexportoptionssetbyteorder
— MethodOGRwkbExportOptionsSetByteOrder(OGRwkbExportOptions * psOptions,
OGRwkbByteOrder eByteOrder) -> void
Set the WKB byte order.
Parameters
- psOptions: WKB export options
- eByteOrder: Byte order: wkbXDR (big-endian) or wkbNDR (little-endian, Intel)
GDAL.ogrwkbexportoptionssetprecision
— MethodOGRwkbExportOptionsSetPrecision(OGRwkbExportOptions * psOptions,
OGRGeomCoordinatePrecisionH hPrecisionOptions) -> void
Set precision options.
Parameters
- psOptions: WKB export options
- hPrecisionOptions: Precision options (might be null to reset them)
GDAL.ogrwkbexportoptionssetvariant
— MethodOGRwkbExportOptionsSetVariant(OGRwkbExportOptions * psOptions,
OGRwkbVariant eWkbVariant) -> void
Set the WKB variant.
Parameters
- psOptions: WKB export options
- eWkbVariant: variant: wkbVariantOldOgc, wkbVariantIso, wkbVariantPostGIS1
GDAL.osraddguessedtowgs84
— MethodOSRAddGuessedTOWGS84(OGRSpatialReferenceH hSRS) -> OGRErr
Try to add a a 3-parameter or 7-parameter Helmert transformation to WGS84.
GDAL.osrautoidentifyepsg
— MethodOSRAutoIdentifyEPSG(OGRSpatialReferenceH hSRS) -> OGRErr
Set EPSG authority info if possible.
GDAL.osraxisenumtoname
— MethodOSRAxisEnumToName(OGRAxisOrientation eOrientation) -> const char *
Return the string representation for the OGRAxisOrientation enumeration.
Returns
an internal string
GDAL.osrcalcinvflattening
— MethodOSRCalcInvFlattening(double dfSemiMajor,
double dfSemiMinor) -> double
Compute inverse flattening from semi-major and semi-minor axis.
Parameters
- dfSemiMajor: Semi-major axis length.
- dfSemiMinor: Semi-minor axis length.
Returns
inverse flattening, or 0 if both axis are equal.
GDAL.osrcalcsemiminorfrominvflattening
— MethodOSRCalcSemiMinorFromInvFlattening(double dfSemiMajor,
double dfInvFlattening) -> double
Compute semi-minor axis from semi-major axis and inverse flattening.
Parameters
- dfSemiMajor: Semi-major axis length.
- dfInvFlattening: Inverse flattening or 0 for sphere.
Returns
semi-minor axis
GDAL.osrcleanup
— MethodOSRCleanup(void) -> void
Cleanup cached SRS related memory.
GDAL.osrclone
— MethodOSRClone(OGRSpatialReferenceH hSRS) -> OGRSpatialReferenceH
Make a duplicate of this OGRSpatialReference.
GDAL.osrclonegeogcs
— MethodOSRCloneGeogCS(OGRSpatialReferenceH hSource) -> OGRSpatialReferenceH
Make a duplicate of the GEOGCS node of this OGRSpatialReference object.
GDAL.osrconverttootherprojection
— MethodOSRConvertToOtherProjection(OGRSpatialReferenceH hSRS,
const char * pszTargetProjection,
const char *const * papszOptions) -> OGRSpatialReferenceH
Convert to another equivalent projection.
Parameters
- hSRS: source SRS
- pszTargetProjection: target projection.
- papszOptions: lists of options. None supported currently.
Returns
a new SRS, or NULL in case of error.
GDAL.osrcopygeogcsfrom
— MethodOSRCopyGeogCSFrom(OGRSpatialReferenceH hSRS,
const OGRSpatialReferenceH hSrcSRS) -> OGRErr
Copy GEOGCS from another OGRSpatialReference.
GDAL.osrdemoteto2d
— MethodOSRDemoteTo2D(OGRSpatialReferenceH hSRS,
const char * pszName) -> OGRErr
"Demote" a 3D CRS to a 2D CRS one.
GDAL.osrdereference
— MethodOSRDereference(OGRSpatialReferenceH hSRS) -> int
Decrements the reference count by one.
GDAL.osrdestroycrsinfolist
— MethodOSRDestroyCRSInfoList(OSRCRSInfo ** list) -> void
Destroy the result returned by OSRGetCRSInfoListFromDatabase().
GDAL.osrdestroyspatialreference
— MethodOSRDestroySpatialReference(OGRSpatialReferenceH hSRS) -> void
OGRSpatialReference destructor.
Parameters
- hSRS: the object to delete
GDAL.osrepsgtreatsaslatlong
— MethodOSREPSGTreatsAsLatLong(OGRSpatialReferenceH hSRS) -> int
This function returns TRUE if EPSG feels this geographic coordinate system should be treated as having lat/long coordinate ordering.
GDAL.osrepsgtreatsasnorthingeasting
— MethodOSREPSGTreatsAsNorthingEasting(OGRSpatialReferenceH hSRS) -> int
This function returns TRUE if EPSG feels this projected coordinate system should be treated as having northing/easting coordinate ordering.
GDAL.osrexporttocf1
— MethodOSRExportToCF1(OGRSpatialReferenceH hSRS,
char ** ppszGridMappingName,
char *** ppapszKeyValues,
char ** ppszUnits,
CSLConstList papszOptions) -> OGRErr
Export a CRS to netCDF CF-1 definitions.
GDAL.osrexporttoerm
— MethodOSRExportToERM(OGRSpatialReferenceH hSRS,
char * pszProj,
char * pszDatum,
char * pszUnits) -> OGRErr
Convert coordinate system to ERMapper format.
GDAL.osrexporttomicoordsys
— MethodOSRExportToMICoordSys(OGRSpatialReferenceH hSRS,
char ** ppszReturn) -> OGRErr
Export coordinate system in Mapinfo style CoordSys format.
GDAL.osrexporttopanorama
— MethodOSRExportToPanorama(OGRSpatialReferenceH hSRS,
long * piProjSys,
long * piDatum,
long * piEllips,
long * piZone,
double * padfPrjParams) -> OGRErr
Export coordinate system in "Panorama" GIS projection definition.
GDAL.osrexporttopci
— MethodOSRExportToPCI(OGRSpatialReferenceH hSRS,
char ** ppszProj,
char ** ppszUnits,
double ** ppadfPrjParams) -> OGRErr
Export coordinate system in PCI projection definition.
GDAL.osrexporttoprettywkt
— MethodOSRExportToPrettyWkt(OGRSpatialReferenceH hSRS,
char ** ppszReturn,
int bSimplify) -> OGRErr
Convert this SRS into a nicely formatted WKT 1 string for display to a person.
GDAL.osrexporttoproj4
— MethodOSRExportToProj4(OGRSpatialReferenceH hSRS,
char ** ppszReturn) -> OGRErr
Export coordinate system in PROJ.4 legacy format.
GDAL.osrexporttoprojjson
— MethodOSRExportToPROJJSON(OGRSpatialReferenceH hSRS,
char ** ppszReturn,
const char *const * papszOptions) -> OGRErr
Convert this SRS into PROJJSON format.
GDAL.osrexporttousgs
— MethodOSRExportToUSGS(OGRSpatialReferenceH hSRS,
long * piProjSys,
long * piZone,
double ** ppadfPrjParams,
long * piDatum) -> OGRErr
Export coordinate system in USGS GCTP projection definition.
GDAL.osrexporttowkt
— MethodOSRExportToWkt(OGRSpatialReferenceH hSRS,
char ** ppszReturn) -> OGRErr
Convert this SRS into WKT 1 format.
GDAL.osrexporttowktex
— MethodOSRExportToWktEx(OGRSpatialReferenceH hSRS,
char ** ppszReturn,
const char *const * papszOptions) -> OGRErr
Convert this SRS into WKT format.
GDAL.osrexporttoxml
— MethodOSRExportToXML(OGRSpatialReferenceH hSRS,
char ** ppszRawXML,
const char * pszDialect) -> OGRErr
Export coordinate system in XML format.
GDAL.osrfindmatches
— MethodOSRFindMatches(OGRSpatialReferenceH hSRS,
char ** papszOptions,
int * pnEntries,
int ** ppanMatchConfidence) -> OGRSpatialReferenceH *
Try to identify a match between the passed SRS and a related SRS in a catalog.
Parameters
- hSRS: SRS to match
- papszOptions: NULL terminated list of options or NULL
- pnEntries: Output parameter. Number of values in the returned array.
- ppanMatchConfidence: Output parameter (or NULL). *ppanMatchConfidence will be allocated to an array of *pnEntries whose values between 0 and 100 indicate the confidence in the match. 100 is the highest confidence level. The array must be freed with CPLFree().
Returns
an array of SRS that match the passed SRS, or NULL. Must be freed with OSRFreeSRSArray()
GDAL.osrfreesrsarray
— MethodOSRFreeSRSArray(OGRSpatialReferenceH * pahSRS) -> void
Free return of OSRIdentifyMatches()
Parameters
- pahSRS: array of SRS (must be NULL terminated)
GDAL.osrgetangularunits
— MethodOSRGetAngularUnits(OGRSpatialReferenceH hSRS,
char ** ppszName) -> double
Fetch angular geographic coordinate system units.
GDAL.osrgetareaofuse
— MethodOSRGetAreaOfUse(OGRSpatialReferenceH hSRS,
double * pdfWestLongitudeDeg,
double * pdfSouthLatitudeDeg,
double * pdfEastLongitudeDeg,
double * pdfNorthLatitudeDeg,
const char ** ppszAreaName) -> int
Return the area of use of the CRS.
GDAL.osrgetattrvalue
— MethodOSRGetAttrValue(OGRSpatialReferenceH hSRS,
const char * pszKey,
int iChild) -> const char *
Fetch indicated attribute of named node.
GDAL.osrgetauthoritycode
— MethodOSRGetAuthorityCode(OGRSpatialReferenceH hSRS,
const char * pszTargetKey) -> const char *
Get the authority code for a node.
GDAL.osrgetauthorityname
— MethodOSRGetAuthorityName(OGRSpatialReferenceH hSRS,
const char * pszTargetKey) -> const char *
Get the authority name for a node.
GDAL.osrgetaxescount
— MethodOSRGetAxesCount(OGRSpatialReferenceH hSRS) -> int
Return the number of axis of the coordinate system of the CRS.
GDAL.osrgetaxis
— MethodOSRGetAxis(OGRSpatialReferenceH hSRS,
const char * pszTargetKey,
int iAxis,
OGRAxisOrientation * peOrientation) -> const char *
Fetch the orientation of one axis.
GDAL.osrgetaxismappingstrategy
— MethodOSRGetAxisMappingStrategy(OGRSpatialReferenceH hSRS) -> OSRAxisMappingStrategy
Return the data axis to CRS axis mapping strategy.
GDAL.osrgetcoordinateepoch
— MethodOSRGetCoordinateEpoch(OGRSpatialReferenceH hSRS) -> double
Get the coordinate epoch, as decimal year.
GDAL.osrgetcrsinfolistfromdatabase
— MethodOSRGetCRSInfoListFromDatabase(const char * pszAuthName,
const OSRCRSListParameters * params,
int * pnOutResultCount) -> OSRCRSInfo **
Enumerate CRS objects from the database.
Parameters
- pszAuthName: Authority name, used to restrict the search. Or NULL for all authorities.
- params: Additional criteria. Must be set to NULL for now.
- pnOutResultCount: Output parameter pointing to an integer to receive the size of the result list. Might be NULL
Returns
an array of OSRCRSInfo* pointers to be freed with OSRDestroyCRSInfoList(), or NULL in case of error.
GDAL.osrgetdataaxistosrsaxismapping
— MethodOSRGetDataAxisToSRSAxisMapping(OGRSpatialReferenceH hSRS,
int * pnCount) -> const int *
Return the data axis to SRS axis mapping.
GDAL.osrgetinvflattening
— MethodOSRGetInvFlattening(OGRSpatialReferenceH hSRS,
OGRErr * pnErr) -> double
Get spheroid inverse flattening.
GDAL.osrgetlinearunits
— MethodOSRGetLinearUnits(OGRSpatialReferenceH hSRS,
char ** ppszName) -> double
Fetch linear projection units.
GDAL.osrgetname
— MethodOSRGetName(OGRSpatialReferenceH hSRS) -> const char *
Return the CRS name.
GDAL.osrgetnormprojparm
— MethodOSRGetNormProjParm(OGRSpatialReferenceH hSRS,
const char * pszName,
double dfDefaultValue,
OGRErr * pnErr) -> double
This function is the same as OGRSpatialReference::
GDAL.osrgetprimemeridian
— MethodOSRGetPrimeMeridian(OGRSpatialReferenceH hSRS,
char ** ppszName) -> double
Fetch prime meridian info.
GDAL.osrgetprojauxdbpaths
— MethodOSRGetPROJAuxDbPaths(void) -> char **
Get PROJ auxiliary database filenames.
Returns
NULL terminated list of PROJ auxiliary database filenames. To be freed with CSLDestroy()
GDAL.osrgetprojenablenetwork
— MethodOSRGetPROJEnableNetwork(void) -> int
Get whether PROJ networking capabilities are enabled.
Returns
TRUE if PROJ networking capabilities are enabled.
GDAL.osrgetprojparm
— MethodOSRGetProjParm(OGRSpatialReferenceH hSRS,
const char * pszName,
double dfDefaultValue,
OGRErr * pnErr) -> double
Fetch a projection parameter value.
GDAL.osrgetprojsearchpaths
— MethodOSRGetPROJSearchPaths() -> char **
Get the search path(s) for PROJ resource files.
Returns
NULL terminated list of directory paths. To be freed with CSLDestroy()
GDAL.osrgetprojversion
— MethodOSRGetPROJVersion(int * pnMajor,
int * pnMinor,
int * pnPatch) -> void
Get the PROJ version.
Parameters
- pnMajor: Pointer to major version number, or NULL
- pnMinor: Pointer to minor version number, or NULL
- pnPatch: Pointer to patch version number, or NULL
GDAL.osrgetsemimajor
— MethodOSRGetSemiMajor(OGRSpatialReferenceH hSRS,
OGRErr * pnErr) -> double
Get spheroid semi major axis.
GDAL.osrgetsemiminor
— MethodOSRGetSemiMinor(OGRSpatialReferenceH hSRS,
OGRErr * pnErr) -> double
Get spheroid semi minor axis.
GDAL.osrgettargetlinearunits
— MethodOSRGetTargetLinearUnits(OGRSpatialReferenceH hSRS,
const char * pszTargetKey,
char ** ppszName) -> double
Fetch linear projection units.
GDAL.osrgettowgs84
— MethodOSRGetTOWGS84(OGRSpatialReferenceH hSRS,
double * padfCoeff,
int nCoeffCount) -> OGRErr
Fetch TOWGS84 parameters, if available.
GDAL.osrgetutmzone
— MethodOSRGetUTMZone(OGRSpatialReferenceH hSRS,
int * pbNorth) -> int
Get utm zone information.
GDAL.osrhaspointmotionoperation
— MethodOSRHasPointMotionOperation(OGRSpatialReferenceH hSRS) -> int
Check if a CRS has at least an associated point motion operation.
GDAL.osrimportfromcf1
— MethodOSRImportFromCF1(OGRSpatialReferenceH hSRS,
CSLConstList papszKeyValues,
const char * pszUnits) -> OGRErr
Import a CRS from netCDF CF-1 definitions.
GDAL.osrimportfromdict
— MethodOSRImportFromDict(OGRSpatialReferenceH hSRS,
const char * pszDictFile,
const char * pszCode) -> OGRErr
Read SRS from WKT dictionary.
Parameters
- hSRS: spatial reference system handle.
- pszDictFile: the name of the dictionary file to load.
- pszCode: the code to lookup in the dictionary.
Returns
OGRERRNONE on success, or OGRERRSRSUNSUPPORTED if the code isn't found, and OGRERRSRS_FAILURE if something more dramatic goes wrong.
GDAL.osrimportfromepsg
— MethodOSRImportFromEPSG(OGRSpatialReferenceH hSRS,
int nCode) -> OGRErr
Initialize SRS based on EPSG geographic, projected or vertical CRS code.
GDAL.osrimportfromepsga
— MethodOSRImportFromEPSGA(OGRSpatialReferenceH hSRS,
int nCode) -> OGRErr
Initialize SRS based on EPSG geographic, projected or vertical CRS code.
GDAL.osrimportfromerm
— MethodOSRImportFromERM(OGRSpatialReferenceH hSRS,
const char * pszProj,
const char * pszDatum,
const char * pszUnits) -> OGRErr
Create OGR WKT from ERMapper projection definitions.
GDAL.osrimportfromesri
— MethodOSRImportFromESRI(OGRSpatialReferenceH hSRS,
char ** papszPrj) -> OGRErr
Import coordinate system from ESRI .prj format(s).
GDAL.osrimportfrommicoordsys
— MethodOSRImportFromMICoordSys(OGRSpatialReferenceH hSRS,
const char * pszCoordSys) -> OGRErr
Import Mapinfo style CoordSys definition.
GDAL.osrimportfromozi
— MethodOSRImportFromOzi(OGRSpatialReferenceH hSRS,
const char *const * papszLines) -> OGRErr
Import coordinate system from OziExplorer projection definition.
Parameters
- hSRS: spatial reference object.
- papszLines: Map file lines. This is an array of strings containing the whole OziExplorer .MAP file. The array is terminated by a NULL pointer.
Returns
OGRERR_NONE on success or an error code in case of failure.
GDAL.osrimportfrompanorama
— MethodOSRImportFromPanorama(OGRSpatialReferenceH hSRS,
long iProjSys,
long iDatum,
long iEllips,
double * padfPrjParams) -> OGRErr
Import coordinate system from "Panorama" GIS projection definition.
GDAL.osrimportfrompci
— MethodOSRImportFromPCI(OGRSpatialReferenceH hSRS,
const char * pszProj,
const char * pszUnits,
double * padfPrjParams) -> OGRErr
Import coordinate system from PCI projection definition.
GDAL.osrimportfromproj4
— MethodOSRImportFromProj4(OGRSpatialReferenceH hSRS,
const char * pszProj4) -> OGRErr
Import PROJ coordinate string.
GDAL.osrimportfromurl
— MethodOSRImportFromUrl(OGRSpatialReferenceH hSRS,
const char * pszUrl) -> OGRErr
Set spatial reference from a URL.
GDAL.osrimportfromusgs
— MethodOSRImportFromUSGS(OGRSpatialReferenceH hSRS,
long iProjsys,
long iZone,
double * padfPrjParams,
long iDatum) -> OGRErr
Import coordinate system from USGS projection definition.
GDAL.osrimportfromwkt
— MethodOSRImportFromWkt(OGRSpatialReferenceH hSRS,
char ** ppszInput) -> OGRErr
Import from WKT string.
GDAL.osrimportfromxml
— MethodOSRImportFromXML(OGRSpatialReferenceH hSRS,
const char * pszXML) -> OGRErr
Import coordinate system from XML format (GML only currently).
GDAL.osriscompound
— MethodOSRIsCompound(OGRSpatialReferenceH hSRS) -> int
Check if the coordinate system is compound.
GDAL.osrisderivedgeographic
— MethodOSRIsDerivedGeographic(OGRSpatialReferenceH hSRS) -> int
Check if the CRS is a derived geographic coordinate system.
GDAL.osrisderivedprojected
— MethodOSRIsDerivedProjected(OGRSpatialReferenceH hSRS) -> int
Check if the CRS is a derived projected coordinate system.
GDAL.osrisdynamic
— MethodOSRIsDynamic(OGRSpatialReferenceH hSRS) -> int
Check if a CRS is a dynamic CRS.
GDAL.osrisgeocentric
— MethodOSRIsGeocentric(OGRSpatialReferenceH hSRS) -> int
Check if geocentric coordinate system.
GDAL.osrisgeographic
— MethodOSRIsGeographic(OGRSpatialReferenceH hSRS) -> int
Check if geographic coordinate system.
GDAL.osrislocal
— MethodOSRIsLocal(OGRSpatialReferenceH hSRS) -> int
Check if local coordinate system.
GDAL.osrisprojected
— MethodOSRIsProjected(OGRSpatialReferenceH hSRS) -> int
Check if projected coordinate system.
GDAL.osrissame
— MethodOSRIsSame(OGRSpatialReferenceH hSRS1,
OGRSpatialReferenceH hSRS2) -> int
Do these two spatial references describe the same system ?
GDAL.osrissameex
— MethodOSRIsSameEx(OGRSpatialReferenceH hSRS1,
OGRSpatialReferenceH hSRS2,
const char *const * papszOptions) -> int
Do these two spatial references describe the same system ?
GDAL.osrissamegeogcs
— MethodOSRIsSameGeogCS(OGRSpatialReferenceH hSRS1,
OGRSpatialReferenceH hSRS2) -> int
Do the GeogCS'es match?
GDAL.osrissamevertcs
— MethodOSRIsSameVertCS(OGRSpatialReferenceH hSRS1,
OGRSpatialReferenceH hSRS2) -> int
Do the VertCS'es match?
GDAL.osrisvertical
— MethodOSRIsVertical(OGRSpatialReferenceH hSRS) -> int
Check if vertical coordinate system.
GDAL.osrmorphfromesri
— MethodOSRMorphFromESRI(OGRSpatialReferenceH hSRS) -> OGRErr
Convert in place from ESRI WKT format.
GDAL.osrmorphtoesri
— MethodOSRMorphToESRI(OGRSpatialReferenceH hSRS) -> OGRErr
Convert in place to ESRI WKT format.
GDAL.osrnewspatialreference
— MethodOSRNewSpatialReference(const char * pszWKT) -> OGRSpatialReferenceH
Constructor.
GDAL.osrpromoteto3d
— MethodOSRPromoteTo3D(OGRSpatialReferenceH hSRS,
const char * pszName) -> OGRErr
"Promotes" a 2D CRS to a 3D CRS one.
GDAL.osrreference
— MethodOSRReference(OGRSpatialReferenceH hSRS) -> int
Increments the reference count by one.
GDAL.osrrelease
— MethodOSRRelease(OGRSpatialReferenceH hSRS) -> void
Decrements the reference count by one, and destroy if zero.
GDAL.osrsetacea
— Methodosrsetacea(hSRS, dfStdP1, dfStdP2, dfCenterLat, dfCenterLong, dfFalseEasting, dfFalseNorthing)
Albers Conic Equal Area
GDAL.osrsetae
— Methodosrsetae(hSRS, dfCenterLat, dfCenterLong, dfFalseEasting, dfFalseNorthing)
Azimuthal Equidistant
GDAL.osrsetangularunits
— MethodOSRSetAngularUnits(OGRSpatialReferenceH hSRS,
const char * pszUnits,
double dfInRadians) -> OGRErr
Set the angular units for the geographic coordinate system.
GDAL.osrsetattrvalue
— MethodOSRSetAttrValue(OGRSpatialReferenceH hSRS,
const char * pszPath,
const char * pszValue) -> OGRErr
Set attribute value in spatial reference.
GDAL.osrsetauthority
— MethodOSRSetAuthority(OGRSpatialReferenceH hSRS,
const char * pszTargetKey,
const char * pszAuthority,
int nCode) -> OGRErr
Set the authority for a node.
GDAL.osrsetaxes
— MethodOSRSetAxes(OGRSpatialReferenceH hSRS,
const char * pszTargetKey,
const char * pszXAxisName,
OGRAxisOrientation eXAxisOrientation,
const char * pszYAxisName,
OGRAxisOrientation eYAxisOrientation) -> OGRErr
Set the axes for a coordinate system.
GDAL.osrsetaxismappingstrategy
— MethodOSRSetAxisMappingStrategy(OGRSpatialReferenceH hSRS,
OSRAxisMappingStrategy strategy) -> void
Set the data axis to CRS axis mapping strategy.
GDAL.osrsetbonne
— Methodosrsetbonne(hSRS, dfStandardParallel, dfCentralMeridian, dfFalseEasting, dfFalseNorthing)
Bonne
GDAL.osrsetcea
— Methodosrsetcea(hSRS, dfStdP1, dfCentralMeridian, dfFalseEasting, dfFalseNorthing)
Cylindrical Equal Area
GDAL.osrsetcompoundcs
— MethodOSRSetCompoundCS(OGRSpatialReferenceH hSRS,
const char * pszName,
OGRSpatialReferenceH hHorizSRS,
OGRSpatialReferenceH hVertSRS) -> OGRErr
Setup a compound coordinate system.
GDAL.osrsetcoordinateepoch
— MethodOSRSetCoordinateEpoch(OGRSpatialReferenceH hSRS,
double dfCoordinateEpoch) -> void
Set the coordinate epoch, as decimal year.
GDAL.osrsetcs
— Methodosrsetcs(hSRS, dfCenterLat, dfCenterLong, dfFalseEasting, dfFalseNorthing)
Cassini-Soldner
GDAL.osrsetdataaxistosrsaxismapping
— MethodOSRSetDataAxisToSRSAxisMapping(OGRSpatialReferenceH hSRS,
int nMappingSize,
const int * panMapping) -> OGRErr
Set a custom data axis to CRS axis mapping.
GDAL.osrsetec
— Methodosrsetec(hSRS, dfStdP1, dfStdP2, dfCenterLat, dfCenterLong, dfFalseEasting, dfFalseNorthing)
Equidistant Conic
GDAL.osrseteckert
— Methodosrseteckert(hSRS, nVariation, dfCentralMeridian, dfFalseEasting, dfFalseNorthing)
Eckert I-VI
GDAL.osrseteckertiv
— Methodosrseteckertiv(hSRS, dfCentralMeridian, dfFalseEasting, dfFalseNorthing)
Eckert IV
GDAL.osrseteckertvi
— Methodosrseteckertvi(hSRS, dfCentralMeridian, dfFalseEasting, dfFalseNorthing)
Eckert VI
GDAL.osrsetequirectangular
— Methodosrsetequirectangular(hSRS, dfCenterLat, dfCenterLong, dfFalseEasting, dfFalseNorthing)
Equirectangular
GDAL.osrsetequirectangular2
— Methodosrsetequirectangular2(hSRS, dfCenterLat, dfCenterLong, dfPseudoStdParallel1, dfFalseEasting, dfFalseNorthing)
Equirectangular generalized form
GDAL.osrsetfromuserinput
— MethodOSRSetFromUserInput(OGRSpatialReferenceH hSRS,
const char * pszDef) -> OGRErr
Set spatial reference from various text formats.
GDAL.osrsetfromuserinputex
— MethodOSRSetFromUserInputEx(OGRSpatialReferenceH hSRS,
const char * pszDef,
CSLConstList papszOptions) -> OGRErr
Set spatial reference from various text formats.
GDAL.osrsetgaussschreibertmercator
— Methodosrsetgaussschreibertmercator(hSRS, dfCenterLat, dfCenterLong, dfScale, dfFalseEasting, dfFalseNorthing)
Gauss Schreiber Transverse Mercator
GDAL.osrsetgeoccs
— MethodOSRSetGeocCS(OGRSpatialReferenceH hSRS,
const char * pszName) -> OGRErr
Set the user visible PROJCS name.
GDAL.osrsetgeogcs
— MethodOSRSetGeogCS(OGRSpatialReferenceH hSRS,
const char * pszGeogName,
const char * pszDatumName,
const char * pszSpheroidName,
double dfSemiMajor,
double dfInvFlattening,
const char * pszPMName,
double dfPMOffset,
const char * pszAngularUnits,
double dfConvertToRadians) -> OGRErr
Set geographic coordinate system.
GDAL.osrsetgeos
— Methodosrsetgeos(hSRS, dfCentralMeridian, dfSatelliteHeight, dfFalseEasting, dfFalseNorthing)
GEOS - Geostationary Satellite View
GDAL.osrsetgh
— Methodosrsetgh(hSRS, dfCentralMeridian, dfFalseEasting, dfFalseNorthing)
Goode Homolosine
GDAL.osrsetgnomonic
— Methodosrsetgnomonic(hSRS, dfCenterLat, dfCenterLong, dfFalseEasting, dfFalseNorthing)
Gnomonic
GDAL.osrsetgs
— Methodosrsetgs(hSRS, dfCentralMeridian, dfFalseEasting, dfFalseNorthing)
Gall Stereograpic
GDAL.osrsethom
— Methodosrsethom(hSRS, dfCenterLat, dfCenterLong, dfAzimuth, dfRectToSkew, dfScale, dfFalseEasting, dfFalseNorthing)
Hotine Oblique Mercator using azimuth angle
GDAL.osrsethom2pno
— Methodosrsethom2pno(hSRS, dfCenterLat, dfLat1, dfLong1, dfLat2, dfLong2, dfScale, dfFalseEasting, dfFalseNorthing)
Hotine Oblique Mercator using two points on centerline
GDAL.osrsethomac
— MethodOSRSetHOMAC(OGRSpatialReferenceH hSRS,
double dfCenterLat,
double dfCenterLong,
double dfAzimuth,
double dfRectToSkew,
double dfScale,
double dfFalseEasting,
double dfFalseNorthing) -> OGRErr
Set an Oblique Mercator projection using azimuth angle.
GDAL.osrsetigh
— Methodosrsetigh(hSRS)
Interrupted Goode Homolosine
GDAL.osrsetiwmpolyconic
— Methodosrsetiwmpolyconic(hSRS, dfLat1, dfLat2, dfCenterLong, dfFalseEasting, dfFalseNorthing)
International Map of the World Polyconic
GDAL.osrsetkrovak
— Methodosrsetkrovak(hSRS, dfCenterLat, dfCenterLong, dfAzimuth, dfPseudoStdParallelLat, dfScale, dfFalseEasting, dfFalseNorthing)
Krovak Oblique Conic Conformal
GDAL.osrsetlaea
— Methodosrsetlaea(hSRS, dfCenterLat, dfCenterLong, dfFalseEasting, dfFalseNorthing)
Lambert Azimuthal Equal-Area
GDAL.osrsetlcc
— Methodosrsetlcc(hSRS, dfStdP1, dfStdP2, dfCenterLat, dfCenterLong, dfFalseEasting, dfFalseNorthing)
Lambert Conformal Conic
GDAL.osrsetlcc1sp
— Methodosrsetlcc1sp(hSRS, dfCenterLat, dfCenterLong, dfScale, dfFalseEasting, dfFalseNorthing)
Lambert Conformal Conic 1SP
GDAL.osrsetlccb
— Methodosrsetlccb(hSRS, dfStdP1, dfStdP2, dfCenterLat, dfCenterLong, dfFalseEasting, dfFalseNorthing)
Lambert Conformal Conic (Belgium)
GDAL.osrsetlinearunits
— MethodOSRSetLinearUnits(OGRSpatialReferenceH hSRS,
const char * pszUnits,
double dfInMeters) -> OGRErr
Set the linear units for the projection.
GDAL.osrsetlinearunitsandupdateparameters
— MethodOSRSetLinearUnitsAndUpdateParameters(OGRSpatialReferenceH hSRS,
const char * pszUnits,
double dfInMeters) -> OGRErr
Set the linear units for the projection.
GDAL.osrsetlocalcs
— MethodOSRSetLocalCS(OGRSpatialReferenceH hSRS,
const char * pszName) -> OGRErr
Set the user visible LOCAL_CS name.
GDAL.osrsetmc
— Methodosrsetmc(hSRS, dfCenterLat, dfCenterLong, dfFalseEasting, dfFalseNorthing)
Miller Cylindrical
GDAL.osrsetmercator
— Methodosrsetmercator(hSRS, dfCenterLat, dfCenterLong, dfScale, dfFalseEasting, dfFalseNorthing)
Mercator
GDAL.osrsetmercator2sp
— Methodosrsetmercator2sp(hSRS, dfStdP1, dfCenterLat, dfCenterLong, dfFalseEasting, dfFalseNorthing)
Mercator 2SP
GDAL.osrsetmollweide
— Methodosrsetmollweide(hSRS, dfCentralMeridian, dfFalseEasting, dfFalseNorthing)
Mollweide
GDAL.osrsetnormprojparm
— MethodOSRSetNormProjParm(OGRSpatialReferenceH hSRS,
const char * pszParamName,
double dfValue) -> OGRErr
Set a projection parameter with a normalized value.
GDAL.osrsetnzmg
— Methodosrsetnzmg(hSRS, dfCenterLat, dfCenterLong, dfFalseEasting, dfFalseNorthing)
New Zealand Map Grid
GDAL.osrsetorthographic
— Methodosrsetorthographic(hSRS, dfCenterLat, dfCenterLong, dfFalseEasting, dfFalseNorthing)
Orthographic
GDAL.osrsetos
— Methodosrsetos(hSRS, dfOriginLat, dfCMeridian, dfScale, dfFalseEasting, dfFalseNorthing)
Oblique Stereographic
GDAL.osrsetpolyconic
— Methodosrsetpolyconic(hSRS, dfCenterLat, dfCenterLong, dfFalseEasting, dfFalseNorthing)
Polyconic
GDAL.osrsetprojauxdbpaths
— MethodOSRSetPROJAuxDbPaths(const char *const * papszAux) -> void
Set list of PROJ auxiliary database filenames.
Parameters
- papszAux: NULL-terminated list of auxiliary database filenames, or NULL
GDAL.osrsetprojcs
— MethodOSRSetProjCS(OGRSpatialReferenceH hSRS,
const char * pszName) -> OGRErr
Set the user visible PROJCS name.
GDAL.osrsetprojection
— MethodOSRSetProjection(OGRSpatialReferenceH hSRS,
const char * pszProjection) -> OGRErr
Set a projection name.
GDAL.osrsetprojenablenetwork
— MethodOSRSetPROJEnableNetwork(int enabled) -> void
Enable or disable PROJ networking capabilities.
Parameters
- enabled: Set to TRUE to enable networking capabilities.
GDAL.osrsetprojparm
— MethodOSRSetProjParm(OGRSpatialReferenceH hSRS,
const char * pszParamName,
double dfValue) -> OGRErr
Set a projection parameter value.
GDAL.osrsetprojsearchpaths
— MethodOSRSetPROJSearchPaths(const char *const * papszPaths) -> void
Set the search path(s) for PROJ resource files.
Parameters
- papszPaths: NULL terminated list of directory paths.
GDAL.osrsetps
— Methodosrsetps(hSRS, dfCenterLat, dfCenterLong, dfScale, dfFalseEasting, dfFalseNorthing)
Polar Stereographic
GDAL.osrsetqsc
— Methodosrsetqsc(hSRS, dfCenterLat, dfCenterLong)
Quadrilateralized Spherical Cube
GDAL.osrsetrobinson
— Methodosrsetrobinson(hSRS, dfCenterLong, dfFalseEasting, dfFalseNorthing)
Robinson
GDAL.osrsetsch
— Methodosrsetsch(hSRS, dfPegLat, dfPegLong, dfPegHeading, dfPegHgt)
Spherical, Cross-track, Height
GDAL.osrsetsinusoidal
— Methodosrsetsinusoidal(hSRS, dfCenterLong, dfFalseEasting, dfFalseNorthing)
Sinusoidal
GDAL.osrsetsoc
— Methodosrsetsoc(hSRS, dfLatitudeOfOrigin, dfCentralMeridian, dfFalseEasting, dfFalseNorthing)
Swiss Oblique Cylindrical
GDAL.osrsetstateplane
— MethodOSRSetStatePlane(OGRSpatialReferenceH hSRS,
int nZone,
int bNAD83) -> OGRErr
Set State Plane projection definition.
GDAL.osrsetstateplanewithunits
— MethodOSRSetStatePlaneWithUnits(OGRSpatialReferenceH hSRS,
int nZone,
int bNAD83,
const char * pszOverrideUnitName,
double dfOverrideUnit) -> OGRErr
Set State Plane projection definition.
GDAL.osrsetstereographic
— Methodosrsetstereographic(hSRS, dfCenterLat, dfCenterLong, dfScale, dfFalseEasting, dfFalseNorthing)
Stereographic
GDAL.osrsettargetlinearunits
— MethodOSRSetTargetLinearUnits(OGRSpatialReferenceH hSRS,
const char * pszTargetKey,
const char * pszUnits,
double dfInMeters) -> OGRErr
Set the linear units for the target node.
GDAL.osrsettm
— Methodosrsettm(hSRS, dfCenterLat, dfCenterLong, dfScale, dfFalseEasting, dfFalseNorthing)
Transverse Mercator
Special processing available for Transverse Mercator with GDAL >= 1.10 and PROJ >= 4.8 : see OGRSpatialReference::exportToProj4().
GDAL.osrsettmg
— Methodosrsettmg(hSRS, dfCenterLat, dfCenterLong, dfFalseEasting, dfFalseNorthing)
Tunesia Mining Grid
GDAL.osrsettmso
— Methodosrsettmso(hSRS, dfCenterLat, dfCenterLong, dfScale, dfFalseEasting, dfFalseNorthing)
Transverse Mercator (South Oriented)
GDAL.osrsettmvariant
— Methodosrsettmvariant(hSRS, pszVariantName, dfCenterLat, dfCenterLong, dfScale, dfFalseEasting, dfFalseNorthing)
Transverse Mercator variant
GDAL.osrsettowgs84
— MethodOSRSetTOWGS84(OGRSpatialReferenceH hSRS,
double dfDX,
double dfDY,
double dfDZ,
double dfEX,
double dfEY,
double dfEZ,
double dfPPM) -> OGRErr
Set the Bursa-Wolf conversion to WGS84.
GDAL.osrsettped
— Methodosrsettped(hSRS, dfLat1, dfLong1, dfLat2, dfLong2, dfFalseEasting, dfFalseNorthing)
TPED (Two Point Equi Distant)
GDAL.osrsetutm
— MethodOSRSetUTM(OGRSpatialReferenceH hSRS,
int nZone,
int bNorth) -> OGRErr
Set UTM projection definition.
GDAL.osrsetvdg
— Methodosrsetvdg(hSRS, dfCenterLong, dfFalseEasting, dfFalseNorthing)
VanDerGrinten
GDAL.osrsetvertcs
— MethodOSRSetVertCS(OGRSpatialReferenceH hSRS,
const char * pszVertCSName,
const char * pszVertDatumName,
int nVertDatumType) -> OGRErr
Setup the vertical coordinate system.
GDAL.osrsetverticalperspective
— Methodosrsetverticalperspective(hSRS, dfTopoOriginLat, dfTopoOriginLon, dfTopoOriginHeight, dfViewPointHeight, dfFalseEasting, dfFalseNorthing)
Vertical Perspective / Near-sided Perspective
GDAL.osrsetwagner
— Methodosrsetwagner(hSRS, nVariation, dfCenterLat, dfFalseEasting, dfFalseNorthing)
Wagner I – VII
GDAL.osrsetwellknowngeogcs
— MethodOSRSetWellKnownGeogCS(OGRSpatialReferenceH hSRS,
const char * pszName) -> OGRErr
Set a GeogCS based on well known name.
GDAL.osrstripvertical
— MethodOSRStripVertical(OGRSpatialReferenceH hSRS) -> OGRErr
Convert a compound cs into a horizontal CS.
GDAL.osrvalidate
— MethodOSRValidate(OGRSpatialReferenceH hSRS) -> OGRErr
Validate SRS tokens.
GDAL.rpcinfov1tomd
— MethodRPCInfoV1ToMD(GDALRPCInfoV1 * psRPCInfo) -> char **
GDAL.rpcinfov2tomd
— MethodRPCInfoV2ToMD(GDALRPCInfoV2 * psRPCInfo) -> char **
GDAL.vrtaddband
— MethodVRTAddBand(VRTDatasetH hDataset,
GDALDataType eType,
char ** papszOptions) -> int
GDAL.vrtaddcomplexsource
— MethodVRTAddComplexSource(VRTSourcedRasterBandH hVRTBand,
GDALRasterBandH hSrcBand,
int nSrcXOff,
int nSrcYOff,
int nSrcXSize,
int nSrcYSize,
int nDstXOff,
int nDstYOff,
int nDstXSize,
int nDstYSize,
double dfScaleOff,
double dfScaleRatio,
double dfNoDataValue) -> CPLErr
GDAL.vrtaddfuncsource
— MethodVRTAddFuncSource(VRTSourcedRasterBandH hVRTBand,
VRTImageReadFunc pfnReadFunc,
void * pCBData,
double dfNoDataValue) -> CPLErr
GDAL.vrtaddsimplesource
— MethodVRTAddSimpleSource(VRTSourcedRasterBandH hVRTBand,
GDALRasterBandH hSrcBand,
int nSrcXOff,
int nSrcYOff,
int nSrcXSize,
int nSrcYSize,
int nDstXOff,
int nDstYOff,
int nDstXSize,
int nDstYSize,
const char * pszResampling,
double dfNoDataValue) -> CPLErr
GDAL.vrtaddsource
— MethodVRTAddSource(VRTSourcedRasterBandH hVRTBand,
VRTSourceH hNewSource) -> CPLErr
GDAL.vrtcreate
— MethodVRTCreate(int nXSize,
int nYSize) -> VRTDatasetH
GDAL.vrtflushcache
— MethodVRTFlushCache(VRTDatasetH hDataset) -> void
GDAL.vrtserializetoxml
— MethodVRTSerializeToXML(VRTDatasetH hDataset,
const char * pszVRTPath) -> CPLXMLNode *
GDAL.vsiabortpendinguploads
— MethodVSIAbortPendingUploads(const char * pszFilename) -> int
Abort ongoing multi-part uploads.
Parameters
- pszFilename: filename or prefix of a directory into which multipart uploads must be aborted. This can be the root directory of a bucket. UTF-8 encoded.
Returns
TRUE on success or FALSE on an error.
GDAL.vsiallocfilesystemplugincallbacksstruct
— Methodvsiallocfilesystemplugincallbacksstruct()
return a VSIFilesystemPluginCallbacksStruct
to be populated at runtime with handler callbacks
\since GDAL 3.0
GDAL.vsicalloc
— MethodVSICalloc(size_t nCount,
size_t nSize) -> void *
Analog of calloc().
GDAL.vsicallocverbose
— Methodvsicallocverbose(nCount, nSize, pszFile, nLine)
GDAL.vsicleanupfilemanager
— Methodvsicleanupfilemanager()
Doxygen_Suppress
GDAL.vsiclearcredentials
— MethodVSIClearCredentials(const char * pszPathPrefix) -> void
Clear path specific options set with VSISetPathSpecificOption()
GDAL.vsiclearpathspecificoptions
— MethodVSIClearPathSpecificOptions(const char * pszPathPrefix) -> void
Clear path specific options set with VSISetPathSpecificOption()
Parameters
- pszPathPrefix: If set to NULL, all path specific options are cleared. If set to not-NULL, only those set with VSISetPathSpecificOption(pszPathPrefix, ...) will be cleared.
GDAL.vsiclosedir
— MethodVSICloseDir(VSIDIR * dir) -> void
Close a directory.
Parameters
- dir: Directory handled returned by VSIOpenDir().
GDAL.vsicopyfile
— MethodVSICopyFile(const char * pszSource,
const char * pszTarget,
VSILFILE * fpSource,
vsi_l_offset nSourceSize,
const char *const * papszOptions,
GDALProgressFunc pProgressFunc,
void * pProgressData) -> int
Copy a source file into a target file.
Parameters
- pszSource: Source filename. UTF-8 encoded. May be NULL if fpSource is not NULL.
- pszTarget: Target filename. UTF-8 encoded. Must not be NULL
- fpSource: File handle on the source file. May be NULL if pszSource is not NULL.
- nSourceSize: Size of the source file. Pass -1 if unknown. If set to -1, and progress callback is used, VSIStatL() will be used on pszSource to retrieve the source size.
- papszOptions: Null terminated list of options, or NULL.
- pProgressFunc: Progress callback, or NULL.
- pProgressData: User data of progress callback, or NULL.
Returns
0 on success.
GDAL.vsictime
— MethodVSICTime(unsigned long nTime) -> const char *
GDAL.vsicurlclearcache
— MethodVSICurlClearCache(void) -> void
Clean local cache associated with /vsicurl/ (and related file systems)
GDAL.vsicurlpartialclearcache
— MethodVSICurlPartialClearCache(const char * pszFilenamePrefix) -> void
Clean local cache associated with /vsicurl/ (and related file systems) for a given filename (and its subfiles and subdirectories if it is a directory)
Parameters
- pszFilenamePrefix: Filename prefix
GDAL.vsiduplicatefilesystemhandler
— Methodvsiduplicatefilesystemhandler(pszSourceFSName, pszNewFSName)
GDAL.vsifclose
— MethodVSIFClose(FILE * fp) -> int
GDAL.vsifclosel
— MethodVSIFCloseL(VSILFILE * fp) -> int
Close file.
Parameters
- fp: file handle opened with VSIFOpenL(). Passing a nullptr produces undefined behavior.
Returns
0 on success or -1 on failure.
GDAL.vsifeof
— MethodVSIFEof(FILE * fp) -> int
GDAL.vsifeofl
— MethodVSIFEofL(VSILFILE * fp) -> int
Test for end of file.
Parameters
- fp: file handle opened with VSIFOpenL().
Returns
TRUE if at EOF else FALSE.
GDAL.vsifflush
— MethodVSIFFlush(FILE * fp) -> void
GDAL.vsifflushl
— MethodVSIFFlushL(VSILFILE * fp) -> int
Flush pending writes to disk.
Parameters
- fp: file handle opened with VSIFOpenL().
Returns
0 on success or -1 on error.
GDAL.vsifgetc
— MethodVSIFGetc(FILE * fp) -> int
GDAL.vsifgetnativefiledescriptorl
— MethodVSIFGetNativeFileDescriptorL(VSILFILE * fp) -> void *
Returns the "native" file descriptor for the virtual handle.
Parameters
- fp: file handle opened with VSIFOpenL().
Returns
the native file descriptor, or NULL.
GDAL.vsifgetrangestatusl
— MethodVSIFGetRangeStatusL(VSILFILE * fp,
vsi_l_offset nOffset,
vsi_l_offset nLength) -> VSIRangeStatus
Return if a given file range contains data or holes filled with zeroes.
Parameters
- fp: file handle opened with VSIFOpenL().
- nOffset: offset of the start of the extent.
- nLength: extent length.
Returns
extent status: VSIRANGESTATUSUNKNOWN, VSIRANGESTATUSDATA or VSIRANGESTATUS_HOLE
GDAL.vsifgets
— MethodVSIFGets(char * pszBuffer,
int nBufferSize,
FILE * fp) -> char *
GDAL.vsifilefrommembuffer
— MethodVSIFileFromMemBuffer(const char * pszFilename,
GByte * pabyData,
vsi_l_offset nDataLength,
int bTakeOwnership) -> VSILFILE *
Create memory "file" from a buffer.
Parameters
- pszFilename: the filename to be created, or nullptr
- pabyData: the data buffer for the file.
- nDataLength: the length of buffer in bytes.
- bTakeOwnership: TRUE to transfer "ownership" of buffer or FALSE.
Returns
open file handle on created file (see VSIFOpenL()).
GDAL.vsifopen
— Methodvsifopen(arg1, arg2)
Doxygen_Suppress
GDAL.vsifopenex2l
— MethodVSIFOpenEx2L(const char * pszFilename,
const char * pszAccess,
int bSetError,
CSLConstList papszOptions) -> VSILFILE *
Open file.
Parameters
- pszFilename: the file to open. UTF-8 encoded.
- pszAccess: access requested (i.e. "r", "r+", "w")
- bSetError: flag determining whether or not this open call should set VSIErrors on failure.
- papszOptions: NULL or NULL-terminated list of strings. The content is highly file system dependent.
Returns
NULL on failure, or the file handle.
GDAL.vsifopenexl
— MethodVSIFOpenExL(const char * pszFilename,
const char * pszAccess,
int bSetError) -> VSILFILE *
Open file.
Parameters
- pszFilename: the file to open. UTF-8 encoded.
- pszAccess: access requested (i.e. "r", "r+", "w")
- bSetError: flag determining whether or not this open call should set VSIErrors on failure.
Returns
NULL on failure, or the file handle.
GDAL.vsifopenl
— MethodVSIFOpenL(const char * pszFilename,
const char * pszAccess) -> VSILFILE *
Open file.
Parameters
- pszFilename: the file to open. UTF-8 encoded.
- pszAccess: access requested (i.e. "r", "r+", "w")
Returns
NULL on failure, or the file handle.
GDAL.vsifputc
— MethodVSIFPutc(int nChar,
FILE * fp) -> int
GDAL.vsifputcl
— MethodVSIFPutcL(int nChar,
VSILFILE * fp) -> int
Write a single byte to the file.
Parameters
- nChar: character to write.
- fp: file handle opened with VSIFOpenL().
Returns
1 in case of success, 0 on error.
GDAL.vsifputs
— MethodVSIFPuts(const char * pszString,
FILE * fp) -> int
GDAL.vsifread
— MethodVSIFRead(void * pBuffer,
size_t nSize,
size_t nCount,
FILE * fp) -> size_t
GDAL.vsifreadl
— MethodVSIFReadL(void * pBuffer,
size_t nSize,
size_t nCount,
VSILFILE * fp) -> size_t
Read bytes from file.
Parameters
- pBuffer: the buffer into which the data should be read (at least nCount * nSize bytes in size.
- nSize: size of objects to read in bytes.
- nCount: number of objects to read.
- fp: file handle opened with VSIFOpenL().
Returns
number of objects successfully read.
GDAL.vsifreadmultirangel
— MethodVSIFReadMultiRangeL(int nRanges,
void ** ppData,
const vsi_l_offset * panOffsets,
const size_t * panSizes,
VSILFILE * fp) -> int
Read several ranges of bytes from file.
Parameters
- nRanges: number of ranges to read.
- ppData: array of nRanges buffer into which the data should be read (ppData[i] must be at list panSizes[i] bytes).
- panOffsets: array of nRanges offsets at which the data should be read.
- panSizes: array of nRanges sizes of objects to read (in bytes).
- fp: file handle opened with VSIFOpenL().
Returns
0 in case of success, -1 otherwise.
GDAL.vsifree
— MethodVSIFree(void * pData) -> void
Analog of free() for data allocated with VSIMalloc(), VSICalloc(), VSIRealloc()
GDAL.vsifreealigned
— MethodVSIFreeAligned(void * ptr) -> void
Free a buffer allocated with VSIMallocAligned().
Parameters
- ptr: Buffer to free.
GDAL.vsifreefilesystemplugincallbacksstruct
— Methodvsifreefilesystemplugincallbacksstruct(poCb)
free resources allocated by VSIAllocFilesystemPluginCallbacksStruct
\since GDAL 3.0
GDAL.vsifseek
— MethodVSIFSeek(FILE * fp,
long nOffset,
int nWhence) -> int
GDAL.vsifseekl
— MethodVSIFSeekL(VSILFILE * fp,
vsi_l_offset nOffset,
int nWhence) -> int
Seek to requested offset.
Parameters
- fp: file handle opened with VSIFOpenL().
- nOffset: offset in bytes.
- nWhence: one of SEEKSET, SEEKCUR or SEEK_END.
Returns
0 on success or -1 one failure.
GDAL.vsiftell
— MethodVSIFTell(FILE * fp) -> long
GDAL.vsiftelll
— MethodVSIFTellL(VSILFILE * fp) -> vsi_l_offset
Tell current file offset.
Parameters
- fp: file handle opened with VSIFOpenL().
Returns
file offset in bytes.
GDAL.vsiftruncatel
— MethodVSIFTruncateL(VSILFILE * fp,
vsi_l_offset nNewSize) -> int
Truncate/expand the file to the specified size.
Parameters
- fp: file handle opened with VSIFOpenL().
- nNewSize: new size in bytes.
Returns
0 on success
GDAL.vsifwrite
— MethodVSIFWrite(const void * pBuffer,
size_t nSize,
size_t nCount,
FILE * fp) -> size_t
GDAL.vsifwritel
— MethodVSIFWriteL(const void * pBuffer,
size_t nSize,
size_t nCount,
VSILFILE * fp) -> size_t
Write bytes to file.
Parameters
- pBuffer: the buffer from which the data should be written (at least nCount * nSize bytes in size.
- nSize: size of objects to write in bytes.
- nCount: number of objects to write.
- fp: file handle opened with VSIFOpenL().
Returns
number of objects successfully written.
GDAL.vsigetactualurl
— MethodVSIGetActualURL(const char * pszFilename) -> const char *
Returns the actual URL of a supplied filename.
Parameters
- pszFilename: the path of the filesystem object. UTF-8 encoded.
Returns
the actual URL corresponding to the supplied filename, or NULL. Should not be freed.
GDAL.vsigetcanonicalfilename
— MethodVSIGetCanonicalFilename(const char * pszPath) -> char *
Returns the canonical filename.
Parameters
- pszPath: UTF-8 encoded path
Returns
UTF-8 encoded string, to free with VSIFree()
GDAL.vsigetcredential
— MethodVSIGetCredential(const char * pszPath,
const char * pszKey,
const char * pszDefault) -> const char *
Get the value of a credential (or more generally an option related to a virtual file system) for a given path.
GDAL.vsigetdirectoryseparator
— MethodVSIGetDirectorySeparator(const char * pszPath) -> const char *
Return the directory separator for the specified path.
GDAL.vsigetdiskfreespace
— MethodVSIGetDiskFreeSpace(const char * pszDirname) -> GIntBig
Return free disk space available on the filesystem.
Parameters
- pszDirname: a directory of the filesystem to query.
Returns
The free space in bytes. Or -1 in case of error.
GDAL.vsigetfilemetadata
— MethodVSIGetFileMetadata(const char * pszFilename,
const char * pszDomain,
CSLConstList papszOptions) -> char **
Get metadata on files.
Parameters
- pszFilename: the path of the filesystem object to be queried. UTF-8 encoded.
- pszDomain: Metadata domain to query. Depends on the file system. The following are supported:
HEADERS: to get HTTP headers for network-like filesystems (/vsicurl/, /vsis3/, /vsgis/, etc)
TAGS:
/vsis3/: to get S3 Object tagging information
/vsiaz/: to get blob tags. Refer to https://docs.microsoft.com/en-us/rest/api/storageservices/get-blob-tags
STATUS: specific to /vsiadls/: returns all system defined properties for a path (seems in practice to be a subset of HEADERS)
ACL: specific to /vsiadls/ and /vsigs/: returns the access control list for a path. For /vsigs/, a single XML=xml_content string is returned. Refer to https://cloud.google.com/storage/docs/xml-api/get-object-acls
METADATA: specific to /vsiaz/: to set blob metadata. Refer to https://docs.microsoft.com/en-us/rest/api/storageservices/get-blob-metadata. Note: this will be a subset of what pszDomain=HEADERS returns
ZIP: specific to /vsizip/: to obtain ZIP specific metadata, in particular if a file is SOZIP-enabled (SOZIP_VALID=YES)
- papszOptions: Unused. Should be set to NULL.
Returns
a NULL-terminated list of key=value strings, to be freed with CSLDestroy() or NULL in case of error / empty list.
GDAL.vsigetfilesystemoptions
— MethodVSIGetFileSystemOptions(const char * pszFilename) -> const char *
Return the list of options associated with a virtual file system handler as a serialized XML string.
Parameters
- pszFilename: a filename, or prefix of a virtual file system handler.
Returns
a string, which must not be freed, or NULL if no options is declared.
GDAL.vsigetfilesystemsprefixes
— MethodVSIGetFileSystemsPrefixes(void) -> char **
Return the list of prefixes for virtual file system handlers currently registered.
Returns
a NULL terminated list of prefixes. Must be freed with CSLDestroy()
GDAL.vsigetmemfilebuffer
— MethodVSIGetMemFileBuffer(const char * pszFilename,
vsi_l_offset * pnDataLength,
int bUnlinkAndSeize) -> GByte *
Fetch buffer underlying memory file.
Parameters
- pszFilename: the name of the file to grab the buffer of.
- pnDataLength: (file) length returned in this variable.
- bUnlinkAndSeize: TRUE to remove the file, or FALSE to leave unaltered.
Returns
pointer to memory buffer or NULL on failure.
GDAL.vsigetnextdirentry
— MethodVSIGetNextDirEntry(VSIDIR * dir) -> const VSIDIREntry *
Return the next entry of the directory.
Parameters
- dir: Directory handled returned by VSIOpenDir(). Must not be NULL.
Returns
a entry, or NULL if there is no more entry in the directory. This return value must not be freed.
GDAL.vsigetpathspecificoption
— MethodVSIGetPathSpecificOption(const char * pszPath,
const char * pszKey,
const char * pszDefault) -> const char *
Get the value a path specific option.
GDAL.vsigetsignedurl
— MethodVSIGetSignedURL(const char * pszFilename,
CSLConstList papszOptions) -> char *
Returns a signed URL of a supplied filename.
Parameters
- pszFilename: the path of the filesystem object. UTF-8 encoded.
- papszOptions: list of options, or NULL. Depend on file system handler. For /vsis3/, /vsigs/, /vsiaz/ and /vsioss/, the following options are supported:
START_DATE=YYMMDDTHHMMSSZ: date and time in UTC following ISO 8601 standard, corresponding to the start of validity of the URL. If not specified, current date time.
EXPIRATIONDELAY=numberof_seconds: number between 1 and 604800 (seven days) for the validity of the signed URL. Defaults to 3600 (one hour)
VERB=GET/HEAD/DELETE/PUT/POST: HTTP VERB for which the request will be used. Default to GET.
Returns
a signed URL, or NULL. Should be freed with CPLFree().
GDAL.vsigmtime
— MethodVSIGMTime(const time_t * pnTime,
struct tm * poBrokenTime) -> struct tm *
GDAL.vsihasoptimizedreadmultirange
— MethodVSIHasOptimizedReadMultiRange(const char * pszPath) -> int
Returns if the filesystem supports efficient multi-range reading.
Parameters
- pszPath: the path of the filesystem object to be tested. UTF-8 encoded.
Returns
TRUE if the file system is known to have an efficient multi-range reading.
GDAL.vsiingestfile
— MethodVSIIngestFile(VSILFILE * fp,
const char * pszFilename,
GByte ** ppabyRet,
vsi_l_offset * pnSize,
GIntBig nMaxSize) -> int
Ingest a file into memory.
Parameters
- fp: file handle opened with VSIFOpenL().
- pszFilename: filename.
- ppabyRet: pointer to the target buffer. *ppabyRet must be freed with VSIFree()
- pnSize: pointer to variable to store the file size. May be NULL.
- nMaxSize: maximum size of file allowed. If no limit, set to a negative value.
Returns
TRUE in case of success.
GDAL.vsiinstall7zfilehandler
— MethodVSIInstall7zFileHandler(void) -> void
Install /vsi7z/ 7zip file system handler (requires libarchive)
GDAL.vsiinstalladlsfilehandler
— MethodVSIInstallADLSFileHandler(void) -> void
Install /vsiaz/ Microsoft Azure Data Lake Storage Gen2 file system handler (requires libcurl)
GDAL.vsiinstallazurefilehandler
— MethodVSIInstallAzureFileHandler(void) -> void
Install /vsiaz/ Microsoft Azure Blob file system handler (requires libcurl)
GDAL.vsiinstallazurestreamingfilehandler
— MethodVSIInstallAzureStreamingFileHandler(void) -> void
Install /vsiaz_streaming/ Microsoft Azure Blob file system handler (requires libcurl)
GDAL.vsiinstallcachedfilehandler
— MethodVSIInstallCachedFileHandler(void) -> void
Install /vsicached? file system handler.
GDAL.vsiinstallcryptfilehandler
— MethodVSIInstallCryptFileHandler() -> void
Install /vsicrypt/ encrypted file system handler (requires libcrypto++)
GDAL.vsiinstallcurlfilehandler
— MethodVSIInstallCurlFileHandler(void) -> void
Install /vsicurl/ HTTP/FTP file system handler (requires libcurl)
GDAL.vsiinstallcurlstreamingfilehandler
— MethodVSIInstallCurlStreamingFileHandler(void) -> void
Install /vsicurl_streaming/ HTTP/FTP file system handler (requires libcurl).
GDAL.vsiinstallgsfilehandler
— MethodVSIInstallGSFileHandler(void) -> void
Install /vsigs/ Google Cloud Storage file system handler (requires libcurl)
GDAL.vsiinstallgsstreamingfilehandler
— MethodVSIInstallGSStreamingFileHandler(void) -> void
Install /vsigs_streaming/ Google Cloud Storage file system handler (requires libcurl)
GDAL.vsiinstallgzipfilehandler
— MethodVSIInstallGZipFileHandler() -> void
Install GZip file system handler.
GDAL.vsiinstallhdfshandler
— MethodVSIInstallHdfsHandler() -> void
Install /vsihdfs/ file system handler (requires JVM and HDFS support)
GDAL.vsiinstalllargefilehandler
— Methodvsiinstalllargefilehandler()
Doxygen_Suppress
GDAL.vsiinstallmemfilehandler
— MethodVSIInstallMemFileHandler() -> void
Install "memory" file system handler.
GDAL.vsiinstallossfilehandler
— MethodVSIInstallOSSFileHandler(void) -> void
Install /vsioss/ Alibaba Cloud Object Storage Service (OSS) file system handler (requires libcurl)
GDAL.vsiinstallossstreamingfilehandler
— MethodVSIInstallOSSStreamingFileHandler(void) -> void
Install /vsiaz_streaming/ Alibaba Cloud Object Storage Service (OSS) (requires libcurl)
GDAL.vsiinstallpluginhandler
— Methodvsiinstallpluginhandler(pszPrefix, poCb)
register a handler on the given prefix. All IO on datasets opened with the filename /prefix/xxxxxx will go through these callbacks. pszPrefix must begin and end with a '/'
\since GDAL 3.0
GDAL.vsiinstallrarfilehandler
— MethodVSIInstallRarFileHandler(void) -> void
Install /vsirar/ RAR file system handler (requires libarchive)
GDAL.vsiinstalls3filehandler
— MethodVSIInstallS3FileHandler(void) -> void
Install /vsis3/ Amazon S3 file system handler (requires libcurl)
GDAL.vsiinstalls3streamingfilehandler
— MethodVSIInstallS3StreamingFileHandler(void) -> void
Install /vsis3_streaming/ Amazon S3 file system handler (requires libcurl).
GDAL.vsiinstallsparsefilehandler
— MethodVSIInstallSparseFileHandler() -> void
Install /vsisparse/ virtual file handler.
GDAL.vsiinstallstdinhandler
— MethodVSIInstallStdinHandler() -> void
Install /vsistdin/ file system handler.
GDAL.vsiinstallstdouthandler
— MethodVSIInstallStdoutHandler() -> void
Install /vsistdout/ file system handler.
GDAL.vsiinstallsubfilehandler
— Methodvsiinstallsubfilehandler()
GDAL.vsiinstallswiftfilehandler
— MethodVSIInstallSwiftFileHandler(void) -> void
Install /vsiswift/ OpenStack Swif Object Storage (Swift) file system handler (requires libcurl)
GDAL.vsiinstallswiftstreamingfilehandler
— MethodVSIInstallSwiftStreamingFileHandler(void) -> void
Install /vsiswift_streaming/ OpenStack Swif Object Storage (Swift) file system handler (requires libcurl)
GDAL.vsiinstalltarfilehandler
— MethodVSIInstallTarFileHandler(void) -> void
Install /vsitar/ file system handler.
GDAL.vsiinstallwebhdfshandler
— MethodVSIInstallWebHdfsHandler(void) -> void
Install /vsiwebhdfs/ WebHDFS (Hadoop File System) REST API file system handler (requires libcurl)
GDAL.vsiinstallzipfilehandler
— MethodVSIInstallZipFileHandler() -> void
Install ZIP file system handler.
GDAL.vsiiscasesensitivefs
— MethodVSIIsCaseSensitiveFS(const char * pszFilename) -> int
Returns if the filenames of the filesystem are case sensitive.
Parameters
- pszFilename: the path of the filesystem object to be tested. UTF-8 encoded.
Returns
TRUE if the filenames of the filesystem are case sensitive.
GDAL.vsiislocal
— MethodVSIIsLocal(const char * pszPath) -> bool
Returns if the file/filesystem is "local".
Parameters
- pszPath: the path of the filesystem object to be tested. UTF-8 encoded.
Returns
TRUE or FALSE
GDAL.vsilocaltime
— MethodVSILocalTime(const time_t * pnTime,
struct tm * poBrokenTime) -> struct tm *
GDAL.vsimalloc
— MethodVSIMalloc(size_t nSize) -> void *
Analog of malloc().
GDAL.vsimalloc2
— Methodvsimalloc2(nSize1, nSize2)
VSIMalloc2
allocates (nSize1 * nSize2) bytes. In case of overflow of the multiplication, or if memory allocation fails, a NULL pointer is returned and a CE_Failure error is raised with CPLError
(). If nSize1 == 0 || nSize2 == 0, a NULL pointer will also be returned. CPLFree
() or VSIFree
() can be used to free memory allocated by this function.
GDAL.vsimalloc2verbose
— Methodvsimalloc2verbose(nSize1, nSize2, pszFile, nLine)
GDAL.vsimalloc3
— Methodvsimalloc3(nSize1, nSize2, nSize3)
VSIMalloc3
allocates (nSize1 * nSize2 * nSize3) bytes. In case of overflow of the multiplication, or if memory allocation fails, a NULL pointer is returned and a CE_Failure error is raised with CPLError
(). If nSize1 == 0 || nSize2 == 0 || nSize3 == 0, a NULL pointer will also be returned. CPLFree
() or VSIFree
() can be used to free memory allocated by this function.
GDAL.vsimalloc3verbose
— Methodvsimalloc3verbose(nSize1, nSize2, nSize3, pszFile, nLine)
GDAL.vsimallocaligned
— MethodVSIMallocAligned(size_t nAlignment,
size_t nSize) -> void *
Allocates a buffer with an alignment constraint.
Parameters
- nAlignment: Must be a power of 2, multiple of sizeof(void*), and lesser than 256.
- nSize: Size of the buffer to allocate.
Returns
a buffer aligned on nAlignment and of size nSize, or NULL
GDAL.vsimallocalignedauto
— MethodVSIMallocAlignedAuto(size_t nSize) -> void *
Allocates a buffer with an alignment constraint such that it can be used by the most demanding vector instruction set on that platform.
Parameters
- nSize: Size of the buffer to allocate.
Returns
an aligned buffer of size nSize, or NULL
GDAL.vsimallocalignedautoverbose
— MethodVSIMallocAlignedAutoVerbose(size_t nSize,
const char * pszFile,
int nLine) -> void *
See VSIMallocAlignedAuto()
GDAL.vsimallocverbose
— Methodvsimallocverbose(nSize, pszFile, nLine)
GDAL.vsimkdir
— MethodVSIMkdir(const char * pszPathname,
long mode) -> int
Create a directory.
Parameters
- pszPathname: the path to the directory to create. UTF-8 encoded.
- mode: the permissions mode.
Returns
0 on success or -1 on an error.
GDAL.vsimkdirrecursive
— MethodVSIMkdirRecursive(const char * pszPathname,
long mode) -> int
Create a directory and all its ancestors.
Parameters
- pszPathname: the path to the directory to create. UTF-8 encoded.
- mode: the permissions mode.
Returns
0 on success or -1 on an error.
GDAL.vsinetworkstatsgetasserializedjson
— MethodVSINetworkStatsGetAsSerializedJSON(char ** papszOptions) -> char *
Return network related statistics, as a JSON serialized object.
Parameters
- papszOptions: Unused.
Returns
a JSON serialized string to free with VSIFree(), or nullptr
GDAL.vsinetworkstatsreset
— MethodVSINetworkStatsReset(void) -> void
Clear network related statistics.
GDAL.vsiopendir
— MethodVSIOpenDir(const char * pszPath,
int nRecurseDepth,
const char *const * papszOptions) -> VSIDIR *
Open a directory to read its entries.
Parameters
- pszPath: the relative, or absolute path of a directory to read. UTF-8 encoded.
- nRecurseDepth: 0 means do not recurse in subdirectories, 1 means recurse only in the first level of subdirectories, etc. -1 means unlimited recursion level
- papszOptions: NULL terminated list of options, or NULL. The following options are implemented:
PREFIX=string: (GDAL >= 3.4) Filter to select filenames only starting with the specified prefix. Implemented efficiently for /vsis3/, /vsigs/, and /vsiaz/ (but not /vsiadls/)
NAMEANDTYPE_ONLY=YES/NO: (GDAL >= 3.4) Defaults to NO. If set to YES, only the pszName and nMode members of VSIDIR are guaranteed to be set. This is implemented efficiently for the Unix virtual file system.
Returns
a handle, or NULL in case of error
GDAL.vsioverwritefile
— MethodVSIOverwriteFile(VSILFILE * fpTarget,
const char * pszSourceFilename) -> int
Overwrite an existing file with content from another one.
Parameters
- fpTarget: file handle opened with VSIFOpenL() with "rb+" flag.
- pszSourceFilename: source filename
Returns
TRUE in case of success.
GDAL.vsireaddir
— MethodVSIReadDir(const char * pszPath) -> char **
Read names in a directory.
Parameters
- pszPath: the relative, or absolute path of a directory to read. UTF-8 encoded.
Returns
The list of entries in the directory, or NULL if the directory doesn't exist. Filenames are returned in UTF-8 encoding.
GDAL.vsireaddirex
— MethodVSIReadDirEx(const char * pszPath,
int nMaxFiles) -> char **
Read names in a directory.
Parameters
- pszPath: the relative, or absolute path of a directory to read. UTF-8 encoded.
- nMaxFiles: maximum number of files after which to stop, or 0 for no limit.
Returns
The list of entries in the directory, or NULL if the directory doesn't exist. Filenames are returned in UTF-8 encoding.
GDAL.vsireaddirrecursive
— MethodVSIReadDirRecursive(const char * pszPathIn) -> char **
Read names in a directory recursively.
Parameters
- pszPathIn: the relative, or absolute path of a directory to read. UTF-8 encoded.
Returns
The list of entries in the directory and subdirectories or NULL if the directory doesn't exist. Filenames are returned in UTF-8 encoding.
GDAL.vsirealloc
— MethodVSIRealloc(void * pData,
size_t nNewSize) -> void *
Analog of realloc().
GDAL.vsireallocverbose
— Methodvsireallocverbose(pOldPtr, nNewSize, pszFile, nLine)
GDAL.vsiremovepluginhandler
— Methodvsiremovepluginhandler(pszPrefix)
Unregister a handler previously installed with VSIInstallPluginHandler
() on the given prefix. Note: it is generally unsafe to remove a handler while there are still file handles opened that are managed by that handler. It is the responsibility of the caller to ensure that it calls this function in a situation where it is safe to do so.
\since GDAL 3.9
GDAL.vsirename
— MethodVSIRename(const char * oldpath,
const char * newpath) -> int
Rename a file.
Parameters
- oldpath: the name of the file to be renamed. UTF-8 encoded.
- newpath: the name the file should be given. UTF-8 encoded.
Returns
0 on success or -1 on an error.
GDAL.vsirewind
— MethodVSIRewind(FILE * fp) -> void
GDAL.vsirewindl
— MethodVSIRewindL(VSILFILE * fp) -> void
Rewind the file pointer to the beginning of the file.
Parameters
- fp: file handle opened with VSIFOpenL().
GDAL.vsirmdir
— MethodVSIRmdir(const char * pszDirname) -> int
Delete a directory.
Parameters
- pszDirname: the path of the directory to be deleted. UTF-8 encoded.
Returns
0 on success or -1 on an error.
GDAL.vsirmdirrecursive
— MethodVSIRmdirRecursive(const char * pszDirname) -> int
Delete a directory recursively.
Returns
0 on success or -1 on an error.
GDAL.vsisetcredential
— MethodVSISetCredential(const char * pszPathPrefix,
const char * pszKey,
const char * pszValue) -> void
Set a credential (or more generally an option related to a virtual file system) for a given path prefix.
GDAL.vsisetcryptkey
— MethodVSISetCryptKey(const GByte * pabyKey,
int nKeySize) -> void
Installs the encryption/decryption key.
Parameters
- pabyKey: key. Might be NULL to clear previously set key.
- nKeySize: length of the key in bytes. Might be 0 to clear previously set key.
GDAL.vsisetfilemetadata
— MethodVSISetFileMetadata(const char * pszFilename,
CSLConstList papszMetadata,
const char * pszDomain,
CSLConstList papszOptions) -> int
Set metadata on files.
Parameters
- pszFilename: the path of the filesystem object to be set. UTF-8 encoded.
- papszMetadata: NULL-terminated list of key=value strings.
- pszDomain: Metadata domain to set. Depends on the file system. The following are supported:
HEADERS: specific to /vsis3/ and /vsigs/: to set HTTP headers, such as "Content-Type", or other file system specific header. For /vsigs/, this also includes: x-goog-meta-{key}={value}. Note that you should specify all metadata to be set, as existing metadata will be overridden.
TAGS: Content of papszMetadata should be KEY=VALUE pairs.
/vsis3/: to set S3 Object tagging information
/vsiaz/: to set blob tags. Refer to https://docs.microsoft.com/en-us/rest/api/storageservices/set-blob-tags. Note: storageV2 must be enabled on the account
PROPERTIES:
to /vsiaz/: to set properties. Refer to https://docs.microsoft.com/en-us/rest/api/storageservices/set-blob-properties.
to /vsiadls/: to set properties. Refer to https://docs.microsoft.com/en-us/rest/api/storageservices/datalakestoragegen2/path/update for headers valid for action=setProperties.
ACL: specific to /vsiadls/ and /vsigs/: to set access control list. For /vsiadls/, refer to https://docs.microsoft.com/en-us/rest/api/storageservices/datalakestoragegen2/path/update for headers valid for action=setAccessControl or setAccessControlRecursive. In setAccessControlRecursive, x-ms-acl must be specified in papszMetadata. For /vsigs/, refer to https://cloud.google.com/storage/docs/xml-api/put-object-acls. A single XML=xml_content string should be specified as in papszMetadata.
METADATA: specific to /vsiaz/: to set blob metadata. Refer to https://docs.microsoft.com/en-us/rest/api/storageservices/set-blob-metadata. Content of papszMetadata should be strings in the form x-ms-meta-name=value
- papszOptions: NULL or NULL terminated list of options. For /vsiadls/ and pszDomain=ACL, "RECURSIVE=TRUE" can be set to set the access control list recursively. When RECURSIVE=TRUE is set, MODE should also be set to one of "set", "modify" or "remove".
Returns
TRUE in case of success.
GDAL.vsisetpathspecificoption
— MethodVSISetPathSpecificOption(const char * pszPathPrefix,
const char * pszKey,
const char * pszValue) -> void
Set a path specific option for a given path prefix.
Parameters
- pszPathPrefix: a path prefix of a virtual file system handler. Typically of the form "/vsiXXX/bucket". Must NOT be NULL.
- pszKey: Option name. Must NOT be NULL.
- pszValue: Option value. May be NULL to erase it.
GDAL.vsisiblingfiles
— MethodVSISiblingFiles(const char * pszFilename) -> char **
Return related filenames.
Parameters
- pszFilename: the path of a filename to inspect UTF-8 encoded.
Returns
The list of entries, relative to the directory, of all sidecar files available or NULL if the list is not known. Filenames are returned in UTF-8 encoding. Most implementations will return NULL, and a subsequent ReadDir will list all files available in the file's directory. This function will be overridden by VSI FilesystemHandlers that wish to force e.g. an empty list to avoid opening non-existent files on slow filesystems. The return value shall be destroyed with CSLDestroy()
GDAL.vsistat
— MethodVSIStat(const char * pszFilename,
VSIStatBuf * pStatBuf) -> int
GDAL.vsistatexl
— MethodVSIStatExL(const char * pszFilename,
VSIStatBufL * psStatBuf,
int nFlags) -> int
Get filesystem object info.
Parameters
- pszFilename: the path of the filesystem object to be queried. UTF-8 encoded.
- psStatBuf: the structure to load with information.
- nFlags: 0 to get all information, or VSISTATEXISTSFLAG, VSISTATNATUREFLAG, VSISTATSIZEFLAG, VSISTATSETERRORFLAG, VSISTATCACHEONLY or a combination of those to get partial info.
Returns
0 on success or -1 on an error.
GDAL.vsistatl
— MethodVSIStatL(const char * pszFilename,
VSIStatBufL * psStatBuf) -> int
Get filesystem object info.
Parameters
- pszFilename: the path of the filesystem object to be queried. UTF-8 encoded.
- psStatBuf: the structure to load with information.
Returns
0 on success or -1 on an error.
GDAL.vsistdoutsetredirection
— MethodVSIStdoutSetRedirection(VSIWriteFunction pFct,
FILE * stream) -> void
Set an alternative write function and output file handle instead of fwrite() / stdout.
Parameters
- pFct: Function with same signature as fwrite()
- stream: File handle on which to output. Passed to pFct.
GDAL.vsistrdup
— MethodVSIStrdup(const char * pszString) -> char *
Analog of strdup().
GDAL.vsistrdupverbose
— Methodvsistrdupverbose(pszStr, pszFile, nLine)
GDAL.vsistrerror
— MethodVSIStrerror(int nErrno) -> char *
Return the error string corresponding to the error number.
GDAL.vsisupportsrandomwrite
— MethodVSISupportsRandomWrite(const char * pszPath,
bool bAllowLocalTempFile) -> bool
Returns if the filesystem supports random write.
Parameters
- pszPath: the path of the filesystem object to be tested. UTF-8 encoded.
- bAllowLocalTempFile: whether the file system is allowed to use a local temporary file before uploading to the target location.
Returns
TRUE or FALSE
GDAL.vsisupportssequentialwrite
— MethodVSISupportsSequentialWrite(const char * pszPath,
bool bAllowLocalTempFile) -> bool
Returns if the filesystem supports sequential write.
Parameters
- pszPath: the path of the filesystem object to be tested. UTF-8 encoded.
- bAllowLocalTempFile: whether the file system is allowed to use a local temporary file before uploading to the target location.
Returns
TRUE or FALSE
GDAL.vsisupportssparsefiles
— MethodVSISupportsSparseFiles(const char * pszPath) -> int
Returns if the filesystem supports sparse files.
Parameters
- pszPath: the path of the filesystem object to be tested. UTF-8 encoded.
Returns
TRUE if the file system is known to support sparse files. FALSE may be returned both in cases where it is known to not support them, or when it is unknown.
GDAL.vsisync
— MethodVSISync(const char * pszSource,
const char * pszTarget,
const char *const * papszOptions,
GDALProgressFunc pProgressFunc,
void * pProgressData,
char *** ppapszOutputs) -> int
Synchronize a source file/directory with a target file/directory.
Parameters
- pszSource: Source file or directory. UTF-8 encoded.
- pszTarget: Target file or directory. UTF-8 encoded.
- papszOptions: Null terminated list of options, or NULL. Currently accepted options are:
RECURSIVE=NO (the default is YES)
SYNC_STRATEGY=TIMESTAMP/ETAG/OVERWRITE. Determines which criterion is used to determine if a target file must be replaced when it already exists and has the same file size as the source. Only applies for a source or target being a network filesystem. The default is TIMESTAMP (similarly to how 'aws s3 sync' works), that is to say that for an upload operation, a remote file is replaced if it has a different size or if it is older than the source. For a download operation, a local file is replaced if it has a different size or if it is newer than the remote file. The ETAG strategy assumes that the ETag metadata of the remote file is the MD5Sum of the file content, which is only true in the case of /vsis3/ for files not using KMS server side encryption and uploaded in a single PUT operation (so smaller than 50 MB given the default used by GDAL). Only to be used for /vsis3/, /vsigs/ or other filesystems using a MD5Sum as ETAG. The OVERWRITE strategy (GDAL >= 3.2) will always overwrite the target file with the source one.
NUM_THREADS=integer. (GDAL >= 3.1) Number of threads to use for parallel file copying. Only use for when /vsis3/, /vsigs/, /vsiaz/ or /vsiadls/ is in source or target. The default is 10 since GDAL 3.3
CHUNKSIZE=integer. (GDAL >= 3.1) Maximum size of chunk (in bytes) to use to split large objects when downloading them from /vsis3/, /vsigs/, /vsiaz/ or /vsiadls/ to local file system, or for upload to /vsis3/, /vsiaz/ or /vsiadls/ from local file system. Only used if NUMTHREADS > 1. For upload to /vsis3/, this chunk size must be set at least to 5 MB. The default is 8 MB since GDAL 3.3
x-amz-KEY=value. (GDAL >= 3.5) MIME header to pass during creation of a /vsis3/ object.
x-goog-KEY=value. (GDAL >= 3.5) MIME header to pass during creation of a /vsigs/ object.
x-ms-KEY=value. (GDAL >= 3.5) MIME header to pass during creation of a /vsiaz/ or /vsiadls/ object.
- pProgressFunc: Progress callback, or NULL.
- pProgressData: User data of progress callback, or NULL.
- ppapszOutputs: Unused. Should be set to NULL for now.
Returns
TRUE on success or FALSE on an error.
GDAL.vsitime
— Methodvsitime(arg1)
Doxygen_Suppress
GDAL.vsiungetc
— MethodVSIUngetc(int c,
FILE * fp) -> int
GDAL.vsiunlink
— MethodVSIUnlink(const char * pszFilename) -> int
Delete a file.
Parameters
- pszFilename: the path of the file to be deleted. UTF-8 encoded.
Returns
0 on success or -1 on an error.
GDAL.vsiunlinkbatch
— MethodVSIUnlinkBatch(CSLConstList papszFiles) -> int *
Delete several files, possibly in a batch.
Parameters
- papszFiles: NULL terminated list of files. UTF-8 encoded.
Returns
an array of size CSLCount(papszFiles), whose values are TRUE or FALSE depending on the success of deletion of the corresponding file. The array should be freed with VSIFree(). NULL might be return in case of a more general error (for example, files belonging to different file system handlers)