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) 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 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) ISO SQL/MM Part 3.
Definition: ogr_core.h:402
< a Triangle.
Definition: ogr_core.h:365
SFSQL 1.2 and ISO SQL/MM Part 3 extended dimension (Z&M) WKB types.
Definition: ogr_core.h:442
enum ogr_style_tool_param_symbol_id OGRSTSymbolParam
List of parameters for use with OGRStyleSymbol.
ISO SQL/MM Part 3.
Definition: ogr_core.h:386
ISO SQL/MM Part 3.
Definition: ogr_core.h:389
ISO SQL/MM Part 3.
Definition: ogr_core.h:380
OGRFieldSubType
List of field subtypes.
Definition: ogr_core.h:628
wkbCurve with Z component.
Definition: ogr_core.h:373
ogr_style_tool_param_label_id
List of parameters for use with OGRStyleLabel.
Definition: ogr_core.h:848
ISO SQL/MM Part 3.
Definition: ogr_core.h:376
wkbMultiSurface with Z component.
Definition: ogr_core.h:372
Core portability definitions for CPL.
ISO SQL/MM Part 3.
Definition: ogr_core.h:388
ISO SQL/MM Part 3.
Definition: ogr_core.h:385
2.5D extension as per 99-402
Definition: ogr_core.h:420
No subtype.
Definition: ogr_core.h:630
List of 64bit integers.
Definition: ogr_core.h:615
2.5D extension as per 99-402
Definition: ogr_core.h:419
planar 2-dimensional geometric object defined by 1 exterior boundary and 0 or more interior boundarie...
Definition: ogr_core.h:340
a contiguous collection of polygons, which share common boundary segments, ISO SQL/MM Part 3...
Definition: ogr_core.h:359
wkbMultiCurve with Z component.
Definition: ogr_core.h:371
ISO SQL/MM Part 3.
Definition: ogr_core.h:382
Time.
Definition: ogr_core.h:612
non-standard, just for createGeometry()
Definition: ogr_core.h:366
Date.
Definition: ogr_core.h:611
enum ogr_style_tool_param_brush_id OGRSTBrushParam
List of parameters for use with OGRStyleBrush.
ISO SQL/MM Part 3.
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
wkbCompoundCurve with Z component.
Definition: ogr_core.h:369
2.5D extension as per 99-402
Definition: ogr_core.h:416
enum ogr_style_tool_param_label_id OGRSTLabelParam
List of parameters for use with OGRStyleLabel.
ISO SQL/MM Part 3.
Definition: ogr_core.h:393
ogr_style_tool_param_pen_id
List of parameters for use with OGRStylePen.
Definition: ogr_core.h:792
List of doubles.
Definition: ogr_core.h:605
ogr_style_tool_param_symbol_id
List of parameters for use with OGRStyleSymbol.
Definition: ogr_core.h:827
ISO SQL/MM Part 3.
Definition: ogr_core.h:413
geometric object that is a collection of 1 or more geometric objects, standard WKB ...
Definition: ogr_core.h:346
1-dimensional geometric object with linear interpolation between Points, standard WKB ...
Definition: ogr_core.h:338
Double Precision floating point.
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
unknown type, non-standard
Definition: ogr_core.h:335
2.5D extension as per 99-402
Definition: ogr_core.h:421
ISO SQL/MM Part 3.
Definition: ogr_core.h:383
Surface (abstract type).
Definition: ogr_core.h:358
ISO SQL/MM Part 3.
Definition: ogr_core.h:406
int OGR_GT_IsSurface(OGRwkbGeometryType)
Return if a geometry type is an instance of Surface.
Definition: ogrgeometry.cpp:5959
ISO SQL/MM Part 3.
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
GeometryCollection of Points, standard WKB.
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
OGRStyleTool derived class types (returned by GetType()).
Raw Binary data.
Definition: ogr_core.h:610
Single 64bit integer.
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
GeometryCollection of Curves, ISO SQL/MM Part 3.
Definition: ogr_core.h:355
wkbSurface with Z component.
Definition: ogr_core.h:374
2.5D extension as per 99-402
Definition: ogr_core.h:418
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:333
ISO SQL/MM Part 3.
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
const char * GDALVersionInfo(const char *)
Get runtime version information.
Definition: gdal_misc.cpp:1826
OGRwkbGeometryType OGRMergeGeometryTypes(OGRwkbGeometryType eMain, OGRwkbGeometryType eExtra)
Find common geometry type.
Definition: ogrgeometry.cpp:2440
ISO SQL/MM Part 3.
Definition: ogr_core.h:394
OGRwkbGeometryType OGRMergeGeometryTypesEx(OGRwkbGeometryType eMain, OGRwkbGeometryType eExtra, int bAllowPromotingToCurves)
Find common geometry type.
Definition: ogrgeometry.cpp:2476
ISO SQL/MM Part 3.
Definition: ogr_core.h:397
wkbCurvePolygon with Z component.
Definition: ogr_core.h:370
Signed 16-bit integer.
Definition: ogr_core.h:634
a PolyhedralSurface consisting only of Triangle patches ISO SQL/MM Part 3.
Definition: ogr_core.h:361
ISO SQL/MM Part 3.
Definition: ogr_core.h:405
ISO SQL/MM Part 3.
Definition: ogr_core.h:392
ISO SQL/MM Part 3.
Definition: ogr_core.h:375
Boolean integer.
Definition: ogr_core.h:632
ISO SQL/MM Part 3.
Definition: ogr_core.h:384
2.5D extension as per 99-402
Definition: ogr_core.h:417
ISO SQL/MM Part 3.
Definition: ogr_core.h:408
GeometryCollection of LineStrings, standard WKB.
Definition: ogr_core.h:344
ISO SQL/MM Part 3.
Definition: ogr_core.h:399
sequence of contiguous curves, ISO SQL/MM Part 3.
Definition: ogr_core.h:351
OGRJustification
Display justification for field values.
Definition: ogr_core.h:644
ogr_style_tool_units_id
List of units supported by OGRStyleTools.
Definition: ogr_core.h:779
PostGIS 1.X has different codes for CurvePolygon, MultiCurve and MultiSurface.
Definition: ogr_core.h:443
deprecated
Definition: ogr_core.h:609
one or more circular arc segments connected end to end, ISO SQL/MM Part 3.
Definition: ogr_core.h:349
0-dimensional geometric object, standard WKB
Definition: ogr_core.h:337
Single precision (32 bit) floating point.
Definition: ogr_core.h:636
int GDALCheckVersion(int nVersionMajor, int nVersionMinor, const char *pszCallingComponentName)
Return TRUE if GDAL library version at runtime matches nVersionMajor.nVersionMinor.
Definition: gdal_misc.cpp:1938
OGRFieldType
List of feature field types.
Definition: ogr_core.h:600
ISO SQL/MM Part 3.
Definition: ogr_core.h:390
ISO SQL/MM Part 3.
Definition: ogr_core.h:401
Date and Time.
Definition: ogr_core.h:613
Old-style 99-402 extended dimension (Z) WKB types.
Definition: ogr_core.h:441
Simple container for a bounding region in 3D.
Definition: ogr_core.h:161
ISO SQL/MM Part 3.
Definition: ogr_core.h:377
OGRwkbGeometryType OGR_GT_GetLinear(OGRwkbGeometryType eType)
Returns the non-curve geometry type that can contain the passed geometry type.
Definition: ogrgeometry.cpp:5896
OGRwkbVariant
Output variants of WKB we support.
Definition: ogr_core.h:439
wkbCircularString with Z component.
Definition: ogr_core.h:368
deprecated
Definition: ogr_core.h:608
ogr_style_tool_param_brush_id
List of parameters for use with OGRStyleBrush.
Definition: ogr_core.h:809
ISO SQL/MM Part 3.
Definition: ogr_core.h:410
ISO SQL/MM Part 3.
Definition: ogr_core.h:412
Simple container for a bounding region.
Definition: ogr_core.h:48
OGRFeature field attribute value union.
Definition: ogr_core.h:662
ISO SQL/MM Part 3.
Definition: ogr_core.h:411
ISO SQL/MM Part 3.
Definition: ogr_core.h:400
ISO SQL/MM Part 3.
Definition: ogr_core.h:381
ISO SQL/MM Part 3.
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
GeometryCollection of Surfaces, ISO SQL/MM Part 3.
Definition: ogr_core.h:356
ogr_style_tool_class_id
OGRStyleTool derived class types (returned by GetType()).
Definition: ogr_core.h:766
ISO SQL/MM Part 3.
Definition: ogr_core.h:395
ISO SQL/MM Part 3.
Definition: ogr_core.h:398
ISO SQL/MM Part 3.
Definition: ogr_core.h:404
planar surface, defined by 1 exterior boundary and zero or more interior boundaries, that are curves.
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
GeometryCollection of Polygons, standard WKB.
Definition: ogr_core.h:345
String of ASCII chars.
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
2.5D extension as per 99-402
Definition: ogr_core.h:415
const char * OGRGeometryTypeToName(OGRwkbGeometryType eType)
Fetch a human readable name corresponding to an OGRwkbGeometryType value.
Definition: ogrgeometry.cpp:2247
int OGRParseDate(const char *pszInput, OGRField *psOutput, int nOptions)
Parse date string.
Definition: ogrutils.cpp:933
Array of strings.
Definition: ogr_core.h:607
ISO SQL/MM Part 3.
Definition: ogr_core.h:391
List of 32bit integers.
Definition: ogr_core.h:603
ISO SQL/MM Part 3.
Definition: ogr_core.h:387
Simple 32bit integer.
Definition: ogr_core.h:602
Curve (abstract type).
Definition: ogr_core.h:357
int OGR_GT_IsCurve(OGRwkbGeometryType)
Return if a geometry type is an instance of Curve.
Definition: ogrgeometry.cpp:5938