31 #ifndef OGR_CORE_H_INCLUDED 32 #define OGR_CORE_H_INCLUDED 35 #include "gdal_version.h" 47 #if defined(__cplusplus) && !defined(CPL_SUPRESS_CPLUSPLUS) 51 OGREnvelope() : MinX(0.0), MaxX(0.0), MinY(0.0), MaxY(0.0)
56 MinX(oOther.MinX),MaxX(oOther.MaxX), MinY(oOther.MinY), MaxY(oOther.MaxY)
66 #if ((__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) && !defined(_MSC_VER)) 67 #pragma GCC diagnostic push 68 #pragma GCC diagnostic ignored "-Wfloat-equal" 70 int IsInit()
const {
return MinX != 0 || MinY != 0 || MaxX != 0 || MaxY != 0; }
72 #if ((__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) && !defined(_MSC_VER)) 73 #pragma GCC diagnostic pop 79 MinX = MIN(MinX,sOther.MinX);
80 MaxX = MAX(MaxX,sOther.MaxX);
81 MinY = MIN(MinY,sOther.MinY);
82 MaxY = MAX(MaxY,sOther.MaxY);
92 void Merge(
double dfX,
double dfY ) {
108 if(Intersects(sOther))
112 MinX = MAX(MinX,sOther.MinX);
113 MaxX = MIN(MaxX,sOther.MaxX);
114 MinY = MAX(MinY,sOther.MinY);
115 MaxY = MIN(MaxY,sOther.MaxY);
136 return MinX <= other.MaxX && MaxX >= other.MinX &&
137 MinY <= other.MaxY && MaxY >= other.MinY;
142 return MinX <= other.MinX && MinY <= other.MinY &&
143 MaxX >= other.MaxX && MaxY >= other.MaxY;
161 #if defined(__cplusplus) && !defined(CPL_SURESS_CPLUSPLUS) 171 MinZ(oOther.MinZ), MaxZ(oOther.MaxZ)
178 int IsInit()
const {
return MinX != 0 || MinY != 0 || MaxX != 0 || MaxY != 0 || MinZ != 0 || MaxZ != 0; }
182 MinX = MIN(MinX,sOther.MinX);
183 MaxX = MAX(MaxX,sOther.MaxX);
184 MinY = MIN(MinY,sOther.MinY);
185 MaxY = MAX(MaxY,sOther.MaxY);
186 MinZ = MIN(MinZ,sOther.MinZ);
187 MaxZ = MAX(MaxZ,sOther.MaxZ);
199 void Merge(
double dfX,
double dfY,
double dfZ ) {
202 MinX = MIN(MinX,dfX);
203 MaxX = MAX(MaxX,dfX);
204 MinY = MIN(MinY,dfY);
205 MaxY = MAX(MaxY,dfY);
206 MinZ = MIN(MinZ,dfZ);
207 MaxZ = MAX(MaxZ,dfZ);
218 if(Intersects(sOther))
222 MinX = MAX(MinX,sOther.MinX);
223 MaxX = MIN(MaxX,sOther.MaxX);
224 MinY = MAX(MinY,sOther.MinY);
225 MaxY = MIN(MaxY,sOther.MaxY);
226 MinZ = MAX(MinZ,sOther.MinZ);
227 MaxZ = MIN(MaxZ,sOther.MaxZ);
252 return MinX <= other.MaxX && MaxX >= other.MinX &&
253 MinY <= other.MaxY && MaxY >= other.MinY &&
254 MinZ <= other.MaxZ && MaxZ >= other.MinZ;
259 return MinX <= other.MinX && MinY <= other.MinY &&
260 MaxX >= other.MaxX && MaxY >= other.MaxY &&
261 MinZ <= other.MinZ && MaxZ >= other.MaxZ;
279 void CPL_DLL *OGRMalloc(
size_t );
280 void CPL_DLL *OGRCalloc(
size_t,
size_t );
281 void CPL_DLL *OGRRealloc(
void *,
size_t );
282 char CPL_DLL *OGRStrdup(
const char * );
283 void CPL_DLL OGRFree(
void * );
287 #define OGRERR_NONE 0 288 #define OGRERR_NOT_ENOUGH_DATA 1 289 #define OGRERR_NOT_ENOUGH_MEMORY 2 290 #define OGRERR_UNSUPPORTED_GEOMETRY_TYPE 3 291 #define OGRERR_UNSUPPORTED_OPERATION 4 292 #define OGRERR_CORRUPT_DATA 5 293 #define OGRERR_FAILURE 6 294 #define OGRERR_UNSUPPORTED_SRS 7 295 #define OGRERR_INVALID_HANDLE 8 296 #define OGRERR_NON_EXISTING_FEATURE 9 298 typedef int OGRBoolean;
354 #define wkbCurve ((OGRwkbGeometryType)13) 355 #define wkbSurface ((OGRwkbGeometryType)14) 380 #ifndef GDAL_COMPILATION 381 #define wkb25DBit 0x80000000 385 #define wkbFlatten(x) OGR_GT_Flatten((OGRwkbGeometryType)(x)) 390 #define wkbHasZ(x) OGR_GT_HasZ(x) 395 #define wkbSetZ(x) OGR_GT_SetZ(x) 397 #define ogrZMarker 0x21125711 404 int bAllowPromotingToCurves );
424 #ifndef NO_HACK_FOR_IBM_DB2_V72 425 # define HACK_FOR_IBM_DB2_V72 428 #ifdef HACK_FOR_IBM_DB2_V72 429 # define DB2_V72_FIX_BYTE_ORDER(x) ((((x) & 0x31) == (x)) ? (OGRwkbByteOrder) ((x) & 0x1) : (x)) 430 # define DB2_V72_UNFIX_BYTE_ORDER(x) ((unsigned char) (OGRGeometry::bGenerate_DB2_V72_BYTE_ORDER ? ((x) | 0x30) : (x))) 432 # define DB2_V72_FIX_BYTE_ORDER(x) (x) 433 # define DB2_V72_UNFIX_BYTE_ORDER(x) (x) 439 #define ALTER_NAME_FLAG 0x1 444 #define ALTER_TYPE_FLAG 0x2 449 #define ALTER_WIDTH_PRECISION_FLAG 0x4 455 #define ALTER_NULLABLE_FLAG 0x8 461 #define ALTER_DEFAULT_FLAG 0x10 466 #define ALTER_ALL_FLAG (ALTER_NAME_FLAG | ALTER_TYPE_FLAG | ALTER_WIDTH_PRECISION_FLAG | ALTER_NULLABLE_FLAG | ALTER_DEFAULT_FLAG) 473 #define OGR_F_VAL_NULL 0x00000001 479 #define OGR_F_VAL_GEOM_TYPE 0x00000002 485 #define OGR_F_VAL_WIDTH 0x00000004 494 #define OGR_F_VAL_ALLOW_NULL_WHEN_DEFAULT 0x00000008 500 #define OGR_F_VAL_ALL 0xFFFFFFFF 513 {
OFTInteger = 0,
OFTIntegerList = 1,
OFTReal = 2,
OFTRealList = 3,
OFTString = 4,
OFTStringList = 5,
OFTWideString = 6,
OFTWideStringList = 7,
OFTBinary = 8,
OFTDate = 9,
OFTTime = 10,
OFTDateTime = 11,
OFTInteger64 = 12,
OFTInteger64List = 13,
563 #define OGRNullFID -1 564 #define OGRUnsetMarker -21121 623 #define OGR_GET_MS(floatingpoint_sec) (int)(((floatingpoint_sec) - (int)(floatingpoint_sec)) * 1000 + 0.5) 625 int CPL_DLL OGRParseDate(
const char *pszInput,
OGRField *psOutput,
631 #define OLCRandomRead "RandomRead" 632 #define OLCSequentialWrite "SequentialWrite" 633 #define OLCRandomWrite "RandomWrite" 634 #define OLCFastSpatialFilter "FastSpatialFilter" 635 #define OLCFastFeatureCount "FastFeatureCount" 636 #define OLCFastGetExtent "FastGetExtent" 637 #define OLCCreateField "CreateField" 638 #define OLCDeleteField "DeleteField" 639 #define OLCReorderFields "ReorderFields" 640 #define OLCAlterFieldDefn "AlterFieldDefn" 641 #define OLCTransactions "Transactions" 642 #define OLCDeleteFeature "DeleteFeature" 643 #define OLCFastSetNextByIndex "FastSetNextByIndex" 644 #define OLCStringsAsUTF8 "StringsAsUTF8" 645 #define OLCIgnoreFields "IgnoreFields" 646 #define OLCCreateGeomField "CreateGeomField" 647 #define OLCCurveGeometries "CurveGeometries" 649 #define ODsCCreateLayer "CreateLayer" 650 #define ODsCDeleteLayer "DeleteLayer" 651 #define ODsCCreateGeomFieldAfterCreateLayer "CreateGeomFieldAfterCreateLayer" 652 #define ODsCCurveGeometries "CurveGeometries" 653 #define ODsCTransactions "Transactions" 654 #define ODsCEmulatedTransactions "EmulatedTransactions" 656 #define ODrCCreateDataSource "CreateDataSource" 657 #define ODrCDeleteDataSource "DeleteDataSource" 666 #define OLMD_FID64 "OLMD_FID64" 708 OGRSTPenPerOffset = 4,
711 OGRSTPenPriority = 7,
721 OGRSTBrushFColor = 0,
722 OGRSTBrushBColor = 1,
728 OGRSTBrushPriority = 7,
740 OGRSTSymbolAngle = 1,
741 OGRSTSymbolColor = 2,
747 OGRSTSymbolOffset = 8,
748 OGRSTSymbolPriority = 9,
749 OGRSTSymbolFontName = 10,
750 OGRSTSymbolOColor = 11,
760 OGRSTLabelFontName = 0,
762 OGRSTLabelTextString = 2,
764 OGRSTLabelFColor = 4,
765 OGRSTLabelBColor = 5,
766 OGRSTLabelPlacement = 6,
767 OGRSTLabelAnchor = 7,
772 OGRSTLabelItalic = 12,
773 OGRSTLabelUnderline = 13,
774 OGRSTLabelPriority = 14,
775 OGRSTLabelStrikeout = 15,
776 OGRSTLabelStretch = 16,
777 OGRSTLabelAdjHor = 17,
778 OGRSTLabelAdjVert = 18,
779 OGRSTLabelHColor = 19,
780 OGRSTLabelOColor = 20,
791 #ifndef GDAL_VERSION_INFO_DEFINED 792 #define GDAL_VERSION_INFO_DEFINED 796 #ifndef GDAL_CHECK_VERSION 809 int CPL_DLL CPL_STDCALL
GDALCheckVersion(
int nVersionMajor,
int nVersionMinor,
810 const char* pszCallingComponentName);
813 #define GDAL_CHECK_VERSION(pszCallingComponentName) \ 814 GDALCheckVersion(GDAL_VERSION_MAJOR, GDAL_VERSION_MINOR, pszCallingComponentName) non-standard, for pure attribute records
Definition: ogr_core.h:334
SFSQL 1.2 and ISO SQL/MM Part 3 extended dimension (Z&M) WKB types.
Definition: ogr_core.h:374
enum ogr_style_tool_param_symbol_id OGRSTSymbolParam
List of parameters for use with OGRStyleSymbol.
OGRFieldSubType
List of field subtypes.
Definition: ogr_core.h:540
ogr_style_tool_param_label_id
List of parameters for use with OGRStyleLabel.
Definition: ogr_core.h:758
wkbMultiSurface with Z component.
Definition: ogr_core.h:341
Core portability definitions for CPL.
2.5D extension as per 99-402
Definition: ogr_core.h:348
No subtype.
Definition: ogr_core.h:542
List of 64bit integers.
Definition: ogr_core.h:527
2.5D extension as per 99-402
Definition: ogr_core.h:347
planar 2-dimensional geometric object defined by 1 exterior boundary and 0 or more interior boundarie...
Definition: ogr_core.h:316
wkbMultiCurve with Z component.
Definition: ogr_core.h:340
Time.
Definition: ogr_core.h:524
non-standard, just for createGeometry()
Definition: ogr_core.h:335
Date.
Definition: ogr_core.h:523
enum ogr_style_tool_param_brush_id OGRSTBrushParam
List of parameters for use with OGRStyleBrush.
wkbCompoundCurve with Z component.
Definition: ogr_core.h:338
2.5D extension as per 99-402
Definition: ogr_core.h:344
enum ogr_style_tool_param_label_id OGRSTLabelParam
List of parameters for use with OGRStyleLabel.
ogr_style_tool_param_pen_id
List of parameters for use with OGRStylePen.
Definition: ogr_core.h:702
List of doubles.
Definition: ogr_core.h:517
ogr_style_tool_param_symbol_id
List of parameters for use with OGRStyleSymbol.
Definition: ogr_core.h:737
geometric object that is a collection of 1 or more geometric objects, standard WKB ...
Definition: ogr_core.h:322
1-dimensional geometric object with linear interpolation between Points, standard WKB ...
Definition: ogr_core.h:314
Double Precision floating point.
Definition: ogr_core.h:516
OGRwkbGeometryType OGR_GT_Flatten(OGRwkbGeometryType eType)
Returns the 2D geometry type corresponding to the passed geometry type.
Definition: ogrgeometry.cpp:5033
unknown type, non-standard
Definition: ogr_core.h:311
2.5D extension as per 99-402
Definition: ogr_core.h:349
int OGR_GT_IsSurface(OGRwkbGeometryType)
Return if a geometry type is an instance of Surface.
Definition: ogrgeometry.cpp:5332
GeometryCollection of Points, standard WKB.
Definition: ogr_core.h:319
OGRwkbGeometryType OGR_GT_SetZ(OGRwkbGeometryType eType)
Returns the 3D geometry type corresponding to the passed geometry type.
Definition: ogrgeometry.cpp:5080
enum ogr_style_tool_class_id OGRSTClassId
OGRStyleTool derived class types (returned by GetType()).
Raw Binary data.
Definition: ogr_core.h:522
Single 64bit integer.
Definition: ogr_core.h:526
int OGR_GT_IsSubClassOf(OGRwkbGeometryType eType, OGRwkbGeometryType eSuperType)
Returns if a type is a subclass of another one.
Definition: ogrgeometry.cpp:5128
GeometryCollection of Curves, ISO SQL/MM Part 3.
Definition: ogr_core.h:331
2.5D extension as per 99-402
Definition: ogr_core.h:346
enum ogr_style_tool_param_pen_id OGRSTPenParam
List of parameters for use with OGRStylePen.
enum ogr_style_tool_units_id OGRSTUnitId
List of units supported by OGRStyleTools.
OGRwkbGeometryType
List of well known binary geometry types.
Definition: ogr_core.h:309
int OGR_GT_IsNonLinear(OGRwkbGeometryType)
Return if a geometry type is a non-linear geometry type.
Definition: ogrgeometry.cpp:5353
const char * GDALVersionInfo(const char *)
Get runtime version information.
Definition: gdal_misc.cpp:1731
OGRwkbGeometryType OGRMergeGeometryTypes(OGRwkbGeometryType eMain, OGRwkbGeometryType eExtra)
Find common geometry type.
Definition: ogrgeometry.cpp:2031
OGRwkbGeometryType OGRMergeGeometryTypesEx(OGRwkbGeometryType eMain, OGRwkbGeometryType eExtra, int bAllowPromotingToCurves)
Find common geometry type.
Definition: ogrgeometry.cpp:2067
wkbCurvePolygon with Z component.
Definition: ogr_core.h:339
Signed 16-bit integer.
Definition: ogr_core.h:546
Boolean integer.
Definition: ogr_core.h:544
2.5D extension as per 99-402
Definition: ogr_core.h:345
GeometryCollection of LineStrings, standard WKB.
Definition: ogr_core.h:320
sequence of contiguous curves, ISO SQL/MM Part 3.
Definition: ogr_core.h:327
OGRJustification
Display justification for field values.
Definition: ogr_core.h:556
ogr_style_tool_units_id
List of units supported by OGRStyleTools.
Definition: ogr_core.h:689
PostGIS 1.X has different codes for CurvePolygon, MultiCurve and MultiSurface.
Definition: ogr_core.h:375
deprecated
Definition: ogr_core.h:521
one or more circular arc segments connected end to end, ISO SQL/MM Part 3.
Definition: ogr_core.h:325
0-dimensional geometric object, standard WKB
Definition: ogr_core.h:313
Single precision (32 bit) floatint point.
Definition: ogr_core.h:548
int GDALCheckVersion(int nVersionMajor, int nVersionMinor, const char *pszCallingComponentName)
Return TRUE if GDAL library version at runtime matches nVersionMajor.nVersionMinor.
Definition: gdal_misc.cpp:1840
OGRFieldType
List of feature field types.
Definition: ogr_core.h:512
Date and Time.
Definition: ogr_core.h:525
Old-style 99-402 extended dimension (Z) WKB types.
Definition: ogr_core.h:373
Simple container for a bounding region in 3D.
Definition: ogr_core.h:162
OGRwkbGeometryType OGR_GT_GetLinear(OGRwkbGeometryType eType)
Returns the non-curve geometry type that can contain the passed geometry type.
Definition: ogrgeometry.cpp:5273
OGRwkbVariant
Output variants of WKB we support.
Definition: ogr_core.h:371
wkbCircularString with Z component.
Definition: ogr_core.h:337
deprecated
Definition: ogr_core.h:520
ogr_style_tool_param_brush_id
List of parameters for use with OGRStyleBrush.
Definition: ogr_core.h:719
Simple container for a bounding region.
Definition: ogr_core.h:48
OGRFeature field attribute value union.
Definition: ogr_core.h:574
OGRwkbGeometryType OGR_GT_GetCollection(OGRwkbGeometryType eType)
Returns the collection type that can contain the passed geometry type.
Definition: ogrgeometry.cpp:5182
GeometryCollection of Surfaces, ISO SQL/MM Part 3.
Definition: ogr_core.h:332
ogr_style_tool_class_id
OGRStyleTool derived class types (returned by GetType()).
Definition: ogr_core.h:676
planar surface, defined by 1 exterior boundary and zero or more interior boundaries, that are curves.
Definition: ogr_core.h:328
OGRwkbGeometryType OGR_GT_GetCurve(OGRwkbGeometryType eType)
Returns the curve geometry type that can contain the passed geometry type.
Definition: ogrgeometry.cpp:5231
GeometryCollection of Polygons, standard WKB.
Definition: ogr_core.h:321
String of ASCII chars.
Definition: ogr_core.h:518
int OGR_GT_HasZ(OGRwkbGeometryType eType)
Return if the geometry type is a 3D geometry type.
Definition: ogrgeometry.cpp:5058
2.5D extension as per 99-402
Definition: ogr_core.h:343
const char * OGRGeometryTypeToName(OGRwkbGeometryType eType)
Fetch a human readable name corresponding to an OGRwkbGeometryType value.
Definition: ogrgeometry.cpp:1905
Array of strings.
Definition: ogr_core.h:519
List of 32bit integers.
Definition: ogr_core.h:515
Simple 32bit integer.
Definition: ogr_core.h:514
int OGR_GT_IsCurve(OGRwkbGeometryType)
Return if a geometry type is an instance of Curve.
Definition: ogrgeometry.cpp:5311