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
00118
00119
00120
00121
00122
00123 #ifndef _OGR_CORE_H_INCLUDED
00124 #define _OGR_CORE_H_INCLUDED
00125
00126 #include "cpl_port.h"
00127
00132 #ifdef __cplusplus
00133 class CPL_DLL OGREnvelope
00134 {
00135 public:
00136 OGREnvelope()
00137 {
00138 MinX = MaxX = MinY = MaxY = 0;
00139 }
00140 double MinX;
00141 double MaxX;
00142 double MinY;
00143 double MaxY;
00144
00145 int IsInit() { return MinX != 0 || MinY != 0 || MaxX != 0 || MaxY != 0; }
00146 void Merge( OGREnvelope & sOther ) {
00147 if( IsInit() )
00148 {
00149 MinX = MIN(MinX,sOther.MinX);
00150 MaxX = MAX(MaxX,sOther.MaxX);
00151 MinY = MIN(MinY,sOther.MinY);
00152 MaxY = MAX(MaxY,sOther.MaxY);
00153 }
00154 else
00155 {
00156 MinX = sOther.MinX;
00157 MaxX = sOther.MaxX;
00158 MinY = sOther.MinY;
00159 MaxY = sOther.MaxY;
00160 }
00161 }
00162 };
00163 #else
00164 typedef struct
00165 {
00166 double MinX;
00167 double MaxX;
00168 double MinY;
00169 double MaxY;
00170 } OGREnvelope;
00171 #endif
00172
00173 CPL_C_START
00174
00175 void CPL_DLL *OGRMalloc( size_t );
00176 void CPL_DLL *OGRCalloc( size_t, size_t );
00177 void CPL_DLL *OGRRealloc( void *, size_t );
00178 char CPL_DLL *OGRStrdup( const char * );
00179 void CPL_DLL OGRFree( void * );
00180
00181 typedef int OGRErr;
00182
00183 #define OGRERR_NONE 0
00184 #define OGRERR_NOT_ENOUGH_DATA 1
00185 #define OGRERR_NOT_ENOUGH_MEMORY 2
00186 #define OGRERR_UNSUPPORTED_GEOMETRY_TYPE 3
00187 #define OGRERR_UNSUPPORTED_OPERATION 4
00188 #define OGRERR_CORRUPT_DATA 5
00189 #define OGRERR_FAILURE 6
00190 #define OGRERR_UNSUPPORTED_SRS 7
00191
00192 typedef int OGRBoolean;
00193
00194
00195
00196
00203 typedef enum
00204 {
00205 wkbUnknown = 0,
00206 wkbPoint = 1,
00207 wkbLineString = 2,
00208 wkbPolygon = 3,
00209 wkbMultiPoint = 4,
00210 wkbMultiLineString = 5,
00211 wkbMultiPolygon = 6,
00212 wkbGeometryCollection = 7,
00213 wkbNone = 100,
00214 wkbLinearRing = 101,
00215 wkbPoint25D = 0x80000001,
00216 wkbLineString25D = 0x80000002,
00217 wkbPolygon25D = 0x80000003,
00218 wkbMultiPoint25D = 0x80000004,
00219 wkbMultiLineString25D = 0x80000005,
00220 wkbMultiPolygon25D = 0x80000006,
00221 wkbGeometryCollection25D = 0x80000007
00222 } OGRwkbGeometryType;
00223
00224 #define wkb25DBit 0x80000000
00225 #define wkbFlatten(x) ((OGRwkbGeometryType) ((x) & (~wkb25DBit)))
00226
00227 #define ogrZMarker 0x21125711
00228
00229 const char CPL_DLL * OGRGeometryTypeToName( OGRwkbGeometryType eType );
00230
00231 typedef enum
00232 {
00233 wkbXDR = 0,
00234 wkbNDR = 1
00235 } OGRwkbByteOrder;
00236
00237 #ifndef NO_HACK_FOR_IBM_DB2_V72
00238 # define HACK_FOR_IBM_DB2_V72
00239 #endif
00240
00241 #ifdef HACK_FOR_IBM_DB2_V72
00242 # define DB2_V72_FIX_BYTE_ORDER(x) ((((x) & 0x31) == (x)) ? (OGRwkbByteOrder) ((x) & 0x1) : (x))
00243 # define DB2_V72_UNFIX_BYTE_ORDER(x) ((unsigned char) (OGRGeometry::bGenerate_DB2_V72_BYTE_ORDER ? ((x) | 0x30) : (x)))
00244 #else
00245 # define DB2_V72_FIX_BYTE_ORDER(x) (x)
00246 # define DB2_V72_UNFIX_BYTE_ORDER(x) (x)
00247 #endif
00248
00249
00250
00251
00252
00259 typedef enum
00260 { OFTInteger = 0, OFTIntegerList = 1, OFTReal = 2, OFTRealList = 3, OFTString = 4, OFTStringList = 5, OFTWideString = 6, OFTWideStringList = 7, OFTBinary = 8, OFTDate = 9, OFTTime = 10, OFTDateTime = 11
00273 } OGRFieldType;
00274
00279 typedef enum
00280 {
00281 OJUndefined = 0,
00282 OJLeft = 1,
00283 OJRight = 2
00284 } OGRJustification;
00285
00286 #define OGRNullFID -1
00287 #define OGRUnsetMarker -21121
00288
00289
00290
00291
00292
00297 typedef union {
00298 int Integer;
00299 double Real;
00300 char *String;
00301
00302
00303 struct {
00304 int nCount;
00305 int *paList;
00306 } IntegerList;
00307
00308 struct {
00309 int nCount;
00310 double *paList;
00311 } RealList;
00312
00313 struct {
00314 int nCount;
00315 char **paList;
00316 } StringList;
00317
00318
00319
00320
00321
00322
00323
00324
00325 struct {
00326 int nCount;
00327 GByte *paData;
00328 } Binary;
00329
00330 struct {
00331 int nMarker1;
00332 int nMarker2;
00333 } Set;
00334
00335 struct {
00336 GInt16 Year;
00337 GByte Month;
00338 GByte Day;
00339 GByte Hour;
00340 GByte Minute;
00341 GByte Second;
00342 GByte TZFlag;
00343
00344 } Date;
00345 } OGRField;
00346
00347 int CPL_DLL OGRParseDate( const char *pszInput, OGRField *psOutput,
00348 int nOptions );
00349
00350
00351
00352
00353 #define OLCRandomRead "RandomRead"
00354 #define OLCSequentialWrite "SequentialWrite"
00355 #define OLCRandomWrite "RandomWrite"
00356 #define OLCFastSpatialFilter "FastSpatialFilter"
00357 #define OLCFastFeatureCount "FastFeatureCount"
00358 #define OLCFastGetExtent "FastGetExtent"
00359 #define OLCCreateField "CreateField"
00360 #define OLCTransactions "Transactions"
00361 #define OLCDeleteFeature "DeleteFeature"
00362 #define OLCFastSetNextByIndex "FastSetNextByIndex"
00363
00364 #define ODsCCreateLayer "CreateLayer"
00365 #define ODsCDeleteLayer "DeleteLayer"
00366
00367 #define ODrCCreateDataSource "CreateDataSource"
00368 #define ODrCDeleteDataSource "DeleteDataSource"
00369
00370 CPL_C_END
00371
00372 #endif
00373