openModeller
Version 1.4.0
|
00001 00029 #ifndef _GEO_TRANSFHH_ 00030 #define _GEO_TRANSFHH_ 00031 00032 #include <openmodeller/os_specific.hh> 00033 #include <openmodeller/om_defs.hh> 00034 #include <string> 00035 00036 class OGRCoordinateTransformation; 00037 00038 00039 /****************************************************************/ 00040 /******************** Geographic Transformation *****************/ 00041 00057 /****************/ 00058 class dllexp GeoTransform 00059 { 00060 public: 00061 00062 // 'dst' and 'src' must follow the WKT (Well Known Text) format. 00063 // 00064 // TODO: expand to use EPSG, ESRI or Proj4 formats. 00065 // 00066 GeoTransform(); 00067 GeoTransform( const std::string& in, const std::string& out ); 00068 ~GeoTransform(); 00069 00070 void change( const std::string& in, const std::string& out ); 00071 void change(); 00072 00073 // From 'out' to 'in'. 00074 int transfIn( double *x, double *y ) const; 00075 int transfIn( double *x, double *y, double x0, double y0 ) const; 00076 00077 // From 'in' to 'out'. 00078 int transfOut( double *x, double *y ) const; 00079 int transfOut( double *x, double *y, double x0, double y0 ) const; 00080 00081 // Default coordinate system. 00082 static char const * getDefaultCS(); 00083 00084 // Compare two coordinate system strings (WKT). 00085 static bool compareCoordSystemStrings(char const * s1, char const * s2); 00086 00087 private: 00088 00089 bool identity; 00090 00091 OGRCoordinateTransformation *f_ctin; 00092 OGRCoordinateTransformation *f_ctout; 00093 00094 // Disable copying. 00095 GeoTransform( const GeoTransform& ); 00096 GeoTransform& operator=( const GeoTransform& ); 00097 00098 }; 00099 00100 00101 00102 #endif