openModeller  Version 1.4.0
RemoteRaster.hh
Go to the documentation of this file.
00001 
00027 #ifndef _REMOTE_RASTERHH_
00028 #define _REMOTE_RASTERHH_
00029 
00030 #include <openmodeller/env_io/Raster.hh>
00031 #include <openmodeller/env_io/GdalRaster.hh>
00032 
00033 #include <string>
00034 #include <stdio.h>
00035 
00036 #define OM_REMOTE_RASTER_SUBDIR "r_layers"
00037 
00038 class GDALDataset;
00039 class MapFormat;
00040 
00041 /*************************************************************/
00042 /*********************** Remote Raster ***********************/
00043 
00044 struct CacheFile {
00045 
00046   const char *fileName;
00047   FILE *stream;
00048 };
00049 
00055 class dllexp RemoteRaster : public GdalRaster
00056 {
00057 public:
00061   static Raster* CreateRasterCallback();
00062 
00066   RemoteRaster():GdalRaster() {};
00067 
00071   ~RemoteRaster();
00072 
00080   void createRaster( const std::string& str, int categ = 0 );
00081 
00089   #ifdef MPI_FOUND
00090   void createRaster( const std::string& output_file, const std::string& file, const MapFormat& format );
00091   #else
00092   void createRaster( const std::string& str, const MapFormat& format );
00093   #endif
00094 
00100   int put( Coord x, Coord y, Scalar val );
00101 
00107   int put( Coord x, Coord y );
00108 
00112   void finish();
00113 
00117   int deleteRaster();
00118 
00121   static bool isFromRejectedSource( const std::string& str );
00122 
00123 private:
00124 
00125   // Disable copying.
00126   RemoteRaster( const RemoteRaster& );
00127   RemoteRaster& operator=( const RemoteRaster& );
00128 
00131   static size_t _writeData(void *buffer, size_t size, size_t nmemb, void *stream);
00132 };
00133 
00134 #endif