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)
58 int IsInit()
const {
return MinX != 0 || MinY != 0 || MaxX != 0 || MaxY != 0; }
62 MinX = MIN(MinX,sOther.MinX);
63 MaxX = MAX(MaxX,sOther.MaxX);
64 MinY = MIN(MinY,sOther.MinY);
65 MaxY = MAX(MaxY,sOther.MaxY);
75 void Merge(
double dfX,
double dfY ) {
91 if(Intersects(sOther))
95 MinX = MAX(MinX,sOther.MinX);
96 MaxX = MIN(MaxX,sOther.MaxX);
97 MinY = MAX(MinY,sOther.MinY);
98 MaxY = MIN(MaxY,sOther.MaxY);
119 return MinX <= other.MaxX && MaxX >= other.MinX &&
120 MinY <= other.MaxY && MaxY >= other.MinY;
125 return MinX <= other.MinX && MinY <= other.MinY &&
126 MaxX >= other.MaxX && MaxY >= other.MaxY;
144 #if defined(__cplusplus) && !defined(CPL_SUPRESS_CPLUSPLUS)
155 int IsInit()
const {
return MinX != 0 || MinY != 0 || MaxX != 0 || MaxY != 0 || MinZ != 0 || MaxZ != 0; }
159 MinX = MIN(MinX,sOther.MinX);
160 MaxX = MAX(MaxX,sOther.MaxX);
161 MinY = MIN(MinY,sOther.MinY);
162 MaxY = MAX(MaxY,sOther.MaxY);
163 MinZ = MIN(MinZ,sOther.MinZ);
164 MaxZ = MAX(MaxZ,sOther.MaxZ);
176 void Merge(
double dfX,
double dfY,
double dfZ ) {
179 MinX = MIN(MinX,dfX);
180 MaxX = MAX(MaxX,dfX);
181 MinY = MIN(MinY,dfY);
182 MaxY = MAX(MaxY,dfY);
183 MinZ = MIN(MinZ,dfZ);
184 MaxZ = MAX(MaxZ,dfZ);
195 if(Intersects(sOther))
199 MinX = MAX(MinX,sOther.MinX);
200 MaxX = MIN(MaxX,sOther.MaxX);
201 MinY = MAX(MinY,sOther.MinY);
202 MaxY = MIN(MaxY,sOther.MaxY);
203 MinZ = MAX(MinZ,sOther.MinZ);
204 MaxZ = MIN(MaxZ,sOther.MaxZ);
229 return MinX <= other.MaxX && MaxX >= other.MinX &&
230 MinY <= other.MaxY && MaxY >= other.MinY &&
231 MinZ <= other.MaxZ && MaxZ >= other.MinZ;
236 return MinX <= other.MinX && MinY <= other.MinY &&
237 MaxX >= other.MaxX && MaxY >= other.MaxY &&
238 MaxZ >= other.MaxZ && MaxZ >= other.MaxZ;
256 void CPL_DLL *OGRMalloc(
size_t );
257 void CPL_DLL *OGRCalloc(
size_t,
size_t );
258 void CPL_DLL *OGRRealloc(
void *,
size_t );
259 char CPL_DLL *OGRStrdup(
const char * );
260 void CPL_DLL OGRFree(
void * );
264 #define OGRERR_NONE 0
265 #define OGRERR_NOT_ENOUGH_DATA 1
266 #define OGRERR_NOT_ENOUGH_MEMORY 2
267 #define OGRERR_UNSUPPORTED_GEOMETRY_TYPE 3
268 #define OGRERR_UNSUPPORTED_OPERATION 4
269 #define OGRERR_CORRUPT_DATA 5
270 #define OGRERR_FAILURE 6
271 #define OGRERR_UNSUPPORTED_SRS 7
272 #define OGRERR_INVALID_HANDLE 8
274 typedef int OGRBoolean;
310 #define wkb25DBit 0x80000000
311 #define wkbFlatten(x) ((OGRwkbGeometryType) ((x) & (~wkb25DBit)))
313 #define ogrZMarker 0x21125711
325 #ifndef NO_HACK_FOR_IBM_DB2_V72
326 # define HACK_FOR_IBM_DB2_V72
329 #ifdef HACK_FOR_IBM_DB2_V72
330 # define DB2_V72_FIX_BYTE_ORDER(x) ((((x) & 0x31) == (x)) ? (OGRwkbByteOrder) ((x) & 0x1) : (x))
331 # define DB2_V72_UNFIX_BYTE_ORDER(x) ((unsigned char) (OGRGeometry::bGenerate_DB2_V72_BYTE_ORDER ? ((x) | 0x30) : (x)))
333 # define DB2_V72_FIX_BYTE_ORDER(x) (x)
334 # define DB2_V72_UNFIX_BYTE_ORDER(x) (x)
337 #define ALTER_NAME_FLAG 0x1
338 #define ALTER_TYPE_FLAG 0x2
339 #define ALTER_WIDTH_PRECISION_FLAG 0x4
340 #define ALTER_ALL_FLAG (ALTER_NAME_FLAG | ALTER_TYPE_FLAG | ALTER_WIDTH_PRECISION_FLAG)
353 {
OFTInteger = 0,
OFTIntegerList = 1,
OFTReal = 2,
OFTRealList = 3,
OFTString = 4,
OFTStringList = 5,
OFTWideString = 6,
OFTWideStringList = 7,
OFTBinary = 8,
OFTDate = 9,
OFTTime = 10,
OFTDateTime = 11,
380 #define OGRNullFID -1
381 #define OGRUnsetMarker -21121
439 #define OLCRandomRead "RandomRead"
440 #define OLCSequentialWrite "SequentialWrite"
441 #define OLCRandomWrite "RandomWrite"
442 #define OLCFastSpatialFilter "FastSpatialFilter"
443 #define OLCFastFeatureCount "FastFeatureCount"
444 #define OLCFastGetExtent "FastGetExtent"
445 #define OLCCreateField "CreateField"
446 #define OLCDeleteField "DeleteField"
447 #define OLCReorderFields "ReorderFields"
448 #define OLCAlterFieldDefn "AlterFieldDefn"
449 #define OLCTransactions "Transactions"
450 #define OLCDeleteFeature "DeleteFeature"
451 #define OLCFastSetNextByIndex "FastSetNextByIndex"
452 #define OLCStringsAsUTF8 "StringsAsUTF8"
453 #define OLCIgnoreFields "IgnoreFields"
455 #define ODsCCreateLayer "CreateLayer"
456 #define ODsCDeleteLayer "DeleteLayer"
458 #define ODrCCreateDataSource "CreateDataSource"
459 #define ODrCDeleteDataSource "DeleteDataSource"
502 OGRSTPenPerOffset = 4,
505 OGRSTPenPriority = 7,
515 OGRSTBrushFColor = 0,
516 OGRSTBrushBColor = 1,
522 OGRSTBrushPriority = 7,
534 OGRSTSymbolAngle = 1,
535 OGRSTSymbolColor = 2,
541 OGRSTSymbolOffset = 8,
542 OGRSTSymbolPriority = 9,
543 OGRSTSymbolFontName = 10,
544 OGRSTSymbolOColor = 11,
554 OGRSTLabelFontName = 0,
556 OGRSTLabelTextString = 2,
558 OGRSTLabelFColor = 4,
559 OGRSTLabelBColor = 5,
560 OGRSTLabelPlacement = 6,
561 OGRSTLabelAnchor = 7,
566 OGRSTLabelItalic = 12,
567 OGRSTLabelUnderline = 13,
568 OGRSTLabelPriority = 14,
569 OGRSTLabelStrikeout = 15,
570 OGRSTLabelStretch = 16,
571 OGRSTLabelAdjHor = 17,
572 OGRSTLabelAdjVert = 18,
573 OGRSTLabelHColor = 19,
574 OGRSTLabelOColor = 20,
585 #ifndef GDAL_VERSION_INFO_DEFINED
586 #define GDAL_VERSION_INFO_DEFINED
587 const char CPL_DLL * CPL_STDCALL GDALVersionInfo(
const char * );
590 #ifndef GDAL_CHECK_VERSION
603 int CPL_DLL CPL_STDCALL
GDALCheckVersion(
int nVersionMajor,
int nVersionMinor,
604 const char* pszCallingComponentName);
607 #define GDAL_CHECK_VERSION(pszCallingComponentName) \
608 GDALCheckVersion(GDAL_VERSION_MAJOR, GDAL_VERSION_MINOR, pszCallingComponentName)