OGR
Classes | Macros | Typedefs | Enumerations | Functions
ogr_core.h File Reference
#include "cpl_port.h"
#include "gdal_version.h"

Go to the source code of this file.

Classes

class  OGREnvelope
 
class  OGREnvelope3D
 
union  OGRField
 

Macros

#define wkb25DBit   0x80000000
 
#define wkbFlatten(x)   OGR_GT_Flatten((OGRwkbGeometryType)(x))
 
#define wkbHasZ(x)    (OGR_GT_HasZ(x) != 0)
 
#define wkbSetZ(x)    OGR_GT_SetZ(x)
 
#define wkbHasM(x)    (OGR_GT_HasM(x) != 0)
 
#define wkbSetM(x)    OGR_GT_SetM(x)
 
#define ALTER_NAME_FLAG   0x1
 
#define ALTER_TYPE_FLAG   0x2
 
#define ALTER_WIDTH_PRECISION_FLAG   0x4
 
#define ALTER_NULLABLE_FLAG   0x8
 
#define ALTER_DEFAULT_FLAG   0x10
 
#define ALTER_ALL_FLAG   (ALTER_NAME_FLAG | ALTER_TYPE_FLAG | ALTER_WIDTH_PRECISION_FLAG | ALTER_NULLABLE_FLAG | ALTER_DEFAULT_FLAG)
 
#define OGR_F_VAL_NULL   0x00000001
 
#define OGR_F_VAL_GEOM_TYPE   0x00000002
 
#define OGR_F_VAL_WIDTH   0x00000004
 
#define OGR_F_VAL_ALLOW_NULL_WHEN_DEFAULT   0x00000008
 
#define OGR_F_VAL_ALLOW_DIFFERENT_GEOM_DIM   0x00000010
 
#define OGR_F_VAL_ALL   (0x7FFFFFFF & ~OGR_F_VAL_ALLOW_DIFFERENT_GEOM_DIM)
 
#define OLMD_FID64   "OLMD_FID64"
 
#define GDAL_CHECK_VERSION(pszCallingComponentName)   GDALCheckVersion(GDAL_VERSION_MAJOR, GDAL_VERSION_MINOR, pszCallingComponentName)
 

Typedefs

typedef enum ogr_style_tool_class_id OGRSTClassId
 
typedef enum ogr_style_tool_units_id OGRSTUnitId
 
typedef enum ogr_style_tool_param_pen_id OGRSTPenParam
 
typedef enum ogr_style_tool_param_brush_id OGRSTBrushParam
 
typedef enum ogr_style_tool_param_symbol_id OGRSTSymbolParam
 
typedef enum ogr_style_tool_param_label_id OGRSTLabelParam
 

Enumerations

Functions

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. 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 CPL_STDCALL GDALCheckVersion (int nVersionMajor, int nVersionMinor, const char *pszCallingComponentName)
 

Detailed Description

Core portability services for cross-platform OGR code.

Macro Definition Documentation

Alter all parameters of field definition. Used by OGR_L_AlterFieldDefn().

#define ALTER_DEFAULT_FLAG   0x10

Alter field DEFAULT value. Used by OGR_L_AlterFieldDefn().

Since
GDAL 2.0
#define ALTER_NAME_FLAG   0x1

Alter field name. Used by OGR_L_AlterFieldDefn().

#define ALTER_NULLABLE_FLAG   0x8

Alter field NOT NULL constraint. Used by OGR_L_AlterFieldDefn().

Since
GDAL 2.0
#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 GDAL_CHECK_VERSION (   pszCallingComponentName)    GDALCheckVersion(GDAL_VERSION_MAJOR, GDAL_VERSION_MINOR, pszCallingComponentName)

Helper macro for GDALCheckVersion

#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().

Since
GDAL 2.0
#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().

Since
GDAL 2.1

Referenced by OGRFeature::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().

Since
GDAL 2.0

