00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00030 #ifndef OGR
00031 #define OGR
00032
00033 #include "sys/types.h"
00034 #include "sys/stat.h"
00035 #include "ogr_api.h"
00036 #include "ogr_srs_api.h"
00037
00038 #include <string>
00039
00040 using std::string;
00041
00048 class Ogr
00049 {
00050 private :
00051
00052 OGRSFDriverH formatDriver;
00053
00054 OGRDataSourceH sourceData;
00055 OGRDataSourceH targetData;
00056
00057 OGRLayerH squeryLayer;
00058 OGRLayerH sourceLayer;
00059 OGRLayerH targetLayer;
00060
00061 OGRSpatialReferenceH sourceSRS;
00062 OGRSpatialReferenceH targetSRS;
00063
00064 OGRFeatureDefnH sourceLayerDefn;
00065 OGRwkbGeometryType sourceLayerGeom;
00066
00067 OGRGeometryH sourceGeom;
00068
00069 string sourceName;
00070 string sourceLayerName;
00071 string targetName;
00072
00073 string error;
00074
00082 bool Error( OGRErr e, string &s );
00083
00084 public:
00085
00090 Ogr( void );
00091
00096 ~Ogr( void );
00097
00107 bool OpenSource( string filename, string &epsg, string &query, string &error );
00108
00114 bool CloseSource( void );
00115
00123 bool OpenDriver( string drivername, string error = 0 );
00124
00133 bool OpenTarget( string filename, int projection = 0, bool update = 0 );
00134
00140 bool CloseTarget( void );
00141
00148 bool Execute( string = 0 );
00149
00157 bool Prepare( int &nbFeat, string = 0 );
00158
00164 bool Process( void );
00165 };
00166
00167 #endif