20 std::cout <<
"This is a test to open a complex image and split into real/imaginary rasters." << std::endl << std::endl;
22 std::map<std::string, std::string> rinfo;
23 rinfo[
"URI"] = TERRALIB_DATA_DIR
"/geotiff/te_complex.tif";
27 std::map<std::string, std::string> realinfo;
28 realinfo[
"URI"] = TERRALIB_DATA_DIR
"/geotiff/real.tif";
30 std::map<std::string, std::string> imaginfo;
31 imaginfo[
"URI"] = TERRALIB_DATA_DIR
"/geotiff/imag.tif";
37 std::vector<te::rst::BandProperty*> realbprops;
39 std::vector<te::rst::BandProperty*> imagbprops;
49 std::complex<double> value;
54 realraster->
setValue(c, r, value.real());
55 imagraster->
setValue(c, r, value.imag());
62 std::cout <<
"Done!" << std::endl << std::endl;
64 catch(
const std::exception& e)
66 std::cout << std::endl <<
"An exception has occurred in SplitComplexImage(): " << e.what() << std::endl;
70 std::cout << std::endl <<
"An unexpected exception has occurred in SplitComplexImage()!" << std::endl;
virtual void setValue(unsigned int c, unsigned int r, const double value, std::size_t b=0)
Sets the attribute value in a band of a cell.
A raster band description.
unsigned int getNumberOfColumns() const
Returns the raster number of columns.
This is the abstract factory for Rasters.
void SplitComplexImage()
Test to open a complex image and split into real/imaginary rasters.
An abstract class for raster data strucutures.
unsigned int getNumberOfRows() const
Returns the raster number of rows.
Grid * getGrid()
It returns the raster grid.
virtual void getValue(unsigned int c, unsigned int r, double &value, std::size_t b=0) const
Returns the attribute value of a band of a cell.
These routines show how to use the raster module and the GDAL data source module. ...
static Raster * make()
It creates and returns an empty raster with default raster driver.
This file contains include headers for the TerraLib Common Runtime module.
This file contains include headers for the Vector Geometry model of TerraLib.
A rectified grid is the spatial support for raster data.
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.