Referenced by OGRFeature::Validate().

#define OGR_F_VAL_GEOM_TYPE   0x00000002

Validate that geometries respect geometry column type. Used by OGR_F_Validate().

Since
GDAL 2.0

Referenced by OGRFeature::Validate().

#define OGR_F_VAL_NULL   0x00000001

Validate that fields respect not-null constraints. Used by OGR_F_Validate().

Since
GDAL 2.0

Referenced by OGRFeature::Validate().

#define OGR_F_VAL_WIDTH   0x00000004

Validate that (string) fields respect field width. Used by OGR_F_Validate().

Since
GDAL 2.0

Referenced by OGRFeature::Validate().

#define OLMD_FID64   "OLMD_FID64"

Capability set to YES as metadata on a layer that has features with 64 bit identifiers.

Since
GDAL 2.0
#define wkb25DBit   0x80000000
Deprecated:
in GDAL 2.0. Use wkbHasZ() or wkbSetZ() instead
#define wkbFlatten (   x)    OGR_GT_Flatten((OGRwkbGeometryType)(x))

Return the 2D geometry type corresponding to the specified geometry type

Referenced by OGRCompoundCurve::addCurveDirectly(), OGRCurvePolygon::addRing(), OGRGeometry::Centroid(), OGRGeometryCollection::closeRings(), OGRCurvePolygon::Contains(), OGRGeometryFactory::createFromFgf(), OGRGeometryFactory::createGeometry(), OGRGeometry::dumpReadable(), OGRPoint::exportToWkb(), OGRSimpleCurve::exportToWkb(), OGRPolygon::exportToWkb(), OGRGeometryCollection::exportToWkb(), OGRGeometryFactory::forceTo(), OGRGeometryFactory::forceToLineString(), OGRGeometryFactory::forceToMultiLineString(), OGRGeometryFactory::forceToMultiPoint(), OGRGeometryFactory::forceToMultiPolygon(), OGRGeometryFactory::forceToPolygon(), OGRGeometryCollection::get_Area(), OGRGeometryCollection::get_Length(), OGRPolygon::getCurveGeometry(), OGRMultiPolygon::getGeometryName(), OGRMultiPoint::getGeometryName(), OGRMultiLineString::getGeometryName(), OGRGeometry::getIsoGeometryType(), OGRMultiCurve::importFromWkt(), OGRPoint::Intersects(), OGRCurvePolygon::Intersects(), OGR_G_AddGeometry(), OGR_G_AddGeometryDirectly(), OGR_G_AddPoint(), OGR_G_AddPoint_2D(), OGR_G_AddPointM(), OGR_G_AddPointZM(), OGR_G_Area(), OGR_G_Centroid(), OGR_G_Distance(), OGR_G_GetGeometryCount(), OGR_G_GetGeometryRef(), OGR_G_GetM(), OGR_G_GetPoint(), OGR_G_GetPointCount(), OGR_G_GetPoints(), OGR_G_GetPointsZM(), OGR_G_GetPointZM(), OGR_G_GetX(), OGR_G_GetY(), OGR_G_GetZ(), OGR_G_IsRing(), OGR_G_Length(), OGR_G_PointOnSurface(), OGR_G_RemoveGeometry(), OGR_G_SetPoint(), OGR_G_SetPoint_2D(), OGR_G_SetPointCount(), OGR_G_SetPointM(), OGR_G_SetPoints(), OGR_G_SetPointsZM(), OGR_G_SetPointZM(), OGR_GT_GetCollection(), OGR_GT_GetCurve(), OGR_GT_GetLinear(), OGR_GT_IsNonLinear(), OGR_GT_IsSubClassOf(), OGR_GT_SetModifier(), OGR_L_SetIgnoredFields(), OGR_L_SetSpatialFilterRectEx(), OGRBuildPolygonFromEdges(), OGRGeometryTypeToName(), OGRMergeGeometryTypesEx(), OGRSetGenerate_DB2_V72_BYTE_ORDER(), OGRCurveCollection::operator=(), OGRGeometryFactory::organizePolygons(), OGRGeometry::Polygonize(), OGRGeometry::swapXY(), OGRGenSQLResultsLayer::TestCapability(), OGRFeature::Validate(), and OGRPoint::Within().

