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