30 #ifndef OGR_CORE_H_INCLUDED
31 #define OGR_CORE_H_INCLUDED
34 #include "gdal_version.h"
46 #if defined(__cplusplus) && !defined(CPL_SUPRESS_CPLUSPLUS)
50 OGREnvelope() : MinX(0.0), MaxX(0.0), MinY(0.0), MaxY(0.0)
55 MinX(oOther.MinX),MaxX(oOther.MaxX), MinY(oOther.MinY), MaxY(oOther.MaxY)
64 int IsInit()
const {
return MinX != 0 || MinY != 0 || MaxX != 0 || MaxY != 0; }
68 MinX = MIN(MinX,sOther.MinX);
69 MaxX = MAX(MaxX,sOther.MaxX);
70 MinY = MIN(MinY,sOther.MinY);
71 MaxY = MAX(MaxY,sOther.MaxY);
81 void Merge(
double dfX,
double dfY ) {
97 if(Intersects(sOther))
101 MinX = MAX(MinX,sOther.MinX);
102 MaxX = MIN(MaxX,sOther.MaxX);
103 MinY = MAX(MinY,sOther.MinY);
104 MaxY = MIN(MaxY,sOther.MaxY);
125 return MinX <= other.MaxX && MaxX >= other.MinX &&
126 MinY <= other.MaxY && MaxY >= other.MinY;
131 return MinX <= other.MinX && MinY <= other.MinY &&
132 MaxX >= other.MaxX && MaxY >= other.MaxY;
150 #if defined(__cplusplus) && !defined(CPL_SUPRESS_CPLUSPLUS)
160 MinZ(oOther.MinZ), MaxZ(oOther.MaxZ)
167 int IsInit()
const {
return MinX != 0 || MinY != 0 || MaxX != 0 || MaxY != 0 || MinZ != 0 || MaxZ != 0; }
171 MinX = MIN(MinX,sOther.MinX);
172 MaxX = MAX(MaxX,sOther.MaxX);
173 MinY = MIN(MinY,sOther.MinY);
174 MaxY = MAX(MaxY,sOther.MaxY);
175 MinZ = MIN(MinZ,sOther.MinZ);
176 MaxZ = MAX(MaxZ,sOther.MaxZ);
188 void Merge(
double dfX,
double dfY,
double dfZ ) {
191 MinX = MIN(MinX,dfX);
192 MaxX = MAX(MaxX,dfX);
193 MinY = MIN(MinY,dfY);
194 MaxY = MAX(MaxY,dfY);
195 MinZ = MIN(MinZ,dfZ);
196 MaxZ = MAX(MaxZ,dfZ);
207 if(Intersects(sOther))
211 MinX = MAX(MinX,sOther.MinX);
212 MaxX = MIN(MaxX,sOther.MaxX);
213 MinY = MAX(MinY,sOther.MinY);
214 MaxY = MIN(MaxY,sOther.MaxY);
215 MinZ = MAX(MinZ,sOther.MinZ);
216 MaxZ = MIN(MaxZ,sOther.MaxZ);
241 return MinX <= other.MaxX && MaxX >= other.MinX &&
242 MinY <= other.MaxY && MaxY >= other.MinY &&
243 MinZ <= other.MaxZ && MaxZ >= other.MinZ;
248 return MinX <= other.MinX && MinY <= other.MinY &&
249 MaxX >= other.MaxX && MaxY >= other.MaxY &&
250 MaxZ >= other.MaxZ && MaxZ >= other.MaxZ;
268 void CPL_DLL *OGRMalloc(
size_t );
269 void CPL_DLL *OGRCalloc(
size_t,
size_t );
270 void CPL_DLL *OGRRealloc(
void *,
size_t );
271 char CPL_DLL *OGRStrdup(
const char * );
272 void CPL_DLL OGRFree(
void * );
276 #define OGRERR_NONE 0
277 #define OGRERR_NOT_ENOUGH_DATA 1
278 #define OGRERR_NOT_ENOUGH_MEMORY 2
279 #define OGRERR_UNSUPPORTED_GEOMETRY_TYPE 3
280 #define OGRERR_UNSUPPORTED_OPERATION 4
281 #define OGRERR_CORRUPT_DATA 5
282 #define OGRERR_FAILURE 6
283 #define OGRERR_UNSUPPORTED_SRS 7
284 #define OGRERR_INVALID_HANDLE 8
286 typedef int OGRBoolean;
322 #define wkb25DBit 0x80000000
323 #define wkbFlatten(x) ((OGRwkbGeometryType) ((x) & (~wkb25DBit)))
325 #define ogrZMarker 0x21125711
337 #ifndef NO_HACK_FOR_IBM_DB2_V72
338 # define HACK_FOR_IBM_DB2_V72
341 #ifdef HACK_FOR_IBM_DB2_V72
342 # define DB2_V72_FIX_BYTE_ORDER(x) ((((x) & 0x31) == (x)) ? (OGRwkbByteOrder) ((x) & 0x1) : (x))
343 # define DB2_V72_UNFIX_BYTE_ORDER(x) ((unsigned char) (OGRGeometry::bGenerate_DB2_V72_BYTE_ORDER ? ((x) | 0x30) : (x)))
345 # define DB2_V72_FIX_BYTE_ORDER(x) (x)
346 # define DB2_V72_UNFIX_BYTE_ORDER(x) (x)
349 #define ALTER_NAME_FLAG 0x1
350 #define ALTER_TYPE_FLAG 0x2
351 #define ALTER_WIDTH_PRECISION_FLAG 0x4
352 #define ALTER_ALL_FLAG (ALTER_NAME_FLAG | ALTER_TYPE_FLAG | ALTER_WIDTH_PRECISION_FLAG)
365 {
OFTInteger = 0,
OFTIntegerList = 1,
OFTReal = 2,
OFTRealList = 3,
OFTString = 4,
OFTStringList = 5,
OFTWideString = 6,
OFTWideStringList = 7,
OFTBinary = 8,
OFTDate = 9,
OFTTime = 10,
OFTDateTime = 11,
392 #define OGRNullFID -1
393 #define OGRUnsetMarker -21121
451 #define OLCRandomRead "RandomRead"
452 #define OLCSequentialWrite "SequentialWrite"
453 #define OLCRandomWrite "RandomWrite"
454 #define OLCFastSpatialFilter "FastSpatialFilter"
455 #define OLCFastFeatureCount "FastFeatureCount"
456 #define OLCFastGetExtent "FastGetExtent"
457 #define OLCCreateField "CreateField"
458 #define OLCDeleteField "DeleteField"
459 #define OLCReorderFields "ReorderFields"
460 #define OLCAlterFieldDefn "AlterFieldDefn"
461 #define OLCTransactions "Transactions"
462 #define OLCDeleteFeature "DeleteFeature"
463 #define OLCFastSetNextByIndex "FastSetNextByIndex"
464 #define OLCStringsAsUTF8 "StringsAsUTF8"
465 #define OLCIgnoreFields "IgnoreFields"
467 #define ODsCCreateLayer "CreateLayer"
468 #define ODsCDeleteLayer "DeleteLayer"
470 #define ODrCCreateDataSource "CreateDataSource"
471 #define ODrCDeleteDataSource "DeleteDataSource"
514 OGRSTPenPerOffset = 4,
517 OGRSTPenPriority = 7,
527 OGRSTBrushFColor = 0,
528 OGRSTBrushBColor = 1,
534 OGRSTBrushPriority = 7,
546 OGRSTSymbolAngle = 1,
547 OGRSTSymbolColor = 2,
553 OGRSTSymbolOffset = 8,
554 OGRSTSymbolPriority = 9,
555 OGRSTSymbolFontName = 10,
556 OGRSTSymbolOColor = 11,
566 OGRSTLabelFontName = 0,
568 OGRSTLabelTextString = 2,
570 OGRSTLabelFColor = 4,
571 OGRSTLabelBColor = 5,
572 OGRSTLabelPlacement = 6,
573 OGRSTLabelAnchor = 7,
578 OGRSTLabelItalic = 12,
579 OGRSTLabelUnderline = 13,
580 OGRSTLabelPriority = 14,
581 OGRSTLabelStrikeout = 15,
582 OGRSTLabelStretch = 16,
583 OGRSTLabelAdjHor = 17,
584 OGRSTLabelAdjVert = 18,
585 OGRSTLabelHColor = 19,
586 OGRSTLabelOColor = 20,
597 #ifndef GDAL_VERSION_INFO_DEFINED
598 #define GDAL_VERSION_INFO_DEFINED
599 const char CPL_DLL * CPL_STDCALL GDALVersionInfo(
const char * );
602 #ifndef GDAL_CHECK_VERSION
615 int CPL_DLL CPL_STDCALL
GDALCheckVersion(
int nVersionMajor,
int nVersionMinor,
616 const char* pszCallingComponentName);
619 #define GDAL_CHECK_VERSION(pszCallingComponentName) \
620 GDALCheckVersion(GDAL_VERSION_MAJOR, GDAL_VERSION_MINOR, pszCallingComponentName)