#define wkbHasM (   x)    (OGR_GT_HasM(x) != 0)

Return if the geometry type is a measured geometry type

Since
GDAL 2.1

Referenced by OGR_GT_GetCollection(), OGR_GT_GetCurve(), OGR_GT_GetLinear(), OGRGeometryTypeToName(), OGRMergeGeometryTypesEx(), and OGRGeometry::swapXY().

#define wkbHasZ (   x)    (OGR_GT_HasZ(x) != 0)
#define wkbSetM (   x)    OGR_GT_SetM(x)

Return the measured geometry type corresponding to the specified geometry type.

Since
GDAL 2.1

Referenced by OGR_G_IsRing(), OGR_GT_GetCollection(), OGR_GT_GetCurve(), and OGR_GT_GetLinear().

#define wkbSetZ (   x)    OGR_GT_SetZ(x)

Return the 3D geometry type corresponding to the specified geometry type.

Since
GDAL 2.0

Referenced by OGR_G_IsRing(), OGR_GT_GetCollection(), OGR_GT_GetCurve(), OGR_GT_GetLinear(), and OGRFeature::Validate().

Typedef Documentation

List of parameters for use with OGRStyleBrush.

OGRStyleTool derived class types (returned by GetType()).

List of parameters for use with OGRStyleLabel.

List of parameters for use with OGRStylePen.

List of parameters for use with OGRStyleSymbol.

List of units supported by OGRStyleTools.

Enumeration Type Documentation

OGRStyleTool derived class types (returned by GetType()).

List of parameters for use with OGRStyleBrush.

List of parameters for use with OGRStyleLabel.

List of parameters for use with OGRStylePen.

List of parameters for use with OGRStyleSymbol.

List of units supported by OGRStyleTools.

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
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.

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
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 

deprecated

OFTBinary 

Raw Binary data

OFTDate 

Date

OFTTime 

Time

OFTDateTime 

Date and Time

OFTInteger64 

Single 64bit integer

OFTInteger64List 

List of 64bit integers

Display justification for field values.

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
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

wkbMultiLineString 

GeometryCollection of LineStrings, 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

wkbCurve 

Curve (abstract type). ISO SQL/MM Part 3. GDAL >= 2.1

wkbSurface 

Surface (abstract type). ISO SQL/MM Part 3. GDAL >= 2.1

wkbPolyhedralSurface 

a contiguous collection of polygons, which share common boundary segments, ISO SQL/MM Part 3. Reserved in GDAL >= 2.1 but not yet implemented

wkbTIN 

a PolyhedralSurface consisting only of Triangle patches ISO SQL/MM Part 3. Reserved in GDAL >= 2.1 but not yet implemented

wkbNone 

< a Triangle. ISO SQL/MM Part 3. Reserved in GDAL >= 2.1 but not yet implemented 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. Reserved in GDAL >= 2.1 but not yet implemented

wkbTINZ 

ISO SQL/MM Part 3. Reserved in GDAL >= 2.1 but not yet implemented

wkbTriangleZ 

ISO SQL/MM Part 3. Reserved in GDAL >= 2.1 but not yet implemented

wkbPointM 

ISO SQL/MM Part 3. GDAL >= 2.1

wkbLineStringM 

ISO SQL/MM Part 3. GDAL >= 2.1

wkbPolygonM 

ISO SQL/MM Part 3. GDAL >= 2.1

wkbMultiPointM 

ISO SQL/MM Part 3. GDAL >= 2.1

wkbMultiLineStringM 

ISO SQL/MM Part 3. GDAL >= 2.1

