16 std::cout <<
"Mosaic of georeferenced images example using Raster Processing module." << std::endl << std::endl;
18 std::map<std::string, std::string> auxRasterInfo;
22 auxRasterInfo[
"URI"] = TERRALIB_DATA_DIR
"/geotiff/cbers_rgb342_crop1.tif";
25 if( inputRaster1Pointer == 0 )
27 std::cout <<
"Raster 1 error." << std::endl;
31 auxRasterInfo[
"URI"] = TERRALIB_DATA_DIR
"/geotiff/cbers_rgb342_crop2.tif";
34 if( inputRaster2Pointer == 0 )
36 std::cout <<
"Raster 2 error." << std::endl;
40 auxRasterInfo[
"URI"] = TERRALIB_DATA_DIR
"/geotiff/cbers_rgb342_crop3_EPSG_22522.tif";
43 if( inputRaster3Pointer == 0 )
45 std::cout <<
"Raster 3 error." << std::endl;
53 std::vector< const te::rst::Raster* >
rasters;
54 rasters.push_back( inputRaster1Pointer );
55 rasters.push_back( inputRaster2Pointer );
56 rasters.push_back( inputRaster3Pointer );
61 std::vector< unsigned int >
bands;
82 algoOutputParams.
m_rInfo[
"URI"] =
83 TERRALIB_DATA_DIR
"/geotiff/GeoReferencedImagesMosaicExample.tif";
84 algoOutputParams.
m_rType =
"GDAL";
90 if( ! algorithmInstance.
initialize( algoInputParams ) )
92 std::cout <<
"Algorithm initialization error." << std::endl;
96 if( ! algorithmInstance.
execute( algoOutputParams ) )
98 std::cout <<
"Algorithm execution error." << std::endl;
103 std::cout <<
"Algorithm execution OK." << std::endl << std::endl;
108 delete inputRaster1Pointer;
109 delete inputRaster2Pointer;
110 delete inputRaster3Pointer;
112 catch(
const std::exception& e)
114 std::cout << std::endl <<
"An exception has occurred:" << e.what() << std::endl;
118 std::cout << std::endl <<
"An unexpected exception has occurred!" << std::endl;
A feeder from a input rasters vector;.
These routines show how to use the RP (raster processing) module.
Create a mosaic from a set of geo-referenced rasters.
std::string m_rType
Output raster data source type (as described in te::raster::RasterFactory ).
bool execute(AlgorithmOutputParameters &outputParams) _NOEXCEPT_OP(false)
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) _NOEXCEPT_OP(false)
Initialize the algorithm instance making it ready for execution.
GeoMosaic output parameters.
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.
std::map< std::string, std::string > m_rInfo
The necessary information to create the output rasters (as described in te::raster::RasterFactory).