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