wkbMultiPolygonM 

ISO SQL/MM Part 3. GDAL >= 2.1

wkbGeometryCollectionM 

ISO SQL/MM Part 3. GDAL >= 2.1

wkbCircularStringM 

ISO SQL/MM Part 3. GDAL >= 2.1

wkbCompoundCurveM 

ISO SQL/MM Part 3. GDAL >= 2.1

wkbCurvePolygonM 

ISO SQL/MM Part 3. GDAL >= 2.1

wkbMultiCurveM 

ISO SQL/MM Part 3. GDAL >= 2.1

wkbMultiSurfaceM 

ISO SQL/MM Part 3. GDAL >= 2.1

wkbCurveM 

ISO SQL/MM Part 3. GDAL >= 2.1

wkbSurfaceM 

ISO SQL/MM Part 3. GDAL >= 2.1

wkbPolyhedralSurfaceM 

ISO SQL/MM Part 3. Reserved in GDAL >= 2.1 but not yet implemented

wkbTINM 

ISO SQL/MM Part 3. Reserved in GDAL >= 2.1 but not yet implemented

wkbTriangleM 

ISO SQL/MM Part 3. Reserved in GDAL >= 2.1 but not yet implemented

wkbPointZM 

ISO SQL/MM Part 3. GDAL >= 2.1

wkbLineStringZM 

ISO SQL/MM Part 3. GDAL >= 2.1

wkbPolygonZM 

ISO SQL/MM Part 3. GDAL >= 2.1

wkbMultiPointZM 

ISO SQL/MM Part 3. GDAL >= 2.1

wkbMultiLineStringZM 

ISO SQL/MM Part 3. GDAL >= 2.1

wkbMultiPolygonZM 

ISO SQL/MM Part 3. GDAL >= 2.1

wkbGeometryCollectionZM 

ISO SQL/MM Part 3. GDAL >= 2.1

wkbCircularStringZM 

ISO SQL/MM Part 3. GDAL >= 2.1

wkbCompoundCurveZM 

ISO SQL/MM Part 3. GDAL >= 2.1

wkbCurvePolygonZM 

ISO SQL/MM Part 3. GDAL >= 2.1

wkbMultiCurveZM 

ISO SQL/MM Part 3. GDAL >= 2.1

wkbMultiSurfaceZM 

ISO SQL/MM Part 3. GDAL >= 2.1

wkbCurveZM 

ISO SQL/MM Part 3. GDAL >= 2.1

wkbSurfaceZM 

ISO SQL/MM Part 3. GDAL >= 2.1

wkbPolyhedralSurfaceZM 

ISO SQL/MM Part 3. Reserved in GDAL >= 2.1 but not yet implemented

wkbTINZM 

ISO SQL/MM Part 3. Reserved in GDAL >= 2.1 but not yet implemented

wkbTriangleZM 

ISO SQL/MM Part 3. Reserved in GDAL >= 2.1 but not yet implemented

wkbPoint25D 

2.5D extension as per 99-402

wkbLineString25D 

2.5D extension as per 99-402

wkbPolygon25D 

2.5D extension as per 99-402

wkbMultiPoint25D 

2.5D extension as per 99-402

wkbMultiLineString25D 

2.5D extension as per 99-402

wkbMultiPolygon25D 

2.5D extension as per 99-402

wkbGeometryCollection25D 

2.5D extension as per 99-402

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

Enumerator
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

Function Documentation

int CPL_STDCALL GDALCheckVersion ( int  nVersionMajor,
int  nVersionMinor,
const char *  pszCallingComponentName 
)

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

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

Parameters
nVersionMajorMajor version to be tested against
nVersionMinorMinor version to be tested against
pszCallingComponentNameIf not NULL, in case of version mismatch, the method will issue a failure mentioning the name of the calling component.
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.

