13 std::cout <<
"Example of how to apply the IHS Fusion using Raster Processing module." << std::endl << std::endl;
17 std::map<std::string, std::string> auxRasterInfo1;
18 auxRasterInfo1[
"URI"] = TERRALIB_DATA_DIR
"/geotiff/cbers2b_rgb342_crop.tif";
21 if( inputRasterPointer1 == 0 )
23 std::cout <<
"Raster 1 error." << std::endl;
27 std::map<std::string, std::string> auxRasterInfo2;
28 auxRasterInfo2[
"URI"] = TERRALIB_DATA_DIR
"/geotiff/cbers2b_hrc_crop.tif";
31 if( inputRasterPointer2 == 0 )
33 std::cout <<
"Raster 2 error." << std::endl;
50 algoOutputParams.
m_rInfo[
"URI"] =
51 TERRALIB_DATA_DIR
"/geotiff/IHSFusionExample.tif";
52 algoOutputParams.
m_rType =
"GDAL";
58 if( ! algorithmInstance.
initialize( algoInputParams ) )
60 std::cout <<
"Algorithm initialization error." << std::endl;
64 if( ! algorithmInstance.
execute( algoOutputParams ) )
66 std::cout <<
"Algorithm execution error." << std::endl;
71 std::cout <<
"Algorithm execution OK." << std::endl;
76 delete inputRasterPointer1;
77 delete inputRasterPointer2;
79 catch(
const std::exception& e)
81 std::cout << std::endl <<
"An exception has occurred:" << e.what() << std::endl;
85 std::cout << std::endl <<
"An unexpected exception has occurred!" << std::endl;
std::map< std::string, std::string > m_rInfo
The necessary information to create the output rasters (as described in te::raster::RasterFactory).
std::string m_rType
Output raster data source type (as described in te::raster::RasterFactory ).
Fusion of a low-resolution multi-band image with a high resolution image using the IHS method...
These routines show how to use the RP (raster processing) module.
IHSFusion output parameters.
bool execute(AlgorithmOutputParameters &outputParams)
Executes the algorithm using the supplied parameters.
An abstract class for raster data strucutures.
This file contains include headers for the TerraLib Raster Processing module.
bool initialize(const AlgorithmInputParameters &inputParams)
Initialize the algorithm instance making it ready for execution.
static Raster * open(const std::map< std::string, std::string > &rinfo, te::common::AccessPolicy p=te::common::RAccess)
It opens a raster with the given parameters and default raster driver.