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)
65 #ifdef HAVE_GCC_DIAGNOSTIC_PUSH 66 #pragma GCC diagnostic push 67 #pragma GCC diagnostic ignored "-Wfloat-equal" 69 int IsInit()
const {
return MinX != 0 || MinY != 0 || MaxX != 0 || MaxY != 0; }
71 #ifdef HAVE_GCC_DIAGNOSTIC_PUSH 72 #pragma GCC diagnostic pop 78 MinX = MIN(MinX,sOther.MinX);
79 MaxX = MAX(MaxX,sOther.MaxX);
80 MinY = MIN(MinY,sOther.MinY);
81 MaxY = MAX(MaxY,sOther.MaxY);
91 void Merge(
double dfX,
double dfY ) {
107 if(Intersects(sOther))
111 MinX = MAX(MinX,sOther.MinX);
112 MaxX = MIN(MaxX,sOther.MaxX);
113 MinY = MAX(MinY,sOther.MinY);
114 MaxY = MIN(MaxY,sOther.MaxY);
135 return MinX <= other.MaxX && MaxX >= other.MinX &&
136 MinY <= other.MaxY && MaxY >= other.MinY;
141 return MinX <= other.MinX && MinY <= other.MinY &&
142 MaxX >= other.MaxX && MaxY >= other.MaxY;
160 #if defined(__cplusplus) && !defined(CPL_SURESS_CPLUSPLUS) 170 MinZ(oOther.MinZ), MaxZ(oOther.MaxZ)
177 #ifdef HAVE_GCC_DIAGNOSTIC_PUSH 178 #pragma GCC diagnostic push 179 #pragma GCC diagnostic ignored "-Wfloat-equal" 181 int IsInit()
const {
return MinX != 0 || MinY != 0 || MaxX != 0 || MaxY != 0 || MinZ != 0 || MaxZ != 0; }
182 #ifdef HAVE_GCC_DIAGNOSTIC_PUSH 183 #pragma GCC diagnostic pop 189 MinX = MIN(MinX,sOther.MinX);
190 MaxX = MAX(MaxX,sOther.MaxX);
191 MinY = MIN(MinY,sOther.MinY);
192 MaxY = MAX(MaxY,sOther.MaxY);
193 MinZ = MIN(MinZ,sOther.MinZ);
194 MaxZ = MAX(MaxZ,sOther.MaxZ);
206 void Merge(
double dfX,
double dfY,
double dfZ ) {
209 MinX = MIN(MinX,dfX);
210 MaxX = MAX(MaxX,dfX);
211 MinY = MIN(MinY,dfY);
212 MaxY = MAX(MaxY,dfY);
213 MinZ = MIN(MinZ,dfZ);
214 MaxZ = MAX(MaxZ,dfZ);
225 if(Intersects(sOther))
229 MinX = MAX(MinX,sOther.MinX);
230 MaxX = MIN(MaxX,sOther.MaxX);
231 MinY = MAX(MinY,sOther.MinY);
232 MaxY = MIN(MaxY,sOther.MaxY);
233 MinZ = MAX(MinZ,sOther.MinZ);
234 MaxZ = MIN(MaxZ,sOther.MaxZ);
259 return MinX <= other.MaxX && MaxX >= other.MinX &&
260 MinY <= other.MaxY && MaxY >= other.MinY &&
261 MinZ <= other.MaxZ && MaxZ >= other.MinZ;
266 return MinX <= other.MinX && MinY <= other.MinY &&
267 MaxX >= other.MaxX && MaxY >= other.MaxY &&
268 MinZ <= other.MinZ && MaxZ >= other.MaxZ;
286 void CPL_DLL *OGRMalloc(
size_t );
287 void CPL_DLL *OGRCalloc(
size_t,
size_t );
288 void CPL_DLL *OGRRealloc(
void *,
size_t );
289 char CPL_DLL *OGRStrdup(
const char * );
290 void CPL_DLL OGRFree(
void * );
292 #ifdef STRICT_OGRERR_TYPE 296 OGRERR_NOT_ENOUGH_DATA,
297 OGRERR_NOT_ENOUGH_MEMORY,
298 OGRERR_UNSUPPORTED_GEOMETRY_TYPE,
299 OGRERR_UNSUPPORTED_OPERATION,
302 OGRERR_UNSUPPORTED_SRS,
303 OGRERR_INVALID_HANDLE,
304 OGRERR_NON_EXISTING_FEATURE
309 #define OGRERR_NONE 0 310 #define OGRERR_NOT_ENOUGH_DATA 1 311 #define OGRERR_NOT_ENOUGH_MEMORY 2 312 #define OGRERR_UNSUPPORTED_GEOMETRY_TYPE 3 313 #define OGRERR_UNSUPPORTED_OPERATION 4 314 #define OGRERR_CORRUPT_DATA 5 315 #define OGRERR_FAILURE 6 316 #define OGRERR_UNSUPPORTED_SRS 7 317 #define OGRERR_INVALID_HANDLE 8 318 #define OGRERR_NON_EXISTING_FEATURE 9 322 typedef int OGRBoolean;
448 #ifndef GDAL_COMPILATION 449 #define wkb25DBit 0x80000000 453 #define wkbFlatten(x) OGR_GT_Flatten((OGRwkbGeometryType)(x)) 458 #define wkbHasZ(x) (OGR_GT_HasZ(x) != 0) 463 #define wkbSetZ(x) OGR_GT_SetZ(x) 468 #define wkbHasM(x) (OGR_GT_HasM(x) != 0) 473 #define wkbSetM(x) OGR_GT_SetM(x) 475 #define ogrZMarker 0x21125711 482 int bAllowPromotingToCurves );
504 #ifndef NO_HACK_FOR_IBM_DB2_V72 505 # define HACK_FOR_IBM_DB2_V72 508 #ifdef HACK_FOR_IBM_DB2_V72 509 # define DB2_V72_FIX_BYTE_ORDER(x) ((((x) & 0x31) == (x)) ? ((x) & 0x1) : (x)) 510 # define DB2_V72_UNFIX_BYTE_ORDER(x) ((unsigned char) (OGRGeometry::bGenerate_DB2_V72_BYTE_ORDER ? ((x) | 0x30) : (x))) 512 # define DB2_V72_FIX_BYTE_ORDER(x) (x) 513 # define DB2_V72_UNFIX_BYTE_ORDER(x) (x) 519 #define ALTER_NAME_FLAG 0x1 524 #define ALTER_TYPE_FLAG 0x2 529 #define ALTER_WIDTH_PRECISION_FLAG 0x4 535 #define ALTER_NULLABLE_FLAG 0x8 541 #define ALTER_DEFAULT_FLAG 0x10 546 #define ALTER_ALL_FLAG (ALTER_NAME_FLAG | ALTER_TYPE_FLAG | ALTER_WIDTH_PRECISION_FLAG | ALTER_NULLABLE_FLAG | ALTER_DEFAULT_FLAG) 553 #define OGR_F_VAL_NULL 0x00000001 559 #define OGR_F_VAL_GEOM_TYPE 0x00000002 565 #define OGR_F_VAL_WIDTH 0x00000004 574 #define OGR_F_VAL_ALLOW_NULL_WHEN_DEFAULT 0x00000008 582 #define OGR_F_VAL_ALLOW_DIFFERENT_GEOM_DIM 0x00000010 588 #define OGR_F_VAL_ALL (0x7FFFFFFF & ~OGR_F_VAL_ALLOW_DIFFERENT_GEOM_DIM) 601 {
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,
651 #define OGRNullFID -1 652 #define OGRUnsetMarker -21121 711 #define OGR_GET_MS(floatingpoint_sec) (int)(((floatingpoint_sec) - (int)(floatingpoint_sec)) * 1000 + 0.5) 713 int CPL_DLL OGRParseDate(
const char *pszInput,
OGRField *psOutput,
719 #define OLCRandomRead "RandomRead" 720 #define OLCSequentialWrite "SequentialWrite" 721 #define OLCRandomWrite "RandomWrite" 722 #define OLCFastSpatialFilter "FastSpatialFilter" 723 #define OLCFastFeatureCount "FastFeatureCount" 724 #define OLCFastGetExtent "FastGetExtent" 725 #define OLCCreateField "CreateField" 726 #define OLCDeleteField "DeleteField" 727 #define OLCReorderFields "ReorderFields" 728 #define OLCAlterFieldDefn "AlterFieldDefn" 729 #define OLCTransactions "Transactions" 730 #define OLCDeleteFeature "DeleteFeature" 731 #define OLCFastSetNextByIndex "FastSetNextByIndex" 732 #define OLCStringsAsUTF8 "StringsAsUTF8" 733 #define OLCIgnoreFields "IgnoreFields" 734 #define OLCCreateGeomField "CreateGeomField" 735 #define OLCCurveGeometries "CurveGeometries" 736 #define OLCMeasuredGeometries "MeasuredGeometries" 738 #define ODsCCreateLayer "CreateLayer" 739 #define ODsCDeleteLayer "DeleteLayer" 740 #define ODsCCreateGeomFieldAfterCreateLayer "CreateGeomFieldAfterCreateLayer" 741 #define ODsCCurveGeometries "CurveGeometries" 742 #define ODsCTransactions "Transactions" 743 #define ODsCEmulatedTransactions "EmulatedTransactions" 744 #define ODsCMeasuredGeometries "MeasuredGeometries" 746 #define ODrCCreateDataSource "CreateDataSource" 747 #define ODrCDeleteDataSource "DeleteDataSource" 756 #define OLMD_FID64 "OLMD_FID64" 798 OGRSTPenPerOffset = 4,
801 OGRSTPenPriority = 7,
811 OGRSTBrushFColor = 0,
812 OGRSTBrushBColor = 1,
818 OGRSTBrushPriority = 7,
830 OGRSTSymbolAngle = 1,
831 OGRSTSymbolColor = 2,
837 OGRSTSymbolOffset = 8,
838 OGRSTSymbolPriority = 9,
839 OGRSTSymbolFontName = 10,
840 OGRSTSymbolOColor = 11,
850 OGRSTLabelFontName = 0,
852 OGRSTLabelTextString = 2,
854 OGRSTLabelFColor = 4,
855 OGRSTLabelBColor = 5,
856 OGRSTLabelPlacement = 6,
857 OGRSTLabelAnchor = 7,
862 OGRSTLabelItalic = 12,
863 OGRSTLabelUnderline = 13,
864 OGRSTLabelPriority = 14,
865 OGRSTLabelStrikeout = 15,
866 OGRSTLabelStretch = 16,
867 OGRSTLabelAdjHor = 17,
868 OGRSTLabelAdjVert = 18,
869 OGRSTLabelHColor = 19,
870 OGRSTLabelOColor = 20,
881 #ifndef GDAL_VERSION_INFO_DEFINED 882 #define GDAL_VERSION_INFO_DEFINED 883 const char CPL_DLL * CPL_STDCALL GDALVersionInfo(
const char * );
886 #ifndef GDAL_CHECK_VERSION 899 int CPL_DLL CPL_STDCALL
GDALCheckVersion(
int nVersionMajor,
int nVersionMinor,
900 const char* pszCallingComponentName);
903 #define GDAL_CHECK_VERSION(pszCallingComponentName) \ 904 GDALCheckVersion(GDAL_VERSION_MAJOR, GDAL_VERSION_MINOR, pszCallingComponentName) Definition: ogr_core.h:402
Definition: ogr_core.h:365
Definition: ogr_core.h:442
enum ogr_style_tool_param_symbol_id OGRSTSymbolParam
Definition: ogr_core.h:386
Definition: ogr_core.h:389
Definition: ogr_core.h:380
OGRFieldSubType
Definition: ogr_core.h:628
Definition: ogr_core.h:373
ogr_style_tool_param_label_id
Definition: ogr_core.h:848
Definition: ogr_core.h:376
Definition: ogr_core.h:372
Definition: ogr_core.h:388
Definition: ogr_core.h:385
Definition: ogr_core.h:420
Definition: ogr_core.h:630
Definition: ogr_core.h:615
Definition: ogr_core.h:419
Definition: ogr_core.h:340
Definition: ogr_core.h:359
Definition: ogr_core.h:371
Definition: ogr_core.h:382
Definition: ogr_core.h:612
Definition: ogr_core.h:366
Definition: ogr_core.h:611
enum ogr_style_tool_param_brush_id OGRSTBrushParam
Definition: ogr_core.h:403
OGRwkbGeometryType OGR_GT_SetM(OGRwkbGeometryType eType)
Returns the measured geometry type corresponding to the passed geometry type.
Definition: ogrgeometry.cpp:5688
Definition: ogr_core.h:369
Definition: ogr_core.h:416
enum ogr_style_tool_param_label_id OGRSTLabelParam
Definition: ogr_core.h:393
ogr_style_tool_param_pen_id
Definition: ogr_core.h:792
Definition: ogr_core.h:605
ogr_style_tool_param_symbol_id
Definition: ogr_core.h:827
Definition: ogr_core.h:413
Definition: ogr_core.h:346
Definition: ogr_core.h:338
Definition: ogr_core.h:604
OGRwkbGeometryType OGR_GT_Flatten(OGRwkbGeometryType eType)
Returns the 2D geometry type corresponding to the passed geometry type.
Definition: ogrgeometry.cpp:5594
Definition: ogr_core.h:335
Definition: ogr_core.h:421
Definition: ogr_core.h:383
Definition: ogr_core.h:358
Definition: ogr_core.h:406
int OGR_GT_IsSurface(OGRwkbGeometryType)
Return if a geometry type is an instance of Surface.
Definition: ogrgeometry.cpp:5959
Definition: ogr_core.h:409
OGRwkbGeometryType OGR_GT_SetModifier(OGRwkbGeometryType eType, int bSetZ, int bSetM)
Returns a XY, XYZ, XYM or XYZM geometry type depending on parameter.
Definition: ogrgeometry.cpp:5715
Definition: ogr_core.h:343
OGRwkbGeometryType OGR_GT_SetZ(OGRwkbGeometryType eType)
Returns the 3D geometry type corresponding to the passed geometry type.
Definition: ogrgeometry.cpp:5665
int OGR_GT_HasM(OGRwkbGeometryType eType)
Return if the geometry type is a measured type.
Definition: ogrgeometry.cpp:5643
enum ogr_style_tool_class_id OGRSTClassId
Definition: ogr_core.h:610
Definition: ogr_core.h:614
int OGR_GT_IsSubClassOf(OGRwkbGeometryType eType, OGRwkbGeometryType eSuperType)
Returns if a type is a subclass of another one.
Definition: ogrgeometry.cpp:5742
Definition: ogr_core.h:355
Definition: ogr_core.h:374
Definition: ogr_core.h:418
enum ogr_style_tool_param_pen_id OGRSTPenParam
enum ogr_style_tool_units_id OGRSTUnitId
OGRwkbGeometryType
Definition: ogr_core.h:333
Definition: ogr_core.h:379
int OGR_GT_IsNonLinear(OGRwkbGeometryType)
Return if a geometry type is a non-linear geometry type.
Definition: ogrgeometry.cpp:5980
OGRwkbGeometryType OGRMergeGeometryTypes(OGRwkbGeometryType eMain, OGRwkbGeometryType eExtra)
Find common geometry type.
Definition: ogrgeometry.cpp:2440
Definition: ogr_core.h:394
OGRwkbGeometryType OGRMergeGeometryTypesEx(OGRwkbGeometryType eMain, OGRwkbGeometryType eExtra, int bAllowPromotingToCurves)
Find common geometry type.
Definition: ogrgeometry.cpp:2476
Definition: ogr_core.h:397
Definition: ogr_core.h:370
Definition: ogr_core.h:634
Definition: ogr_core.h:361
Definition: ogr_core.h:405
Definition: ogr_core.h:392
Definition: ogr_core.h:375
Definition: ogr_core.h:632
Definition: ogr_core.h:384
Definition: ogr_core.h:417
Definition: ogr_core.h:408
Definition: ogr_core.h:344
Definition: ogr_core.h:399
Definition: ogr_core.h:351
OGRJustification
Definition: ogr_core.h:644
ogr_style_tool_units_id
Definition: ogr_core.h:779
Definition: ogr_core.h:443
Definition: ogr_core.h:609
Definition: ogr_core.h:349
Definition: ogr_core.h:337
Definition: ogr_core.h:636
OGRFieldType
Definition: ogr_core.h:600
Definition: ogr_core.h:390
Definition: ogr_core.h:401
Definition: ogr_core.h:613
Definition: ogr_core.h:441
Definition: ogr_core.h:161
Definition: ogr_core.h:377
int CPL_STDCALL GDALCheckVersion(int nVersionMajor, int nVersionMinor, const char *pszCallingComponentName)
OGRwkbGeometryType OGR_GT_GetLinear(OGRwkbGeometryType eType)
Returns the non-curve geometry type that can contain the passed geometry type.
Definition: ogrgeometry.cpp:5896
OGRwkbVariant
Definition: ogr_core.h:439
Definition: ogr_core.h:368
Definition: ogr_core.h:608
ogr_style_tool_param_brush_id
Definition: ogr_core.h:809
Definition: ogr_core.h:410
Definition: ogr_core.h:412
Definition: ogr_core.h:48
Definition: ogr_core.h:662
Definition: ogr_core.h:411
Definition: ogr_core.h:400
Definition: ogr_core.h:381
Definition: ogr_core.h:407
OGRwkbGeometryType OGR_GT_GetCollection(OGRwkbGeometryType eType)
Returns the collection type that can contain the passed geometry type.
Definition: ogrgeometry.cpp:5797
Definition: ogr_core.h:356
ogr_style_tool_class_id
Definition: ogr_core.h:766
Definition: ogr_core.h:395
Definition: ogr_core.h:398
Definition: ogr_core.h:404
Definition: ogr_core.h:352
OGRwkbGeometryType OGR_GT_GetCurve(OGRwkbGeometryType eType)
Returns the curve geometry type that can contain the passed geometry type.
Definition: ogrgeometry.cpp:5850
Definition: ogr_core.h:345
Definition: ogr_core.h:606
int OGR_GT_HasZ(OGRwkbGeometryType eType)
Return if the geometry type is a 3D geometry type.
Definition: ogrgeometry.cpp:5619
Definition: ogr_core.h:415
const char * OGRGeometryTypeToName(OGRwkbGeometryType eType)
Fetch a human readable name corresponding to an OGRwkbGeometryType value. The returned value should n...
Definition: ogrgeometry.cpp:2247
Definition: ogr_core.h:607
Definition: ogr_core.h:391
Definition: ogr_core.h:603
Definition: ogr_core.h:387
Definition: ogr_core.h:602
Definition: ogr_core.h:357
int OGR_GT_IsCurve(OGRwkbGeometryType)
Return if a geometry type is an instance of Curve.
Definition: ogrgeometry.cpp:5938