Parameters
eTypeInput geometry type
Returns
2D geometry type corresponding to the passed geometry type.
Since
GDAL 2.0
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->wkbMultiPolygon, wkbCircularString->wkbMultiCurve, wkbCompoundCurve->wkbMultiCurve, wkbCurvePolygon->wkbMultiSurface. In other cases, wkbUnknown is returned

Passed Z, M, ZM flag is preserved.

Parameters
eTypeInput geometry type
Returns
the collection type that can contain the passed geometry type or wkbUnknown
Since
GDAL 2.0

References OGR_GT_IsCurve(), OGR_GT_IsSurface(), wkbFlatten, wkbHasM, wkbHasZ, wkbLineString, wkbMultiCurve, wkbMultiLineString, wkbMultiPoint, wkbMultiPolygon, wkbMultiSurface, wkbNone, wkbPoint, wkbPolygon, wkbSetM, wkbSetZ, and wkbUnknown.

Referenced by OGRGeometryFactory::forceTo().

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.

Parameters
eTypeInput geometry type
Returns
the curve type that can contain the passed geometry type
Since
GDAL 2.0

References wkbCompoundCurve, wkbCurvePolygon, wkbFlatten, wkbHasM, wkbHasZ, wkbLineString, wkbMultiCurve, wkbMultiLineString, wkbMultiPolygon, wkbMultiSurface, wkbPolygon, wkbSetM, and wkbSetZ.

Referenced by OGRGeometryCollection::getCurveGeometry().

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.

Parameters
eTypeInput geometry type
Returns
the non-curve type that can contain the passed geometry type
Since
GDAL 2.0

References OGR_GT_IsCurve(), OGR_GT_IsSurface(), wkbFlatten, wkbHasM, wkbHasZ, wkbLineString, wkbMultiCurve, wkbMultiLineString, wkbMultiPolygon, wkbMultiSurface, wkbPolygon, wkbSetM, and wkbSetZ.

Referenced by OGRGeometryCollection::getLinearGeometry(), OGR_F_GetGeometryRef(), OGR_F_GetGeomFieldRef(), OGR_FD_GetGeomType(), OGR_GFld_GetType(), OGR_L_GetGeomType(), and OGR_L_GetNextFeature().

int OGR_GT_HasM ( OGRwkbGeometryType  eType)

Return if the geometry type is a measured type.

Parameters
eTypeInput geometry type
Returns
TRUE if the geometry type is a measured type.
Since
GDAL 2.1

Referenced by OGR_GT_SetM(), and OGR_L_GetNextFeature().

int OGR_GT_HasZ ( OGRwkbGeometryType  eType)

Return if the geometry type is a 3D geometry type.

Parameters
eTypeInput geometry type
Returns
TRUE if the geometry type is a 3D geometry type.
Since
GDAL 2.0

Referenced by OGR_GT_SetZ().

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.

Parameters
eGeomTypethe geometry type
Returns
TRUE if the geometry type is an instance of Curve
Since
GDAL 2.0

References OGR_GT_IsSubClassOf(), and wkbCurve.

Referenced by OGRGeometryFactory::forceTo(), OGRGeometryFactory::forceToPolygon(), OGRGeometryCollection::get_Area(), OGRGeometryCollection::get_Length(), OGRMultiCurve::getGeometryName(), OGR_G_AddGeometry(), OGR_G_AddGeometryDirectly(), OGR_G_Area(), OGR_G_GetPointCount(), OGR_G_Length(), OGR_G_Value(), OGR_GT_GetCollection(), OGR_GT_GetLinear(), OGRMergeGeometryTypesEx(), OGRCurveCollection::operator=(), and OGRGeometry::swapXY().

int OGR_GT_IsNonLinear ( OGRwkbGeometryType  eGeomType)

Return if a geometry type is a non-linear geometry type.

Such geometry type are wkbCircularString, wkbCompoundCurve, wkbCurvePolygon, wkbMultiCurve, wkbMultiSurface and their 3D variant.

