13 std::cout <<
"Example of how Register a TIF image using Raster Processing module." << std::endl << std::endl;
17 std::map<std::string, std::string> auxRasterInfo;
18 auxRasterInfo[
"URI"] = TERRALIB_DATA_DIR
"/geotiff/cbers_rgb342_crop1.tif";
21 if( inputRasterPointer == 0 )
23 std::cout <<
"Raster 1 error." << std::endl;
38 tiePoint1.first.x = 0.0;
39 tiePoint1.first.y = 0.0;
40 tiePoint1.second.x = 528980.0;
41 tiePoint1.second.y = 7945280.0;
45 tiePoint2.first.x = 874.0;
46 tiePoint2.first.y = 0.0;
47 tiePoint2.second.x = 546460.0;
48 tiePoint2.second.y = 7945280.0;
52 tiePoint3.first.x = 874.0;
53 tiePoint3.first.y = 1008.0;
54 tiePoint3.second.x = 546460.0;
55 tiePoint3.second.y = 7925120.0;
59 tiePoint4.first.x = 0.0;
60 tiePoint4.first.y = 1008.0;
61 tiePoint4.second.x = 528980.0;
62 tiePoint4.second.y = 7925120.0;
72 algoOutputParams.
m_rInfo[
"URI"] =
73 TERRALIB_DATA_DIR
"/GeoReferencedImagesRegisterExample.tif";
74 algoOutputParams.
m_rType =
"GDAL";
80 if( ! algorithmInstance.
initialize( algoInputParams ) )
82 std::cout <<
"Algorithm initialization error." << std::endl;
86 if( ! algorithmInstance.
execute( algoOutputParams ) )
88 std::cout <<
"Algorithm execution error." << std::endl;
93 std::cout <<
"Algorithm execution OK." << std::endl;
98 delete inputRasterPointer;
100 catch(
const std::exception& e)
102 std::cout << std::endl <<
"An exception has occurred:" << e.what() << std::endl;
106 std::cout << std::endl <<
"An unexpected exception has occurred!" << std::endl;
bool execute(AlgorithmOutputParameters &outputParams)
Executes the algorithm using the supplied parameters.
These routines show how to use the RP (raster processing) module.
std::pair< Coord2D, Coord2D > TiePoint
Tie point type definition.
bool initialize(const AlgorithmInputParameters &inputParams)
Initialize the algorithm instance making it ready for execution.
An abstract class for raster data strucutures.
std::map< std::string, std::string > m_rInfo
The necessary information to create the output rasters (as described in te::raster::RasterFactory).
This file contains include headers for the TerraLib Raster Processing module.
Performs raster data registering into a SRS using a set of tie points.
Register output parameters.
std::string m_rType
Output raster data source type (as described in te::raster::RasterFactory ).
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.