00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090
00091
00092
00093
00094
00095
00096
00097
00098
00099
00100
00101
00102
00103
00104
00105
00106
00107
00108
00109
00110
00111
00112
00113
00114
00115
00116
00117 #ifndef _OGR_CORE_H_INCLUDED
00118 #define _OGR_CORE_H_INCLUDED
00119
00120 #include "cpl_port.h"
00121
00126 #ifdef __cplusplus
00127 class CPL_DLL OGREnvelope
00128 {
00129 public:
00130 OGREnvelope()
00131 {
00132 MinX = MaxX = MinY = MaxY = 0;
00133 }
00134 double MinX;
00135 double MaxX;
00136 double MinY;
00137 double MaxY;
00138
00139 int IsInit() { return MinX != 0 || MinY != 0 || MaxX != 0 || MaxY != 0; }
00140 void Merge( OGREnvelope & sOther ) {
00141 if( IsInit() )
00142 {
00143 MinX = MIN(MinX,sOther.MinX);
00144 MaxX = MAX(MaxX,sOther.MaxX);
00145 MinY = MIN(MinY,sOther.MinY);
00146 MaxY = MAX(MaxY,sOther.MaxY);
00147 }
00148 else
00149 {
00150 MinX = sOther.MinX;
00151 MaxX = sOther.MaxX;
00152 MinY = sOther.MinY;
00153 MaxY = sOther.MaxY;
00154 }
00155 }
00156 };
00157 #else
00158 typedef struct
00159 {
00160 double MinX;
00161 double MaxX;
00162 double MinY;
00163 double MaxY;
00164 } OGREnvelope;
00165 #endif
00166
00167 CPL_C_START
00168
00169 void CPL_DLL *OGRMalloc( size_t );
00170 void CPL_DLL *OGRCalloc( size_t, size_t );
00171 void CPL_DLL *OGRRealloc( void *, size_t );
00172 char CPL_DLL *OGRStrdup( const char * );
00173 void CPL_DLL OGRFree( void * );
00174
00175 typedef int OGRErr;
00176
00177 #define OGRERR_NONE 0
00178 #define OGRERR_NOT_ENOUGH_DATA 1
00179 #define OGRERR_NOT_ENOUGH_MEMORY 2
00180 #define OGRERR_UNSUPPORTED_GEOMETRY_TYPE 3
00181 #define OGRERR_UNSUPPORTED_OPERATION 4
00182 #define OGRERR_CORRUPT_DATA 5
00183 #define OGRERR_FAILURE 6
00184 #define OGRERR_UNSUPPORTED_SRS 7
00185
00186 typedef int OGRBoolean;
00187
00188
00189
00190
00197 typedef enum
00198 {
00199 wkbUnknown = 0,
00200 wkbPoint = 1,
00201 wkbLineString = 2,
00202 wkbPolygon = 3,
00203 wkbMultiPoint = 4,
00204 wkbMultiLineString = 5,
00205 wkbMultiPolygon = 6,
00206 wkbGeometryCollection = 7,
00207 wkbNone = 100,
00208 wkbLinearRing = 101,
00209 wkbPoint25D = 0x80000001,
00210 wkbLineString25D = 0x80000002,
00211 wkbPolygon25D = 0x80000003,
00212 wkbMultiPoint25D = 0x80000004,
00213 wkbMultiLineString25D = 0x80000005,
00214 wkbMultiPolygon25D = 0x80000006,
00215 wkbGeometryCollection25D = 0x80000007
00216 } OGRwkbGeometryType;
00217
00218 #define wkb25DBit 0x80000000
00219 #define wkbFlatten(x) ((OGRwkbGeometryType) ((x) & (~wkb25DBit)))
00220
00221 #define ogrZMarker 0x21125711
00222
00223 const char CPL_DLL * OGRGeometryTypeToName( OGRwkbGeometryType eType );
00224
00225 typedef enum
00226 {
00227 wkbXDR = 0,
00228 wkbNDR = 1
00229 } OGRwkbByteOrder;
00230
00231 #ifndef NO_HACK_FOR_IBM_DB2_V72
00232 # define HACK_FOR_IBM_DB2_V72
00233 #endif
00234
00235 #ifdef HACK_FOR_IBM_DB2_V72
00236 # define DB2_V72_FIX_BYTE_ORDER(x) ((((x) & 0x31) == (x)) ? (OGRwkbByteOrder) ((x) & 0x1) : (x))
00237 # define DB2_V72_UNFIX_BYTE_ORDER(x) ((unsigned char) (OGRGeometry::bGenerate_DB2_V72_BYTE_ORDER ? ((x) | 0x30) : (x)))
00238 #else
00239 # define DB2_V72_FIX_BYTE_ORDER(x) (x)
00240 # define DB2_V72_UNFIX_BYTE_ORDER(x) (x)
00241 #endif
00242
00243
00244
00245
00246
00253 typedef enum
00254 { OFTInteger = 0, OFTIntegerList = 1, OFTReal = 2, OFTRealList = 3, OFTString = 4, OFTStringList = 5, OFTWideString = 6, OFTWideStringList = 7, OFTBinary = 8
00264 } OGRFieldType;
00265
00270 typedef enum
00271 {
00272 OJUndefined = 0,
00273 OJLeft = 1,
00274 OJRight = 2
00275 } OGRJustification;
00276
00277 #define OGRNullFID -1
00278 #define OGRUnsetMarker -21121
00279
00280
00281
00282
00283
00288 typedef union {
00289 int Integer;
00290 double Real;
00291 char *String;
00292
00293
00294 struct {
00295 int nCount;
00296 int *paList;
00297 } IntegerList;
00298
00299 struct {
00300 int nCount;
00301 double *paList;
00302 } RealList;
00303
00304 struct {
00305 int nCount;
00306 char **paList;
00307 } StringList;
00308
00309
00310
00311
00312
00313
00314
00315
00316 struct {
00317 int nCount;
00318 GByte *paData;
00319 } Binary;
00320
00321 struct {
00322 int nMarker1;
00323 int nMarker2;
00324 } Set;
00325 } OGRField;
00326
00327
00328
00329
00330 #define OLCRandomRead "RandomRead"
00331 #define OLCSequentialWrite "SequentialWrite"
00332 #define OLCRandomWrite "RandomWrite"
00333 #define OLCFastSpatialFilter "FastSpatialFilter"
00334 #define OLCFastFeatureCount "FastFeatureCount"
00335 #define OLCFastGetExtent "FastGetExtent"
00336 #define OLCCreateField "CreateField"
00337 #define OLCTransactions "Transactions"
00338 #define OLCDeleteFeature "DeleteFeature"
00339 #define OLCFastSetNextByIndex "FastSetNextByIndex"
00340
00341 #define ODsCCreateLayer "CreateLayer"
00342 #define ODsCDeleteLayer "DeleteLayer"
00343
00344 #define ODrCCreateDataSource "CreateDataSource"
00345 #define ODrCDeleteDataSource "DeleteDataSource"
00346
00347 CPL_C_END
00348
00349 #endif
00350