Parameters
eGeomTypethe geometry type
Returns
TRUE if the geometry type is a non-linear geometry type.
Since
GDAL 2.0

References CPLError(), OGRGeometry::getGeometryName(), wkbCircularString, wkbCompoundCurve, wkbCurvePolygon, wkbFlatten, wkbMultiCurve, and wkbMultiSurface.

Referenced by OGR_F_GetGeometryRef(), OGR_F_GetGeomFieldRef(), OGR_FD_GetGeomType(), OGR_GFld_GetType(), OGR_L_GetGeomType(), and OGR_L_GetNextFeature().

int OGR_GT_IsSubClassOf ( OGRwkbGeometryType  eType,
OGRwkbGeometryType  eSuperType 
)
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.

Parameters
eGeomTypethe geometry type
Returns
TRUE if the geometry type is an instance of Surface
Since
GDAL 2.0

References OGR_GT_IsSubClassOf(), and wkbSurface.

Referenced by OGRGeometryCollection::get_Area(), OGRMultiSurface::getGeometryName(), OGR_G_Area(), OGR_GT_GetCollection(), and OGR_GT_GetLinear().

OGRwkbGeometryType OGR_GT_SetM ( OGRwkbGeometryType  eType)

Returns the measured geometry type corresponding to the passed geometry type.

Parameters
eTypeInput geometry type
Returns
measured geometry type corresponding to the passed geometry type.
Since
GDAL 2.1

References OGR_GT_HasM(), and wkbNone.

Referenced by OGR_GT_SetModifier().

OGRwkbGeometryType OGR_GT_SetModifier ( OGRwkbGeometryType  eType,
int  bHasZ,
int  bHasM 
)

Returns a XY, XYZ, XYM or XYZM geometry type depending on parameter.

Parameters
eTypeInput geometry type
bHasZTRUE if the output geometry type must be 3D.
bHasMTRUE if the output geometry type must be measured.
Returns
Output geometry type.
Since
GDAL 2.0

References OGR_GT_SetM(), OGR_GT_SetZ(), and wkbFlatten.

Referenced by OGRMergeGeometryTypesEx().

OGRwkbGeometryType OGR_GT_SetZ ( OGRwkbGeometryType  eType)

Returns the 3D geometry type corresponding to the passed geometry type.

Parameters
eTypeInput geometry type
Returns
3D geometry type corresponding to the passed geometry type.
Since
GDAL 2.0

References OGR_GT_HasZ(), wkbGeometryCollection, and wkbNone.

Referenced by OGR_GT_SetModifier().

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.

Parameters
eTypethe geometry type.
Returns
internal human readable string, or NULL on failure.

References wkbCircularString, wkbCompoundCurve, wkbCurve, wkbCurvePolygon, wkbFlatten, wkbGeometryCollection, wkbHasM, wkbHasZ, wkbLineString, wkbMultiCurve, wkbMultiLineString, wkbMultiPoint, wkbMultiPolygon, wkbMultiSurface, wkbNone, wkbPoint, wkbPolygon, wkbSurface, and wkbUnknown.

Referenced by OGRFeature::Validate().

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.

Parameters
eMainthe first input geometry type.
eExtrathe second input geometry type.
Returns
the merged geometry type.

References OGRMergeGeometryTypesEx().

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.

Parameters
eMainthe first input geometry type.
eExtrathe second input geometry type.
bAllowPromotingToCurvesdetermine if promotion to curve type must be done.
Returns
the merged geometry type.
Since
GDAL 2.0

References OGR_GT_IsCurve(), OGR_GT_IsSubClassOf(), OGR_GT_SetModifier(), wkbCompoundCurve, wkbFlatten, wkbGeometryCollection, wkbHasM, wkbHasZ, wkbNone, and wkbUnknown.

Referenced by OGRMergeGeometryTypes().


Generated for GDAL by doxygen 1.8.11.