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
#ifndef _OGR_CORE_H_INCLUDED
00106
#define _OGR_CORE_H_INCLUDED
00107
00108
#include "cpl_port.h"
00109
00114
#ifdef __cplusplus
00115 class CPL_DLL OGREnvelope
00116 {
00117
public:
00118 OGREnvelope()
00119 {
00120 MinX = MaxX = MinY = MaxY = 0;
00121 }
00122
double MinX;
00123
double MaxX;
00124
double MinY;
00125
double MaxY;
00126
00127
int IsInit() {
return MinX != 0 || MinY != 0 || MaxX != 0 || MaxY != 0; }
00128
void Merge( OGREnvelope & sOther ) {
00129
if( IsInit() )
00130 {
00131 MinX = MIN(MinX,sOther.
MinX);
00132 MaxX = MAX(MaxX,sOther.
MaxX);
00133 MinY = MIN(MinY,sOther.
MinY);
00134 MaxY = MAX(MaxY,sOther.
MaxY);
00135 }
00136
else
00137 {
00138 MinX = sOther.
MinX;
00139 MaxX = sOther.
MaxX;
00140 MinY = sOther.
MinY;
00141 MaxY = sOther.
MaxY;
00142 }
00143 }
00144 };
00145
#else
00146
typedef struct
00147
{
00148
double MinX;
00149
double MaxX;
00150
double MinY;
00151
double MaxY;
00152 } OGREnvelope;
00153
#endif
00154
00155 CPL_C_START
00156
00157
void CPL_DLL *OGRMalloc( size_t );
00158
void CPL_DLL *OGRCalloc( size_t, size_t );
00159
void CPL_DLL *OGRRealloc(
void *, size_t );
00160
char CPL_DLL *OGRStrdup(
const char * );
00161
void CPL_DLL OGRFree(
void * );
00162
00163
typedef int OGRErr;
00164
00165
#define OGRERR_NONE 0
00166
#define OGRERR_NOT_ENOUGH_DATA 1
00167
#define OGRERR_NOT_ENOUGH_MEMORY 2
00168
#define OGRERR_UNSUPPORTED_GEOMETRY_TYPE 3
00169
#define OGRERR_UNSUPPORTED_OPERATION 4
00170
#define OGRERR_CORRUPT_DATA 5
00171
#define OGRERR_FAILURE 6
00172
#define OGRERR_UNSUPPORTED_SRS 7
00173
00174
typedef int OGRBoolean;
00175
00176
00177
00178
00185
typedef enum
00186 {
00187 wkbUnknown = 0,
00188 wkbPoint = 1,
00189 wkbLineString = 2,
00190 wkbPolygon = 3,
00191 wkbMultiPoint = 4,
00192 wkbMultiLineString = 5,
00193 wkbMultiPolygon = 6,
00194 wkbGeometryCollection = 7,
00195 wkbNone = 100,
00196 wkbLinearRing = 101,
00197 wkbPoint25D = 0x80000001,
00198 wkbLineString25D = 0x80000002,
00199 wkbPolygon25D = 0x80000003,
00200 wkbMultiPoint25D = 0x80000004,
00201 wkbMultiLineString25D = 0x80000005,
00202 wkbMultiPolygon25D = 0x80000006,
00203 wkbGeometryCollection25D = 0x80000007
00204 } OGRwkbGeometryType;
00205
00206
#define wkb25DBit 0x80000000
00207
#define wkbFlatten(x) ((OGRwkbGeometryType) ((x) & (~wkb25DBit)))
00208
00209
#define ogrZMarker 0x21125711
00210
00211
const char CPL_DLL * OGRGeometryTypeToName( OGRwkbGeometryType eType );
00212
00213
typedef enum
00214 {
00215 wkbXDR = 0,
00216 wkbNDR = 1
00217 } OGRwkbByteOrder;
00218
00219
#ifndef NO_HACK_FOR_IBM_DB2_V72
00220
# define HACK_FOR_IBM_DB2_V72
00221
#endif
00222
00223
#ifdef HACK_FOR_IBM_DB2_V72
00224
# define DB2_V72_FIX_BYTE_ORDER(x) ((((x) & 0x31) == (x)) ? (OGRwkbByteOrder) ((x) & 0x1) : (x))
00225
# define DB2_V72_UNFIX_BYTE_ORDER(x) ((unsigned char) (OGRGeometry::bGenerate_DB2_V72_BYTE_ORDER ? ((x) | 0x30) : (x)))
00226
#else
00227
# define DB2_V72_FIX_BYTE_ORDER(x) (x)
00228
# define DB2_V72_UNFIX_BYTE_ORDER(x) (x)
00229
#endif
00230
00231
00232
00233
00234
00241
typedef enum
00242 { OFTInteger = 0, OFTIntegerList = 1, OFTReal = 2, OFTRealList = 3, OFTString = 4, OFTStringList = 5, OFTWideString = 6, OFTWideStringList = 7, OFTBinary = 8
00252 } OGRFieldType;
00253
00258
typedef enum
00259 {
00260 OJUndefined = 0,
00261 OJLeft = 1,
00262 OJRight = 2
00263 } OGRJustification;
00264
00265
#define OGRNullFID -1
00266
#define OGRUnsetMarker -21121
00267
00268
00269
00270
00271
00276 typedef union {
00277
int Integer;
00278
double Real;
00279
char *String;
00280
00281
00282
struct {
00283
int nCount;
00284
int *paList;
00285 } IntegerList;
00286
00287
struct {
00288
int nCount;
00289
double *paList;
00290 } RealList;
00291
00292
struct {
00293
int nCount;
00294
char **paList;
00295 } StringList;
00296
00297
00298
00299
00300
00301
00302
00303
00304
struct {
00305
int nMarker1;
00306
int nMarker2;
00307 } Set;
00308 }
OGRField;
00309
00310
00311
00312
00313
#define OLCRandomRead "RandomRead"
00314
#define OLCSequentialWrite "SequentialWrite"
00315
#define OLCRandomWrite "RandomWrite"
00316
#define OLCFastSpatialFilter "FastSpatialFilter"
00317
#define OLCFastFeatureCount "FastFeatureCount"
00318
#define OLCFastGetExtent "FastGetExtent"
00319
#define OLCCreateField "CreateField"
00320
#define OLCTransactions "Transactions"
00321
#define OLCDeleteFeature "DeleteFeature"
00322
00323
#define ODsCCreateLayer "CreateLayer"
00324
#define ODsCDeleteLayer "DeleteLayer"
00325
00326
#define ODrCCreateDataSource "CreateDataSource"
00327
#define ODrCDeleteDataSource "DeleteDataSource"
00328
00329 CPL_C_END
00330
00331
#endif
00332