GDAL
|
Core portability services for cross-platform OGR code. More...
Go to the source code of this file.
Classes | |
union | OGRField |
OGRFeature field attribute value union. More... | |
Macros | |
#define | OGRERR_NONE 0 |
Success. | |
#define | OGRERR_NOT_ENOUGH_DATA 1 |
Not enough data to deserialize. | |
#define | OGRERR_NOT_ENOUGH_MEMORY 2 |
Not enough memory. | |
#define | OGRERR_UNSUPPORTED_GEOMETRY_TYPE 3 |
Unsupported geometry type. | |
#define | OGRERR_UNSUPPORTED_OPERATION 4 |
Unsupported operation. | |
#define | OGRERR_CORRUPT_DATA 5 |
Corrupt data. | |
#define | OGRERR_FAILURE 6 |
Failure. | |
#define | OGRERR_UNSUPPORTED_SRS 7 |
Unsupported SRS. | |
#define | OGRERR_INVALID_HANDLE 8 |
Invalid handle. | |
#define | OGRERR_NON_EXISTING_FEATURE 9 |
Non existing feature. More... | |
#define | wkb25DBit 0x80000000 |
#define | wkbFlatten(x) OGR_GT_Flatten(static_cast<OGRwkbGeometryType>(x)) |
Return the 2D geometry type corresponding to the specified geometry type. | |
#define | wkbHasZ(x) (OGR_GT_HasZ(x) != 0) |
Return if the geometry type is a 3D geometry type. More... | |
#define | wkbSetZ(x) OGR_GT_SetZ(x) |
Return the 3D geometry type corresponding to the specified geometry type. More... | |
#define | wkbHasM(x) (OGR_GT_HasM(x) != 0) |
Return if the geometry type is a measured geometry type. More... | |
#define | wkbSetM(x) OGR_GT_SetM(x) |
Return the measured geometry type corresponding to the specified geometry type. More... | |
#define | ALTER_NAME_FLAG 0x1 |
Alter field name. More... | |
#define | ALTER_TYPE_FLAG 0x2 |
Alter field type. More... | |
#define | ALTER_WIDTH_PRECISION_FLAG 0x4 |
Alter field width and precision. More... | |
#define | ALTER_NULLABLE_FLAG 0x8 |
Alter field NOT NULL constraint. More... | |
#define | ALTER_DEFAULT_FLAG 0x10 |
Alter field DEFAULT value. More... | |
#define | ALTER_ALL_FLAG (ALTER_NAME_FLAG | ALTER_TYPE_FLAG | ALTER_WIDTH_PRECISION_FLAG | ALTER_NULLABLE_FLAG | ALTER_DEFAULT_FLAG) |
Alter all parameters of field definition. More... | |
#define | OGR_F_VAL_NULL 0x00000001 |
Validate that fields respect not-null constraints. More... | |
#define | OGR_F_VAL_GEOM_TYPE 0x00000002 |
Validate that geometries respect geometry column type. More... | |
#define | OGR_F_VAL_WIDTH 0x00000004 |
Validate that (string) fields respect field width. More... | |
#define | OGR_F_VAL_ALLOW_NULL_WHEN_DEFAULT 0x00000008 |
Allow fields that are null when there's an associated default value. More... | |
#define | OGR_F_VAL_ALLOW_DIFFERENT_GEOM_DIM 0x00000010 |
Allow geometry fields to have a different coordinate dimension that their geometry column type. More... | |
#define | OGR_F_VAL_ALL (0x7FFFFFFF & ~OGR_F_VAL_ALLOW_DIFFERENT_GEOM_DIM) |
Enable all validation tests (except OGR_F_VAL_ALLOW_DIFFERENT_GEOM_DIM) Used by OGR_F_Validate(). More... | |
#define | OGRNullFID -1 |
Special value for a unset FID. | |
#define | OGRUnsetMarker -21121 |
Special value set in OGRField.Set.nMarker1, nMarker2 and nMarker3 for a unset field. More... | |
#define | OGRNullMarker -21122 |
Special value set in OGRField.Set.nMarker1, nMarker2 and nMarker3 for a null field. More... | |
#define | OLCRandomRead "RandomRead" |
Layer capability for random read. | |
#define | OLCSequentialWrite "SequentialWrite" |
Layer capability for sequential write. | |
#define | OLCRandomWrite "RandomWrite" |
Layer capability for random write. | |
#define | OLCFastSpatialFilter "FastSpatialFilter" |
Layer capability for fast spatial filter. | |
#define | OLCFastFeatureCount "FastFeatureCount" |
Layer capability for fast feature count retrieval. | |
#define | OLCFastGetExtent "FastGetExtent" |
Layer capability for fast extent retrieval. | |
#define | OLCCreateField "CreateField" |
Layer capability for field creation. | |
#define | OLCDeleteField "DeleteField" |
Layer capability for field deletion. | |
#define | OLCReorderFields "ReorderFields" |
Layer capability for field reordering. | |
#define | OLCAlterFieldDefn "AlterFieldDefn" |
Layer capability for field alteration. | |
#define | OLCTransactions "Transactions" |
Layer capability for transactions. | |
#define | OLCDeleteFeature "DeleteFeature" |
Layer capability for feature deletion. | |
#define | OLCFastSetNextByIndex "FastSetNextByIndex" |
Layer capability for setting next feature index. | |
#define | OLCStringsAsUTF8 "StringsAsUTF8" |
Layer capability for strings returned with UTF-8 encoding. | |
#define | OLCIgnoreFields "IgnoreFields" |
Layer capability for field ignoring. | |
#define | OLCCreateGeomField "CreateGeomField" |
Layer capability for geometry field creation. | |
#define | OLCCurveGeometries "CurveGeometries" |
Layer capability for curve geometries support. | |
#define | OLCMeasuredGeometries "MeasuredGeometries" |
Layer capability for measured geometries support. | |
#define | ODsCCreateLayer "CreateLayer" |
Dataset capability for layer creation. | |
#define | ODsCDeleteLayer "DeleteLayer" |
Dataset capability for layer deletion. | |
#define | ODsCCreateGeomFieldAfterCreateLayer "CreateGeomFieldAfterCreateLayer" |
Dataset capability for geometry field creation support. | |
#define | ODsCCurveGeometries "CurveGeometries" |
Dataset capability for curve geometries support. | |
#define | ODsCTransactions "Transactions" |
Dataset capability for dataset transcations. | |
#define | ODsCEmulatedTransactions "EmulatedTransactions" |
Dataset capability for emulated dataset transactions. | |
#define | ODsCMeasuredGeometries "MeasuredGeometries" |
Dataset capability for measured geometries support. | |
#define | ODsCRandomLayerRead "RandomLayerRead" |
Dataset capability for GetNextFeature() returning features from random layers. | |
#define | ODsCRandomLayerWrite "RandomLayerWrite " |
Dataset capability for supporting CreateFeature on layer in random order. | |
#define | ODrCCreateDataSource "CreateDataSource" |
Driver capability for datasource creation. | |
#define | ODrCDeleteDataSource "DeleteDataSource" |
Driver capability for datasource deletion. | |
#define | OLMD_FID64 "OLMD_FID64" |
Capability set to YES as metadata on a layer that has features with 64 bit identifiers. More... | |
Typedefs | |
typedef int | OGRErr |
Simple container for a bounding region. More... | |
typedef int | OGRBoolean |
Type for a OGR boolean. | |
typedef enum ogr_style_tool_class_id | OGRSTClassId |
OGRStyleTool derived class types (returned by GetType()). | |
typedef enum ogr_style_tool_units_id | OGRSTUnitId |
List of units supported by OGRStyleTools. | |
typedef enum ogr_style_tool_param_pen_id | OGRSTPenParam |
List of parameters for use with OGRStylePen. | |
typedef enum ogr_style_tool_param_brush_id | OGRSTBrushParam |
List of parameters for use with OGRStyleBrush. | |
typedef enum ogr_style_tool_param_symbol_id | OGRSTSymbolParam |
List of parameters for use with OGRStyleSymbol. | |
typedef enum ogr_style_tool_param_label_id | OGRSTLabelParam |
List of parameters for use with OGRStyleLabel. | |
Functions | |
const char * | OGRGeometryTypeToName (OGRwkbGeometryType eType) |
Fetch a human readable name corresponding to an OGRwkbGeometryType value. More... | |
OGRwkbGeometryType | OGRMergeGeometryTypes (OGRwkbGeometryType eMain, OGRwkbGeometryType eExtra) |
Find common geometry type. More... | |
OGRwkbGeometryType | OGRMergeGeometryTypesEx (OGRwkbGeometryType eMain, OGRwkbGeometryType eExtra, int bAllowPromotingToCurves) |
Find common geometry type. More... | |
OGRwkbGeometryType | OGR_GT_Flatten (OGRwkbGeometryType eType) |
Returns the 2D geometry type corresponding to the passed geometry type. More... | |
OGRwkbGeometryType | OGR_GT_SetZ (OGRwkbGeometryType eType) |
Returns the 3D geometry type corresponding to the passed geometry type. More... | |
OGRwkbGeometryType | OGR_GT_SetM (OGRwkbGeometryType eType) |
Returns the measured geometry type corresponding to the passed geometry type. More... | |
OGRwkbGeometryType | OGR_GT_SetModifier (OGRwkbGeometryType eType, int bSetZ, int bSetM) |
Returns a XY, XYZ, XYM or XYZM geometry type depending on parameter. More... | |
int | OGR_GT_HasZ (OGRwkbGeometryType eType) |
Return if the geometry type is a 3D geometry type. More... | |
int | OGR_GT_HasM (OGRwkbGeometryType eType) |
Return if the geometry type is a measured type. More... | |
int | OGR_GT_IsSubClassOf (OGRwkbGeometryType eType, OGRwkbGeometryType eSuperType) |
Returns if a type is a subclass of another one. More... | |
int | OGR_GT_IsCurve (OGRwkbGeometryType) |
Return if a geometry type is an instance of Curve. More... | |
int | OGR_GT_IsSurface (OGRwkbGeometryType) |
Return if a geometry type is an instance of Surface. More... | |
int | OGR_GT_IsNonLinear (OGRwkbGeometryType) |
Return if a geometry type is a non-linear geometry type. More... | |
OGRwkbGeometryType | OGR_GT_GetCollection (OGRwkbGeometryType eType) |
Returns the collection type that can contain the passed geometry type. More... | |
OGRwkbGeometryType | OGR_GT_GetCurve (OGRwkbGeometryType eType) |
Returns the curve geometry type that can contain the passed geometry type. More... | |
OGRwkbGeometryType | OGR_GT_GetLinear (OGRwkbGeometryType eType) |
Returns the non-curve geometry type that can contain the passed geometry type. More... | |
int | OGR_GET_MS (float fSec) |
Return the number of milliseconds from a datetime with decimal seconds. | |
int | OGRParseDate (const char *pszInput, OGRField *psOutput, int nOptions) |
Parse date string. More... | |
Core portability services for cross-platform OGR code.
#define ALTER_ALL_FLAG (ALTER_NAME_FLAG | ALTER_TYPE_FLAG | ALTER_WIDTH_PRECISION_FLAG | ALTER_NULLABLE_FLAG | ALTER_DEFAULT_FLAG) |
Alter all parameters of field definition.
Used by OGR_L_AlterFieldDefn().
#define ALTER_DEFAULT_FLAG 0x10 |
#define ALTER_NAME_FLAG 0x1 |
Alter field name.
Used by OGR_L_AlterFieldDefn().
#define ALTER_NULLABLE_FLAG 0x8 |
#define ALTER_TYPE_FLAG 0x2 |
Alter field type.
Used by OGR_L_AlterFieldDefn().
#define ALTER_WIDTH_PRECISION_FLAG 0x4 |
Alter field width and precision.
Used by OGR_L_AlterFieldDefn().
#define OGR_F_VAL_ALL (0x7FFFFFFF & ~OGR_F_VAL_ALLOW_DIFFERENT_GEOM_DIM) |
Enable all validation tests (except OGR_F_VAL_ALLOW_DIFFERENT_GEOM_DIM) Used by OGR_F_Validate().
#define OGR_F_VAL_ALLOW_DIFFERENT_GEOM_DIM 0x00000010 |
Allow geometry fields to have a different coordinate dimension that their geometry column type.
This flag only makes sense if OGR_F_VAL_GEOM_TYPE is set too. Used by OGR_F_Validate().
#define OGR_F_VAL_ALLOW_NULL_WHEN_DEFAULT 0x00000008 |
Allow fields that are null when there's an associated default value.
This can be used for drivers where the low-level layers will automatically set the field value to the associated default value. This flag only makes sense if OGR_F_VAL_NULL is set too. Used by OGR_F_Validate().
#define OGR_F_VAL_GEOM_TYPE 0x00000002 |
#define OGR_F_VAL_NULL 0x00000001 |
#define OGR_F_VAL_WIDTH 0x00000004 |
#define OGRERR_NON_EXISTING_FEATURE 9 |
Non existing feature.
Added in GDAL 2.0
#define OGRNullMarker -21122 |
Special value set in OGRField.Set.nMarker1, nMarker2 and nMarker3 for a null field.
Direct use of this value is strongly discouraged. Use OGR_RawField_SetNull() or OGR_RawField_IsNull() instead.
#define OGRUnsetMarker -21121 |
Special value set in OGRField.Set.nMarker1, nMarker2 and nMarker3 for a unset field.
Direct use of this value is strongly discouraged. Use OGR_RawField_SetUnset() or OGR_RawField_IsUnset() instead.
#define OLMD_FID64 "OLMD_FID64" |
Capability set to YES as metadata on a layer that has features with 64 bit identifiers.
#define wkb25DBit 0x80000000 |
#define wkbHasM | ( | x | ) | (OGR_GT_HasM(x) != 0) |
Return if the geometry type is a measured geometry type.
#define wkbHasZ | ( | x | ) | (OGR_GT_HasZ(x) != 0) |
Return if the geometry type is a 3D geometry type.
#define wkbSetM | ( | x | ) | OGR_GT_SetM(x) |
Return the measured geometry type corresponding to the specified geometry type.
#define wkbSetZ | ( | x | ) | OGR_GT_SetZ(x) |
Return the 3D geometry type corresponding to the specified geometry type.
typedef int OGRErr |
Simple container for a bounding region.
Type for a OGR error
OGRStyleTool derived class types (returned by GetType()).
Enumerator | |
---|---|
OGRSTCNone | None. |
OGRSTCPen | Pen. |
OGRSTCBrush | Brush. |
OGRSTCSymbol | Symbol. |
OGRSTCLabel | Label. |
OGRSTCVector | Vector. |
List of parameters for use with OGRStyleLabel.
List of parameters for use with OGRStyleSymbol.
enum OGRFieldSubType |
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.
enum OGRFieldType |
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.
enum OGRwkbByteOrder |
enum OGRwkbGeometryType |
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.
enum OGRwkbVariant |
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: 09-009_Committee_Draft_ISOIEC_CD_13249-3_SQLMM_Spatial.pdf, 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 OGC 06-103r4 "OpenGIS® Implementation Standard for Geographic information - Simple feature access - Part 1: Common architecture", v1.2.1
OGRwkbGeometryType OGR_GT_Flatten | ( | OGRwkbGeometryType | eType | ) |
Returns the 2D geometry type corresponding to the passed geometry type.
This function is intended to work with geometry types as old-style 99-402 extended dimension (Z) WKB types, as well as with newer SFSQL 1.2 and ISO SQL/MM Part 3 extended dimension (Z&M) WKB types.
eType | Input geometry type |
OGRwkbGeometryType OGR_GT_GetCollection | ( | OGRwkbGeometryType | eType | ) |
Returns the collection type that can contain the passed geometry type.
Handled conversions are : wkbNone->wkbNone, wkbPoint -> wkbMultiPoint, wkbLineString->wkbMultiLineString, wkbPolygon/wkbTriangle/wkbPolyhedralSurface/wkbTIN->wkbMultiPolygon, wkbCircularString->wkbMultiCurve, wkbCompoundCurve->wkbMultiCurve, wkbCurvePolygon->wkbMultiSurface. In other cases, wkbUnknown is returned
Passed Z, M, ZM flag is preserved.
eType | Input geometry type |
OGRwkbGeometryType OGR_GT_GetCurve | ( | OGRwkbGeometryType | eType | ) |
Returns the curve geometry type that can contain the passed geometry type.
Handled conversions are : wkbPolygon -> wkbCurvePolygon, wkbLineString->wkbCompoundCurve, wkbMultiPolygon->wkbMultiSurface and wkbMultiLineString->wkbMultiCurve. In other cases, the passed geometry is returned.
Passed Z, M, ZM flag is preserved.
eType | Input geometry type |
OGRwkbGeometryType OGR_GT_GetLinear | ( | OGRwkbGeometryType | eType | ) |
Returns the non-curve geometry type that can contain the passed geometry type.
Handled conversions are : wkbCurvePolygon -> wkbPolygon, wkbCircularString->wkbLineString, wkbCompoundCurve->wkbLineString, wkbMultiSurface->wkbMultiPolygon and wkbMultiCurve->wkbMultiLineString. In other cases, the passed geometry is returned.
Passed Z, M, ZM flag is preserved.
eType | Input geometry type |
int OGR_GT_HasM | ( | OGRwkbGeometryType | eType | ) |
Return if the geometry type is a measured type.
eType | Input geometry type |
int OGR_GT_HasZ | ( | OGRwkbGeometryType | eType | ) |
Return if the geometry type is a 3D geometry type.
eType | Input geometry type |
int OGR_GT_IsCurve | ( | OGRwkbGeometryType | eGeomType | ) |
Return if a geometry type is an instance of Curve.
Such geometry type are wkbLineString, wkbCircularString, wkbCompoundCurve and their Z/M/ZM variant.
eGeomType | the geometry type |
int OGR_GT_IsNonLinear | ( | OGRwkbGeometryType | eGeomType | ) |
Return if a geometry type is a non-linear geometry type.
Such geometry type are wkbCurve, wkbCircularString, wkbCompoundCurve, wkbSurface, wkbCurvePolygon, wkbMultiCurve, wkbMultiSurface and their Z/M variants.
eGeomType | the geometry type |
int OGR_GT_IsSubClassOf | ( | OGRwkbGeometryType | eType, |
OGRwkbGeometryType | eSuperType | ||
) |
Returns if a type is a subclass of another one.
eType | Type. |
eSuperType | Super type |
int OGR_GT_IsSurface | ( | OGRwkbGeometryType | eGeomType | ) |
Return if a geometry type is an instance of Surface.
Such geometry type are wkbCurvePolygon and wkbPolygon and their Z/M/ZM variant.
eGeomType | the geometry type |
OGRwkbGeometryType OGR_GT_SetM | ( | OGRwkbGeometryType | eType | ) |
Returns the measured geometry type corresponding to the passed geometry type.
eType | Input geometry type |
OGRwkbGeometryType OGR_GT_SetModifier | ( | OGRwkbGeometryType | eType, |
int | bHasZ, | ||
int | bHasM | ||
) |
Returns a XY, XYZ, XYM or XYZM geometry type depending on parameter.
eType | Input geometry type |
bHasZ | TRUE if the output geometry type must be 3D. |
bHasM | TRUE if the output geometry type must be measured. |
OGRwkbGeometryType OGR_GT_SetZ | ( | OGRwkbGeometryType | eType | ) |
Returns the 3D geometry type corresponding to the passed geometry type.
eType | Input geometry type |
const char* OGRGeometryTypeToName | ( | OGRwkbGeometryType | eType | ) |
Fetch a human readable name corresponding to an OGRwkbGeometryType value.
The returned value should not be modified, or freed by the application.
This function is C callable.
eType | the geometry type. |
OGRwkbGeometryType OGRMergeGeometryTypes | ( | OGRwkbGeometryType | eMain, |
OGRwkbGeometryType | eExtra | ||
) |
Find common geometry type.
Given two geometry types, find the most specific common type. Normally used repeatedly with the geometries in a layer to try and establish the most specific geometry type that can be reported for the layer.
NOTE: wkbUnknown is the "worst case" indicating a mixture of geometry types with nothing in common but the base geometry type. wkbNone should be used to indicate that no geometries have been encountered yet, and means the first geometry encountered will establish the preliminary type.
eMain | the first input geometry type. |
eExtra | the second input geometry type. |
OGRwkbGeometryType OGRMergeGeometryTypesEx | ( | OGRwkbGeometryType | eMain, |
OGRwkbGeometryType | eExtra, | ||
int | bAllowPromotingToCurves | ||
) |
Find common geometry type.
Given two geometry types, find the most specific common type. Normally used repeatedly with the geometries in a layer to try and establish the most specific geometry type that can be reported for the layer.
NOTE: wkbUnknown is the "worst case" indicating a mixture of geometry types with nothing in common but the base geometry type. wkbNone should be used to indicate that no geometries have been encountered yet, and means the first geometry encountered will establish the preliminary type.
If bAllowPromotingToCurves is set to TRUE, mixing Polygon and CurvePolygon will return CurvePolygon. Mixing LineString, CircularString, CompoundCurve will return CompoundCurve. Mixing MultiPolygon and MultiSurface will return MultiSurface. Mixing MultiCurve and MultiLineString will return MultiCurve.
eMain | the first input geometry type. |
eExtra | the second input geometry type. |
bAllowPromotingToCurves | determine if promotion to curve type must be done. |
int OGRParseDate | ( | const char * | pszInput, |
OGRField * | psField, | ||
int | nOptions | ||
) |
Parse date string.
This function attempts to parse a date string in a variety of formats into the OGRField.Date format suitable for use with OGR. Generally speaking this function is expecting values like:
YYYY-MM-DD HH:MM:SS[.sss]+nn or YYYY-MM-DDTHH:MM:SS[.sss]Z (ISO 8601 format) or YYYY-MM-DDZ
The seconds may also have a decimal portion (which is ignored). And just dates (YYYY-MM-DD) or just times (HH:MM:SS[.sss]) are also supported. The date may also be in YYYY/MM/DD format. If the year is less than 100 and greater than 30 a "1900" century value will be set. If it is less than 30 and greater than -1 then a "2000" century value will be set. In the future this function may be generalized, and additional control provided through nOptions, but an nOptions value of "0" should always do a reasonable default form of processing.
The value of psField will be indeterminate if the function fails (returns FALSE).
pszInput | the input date string. |
psField | the OGRField that will be updated with the parsed result. |
nOptions | parsing options, for now always 0. |