17 std::cout <<
"This test uses the memory driver." << std::endl << std::endl;
19 std::map<std::string, std::string> rinfo;
20 rinfo[
"URI"] = TERRALIB_DATA_DIR
"/geotiff/cbers2b_rgb342_crop.tif";
27 std::cout <<
"band " << 0 << std::endl;
28 std::cout <<
" min val: " << *rs->at(0).m_minVal << std::endl;
29 std::cout <<
" max val: " << *rs->at(0).m_maxVal << std::endl;
30 std::cout <<
" std val: " << *rs->at(0).m_stdVal << std::endl;
31 std::cout <<
" mean val: " << *rs->at(0).m_meanVal << std::endl;
33 std::cout <<
" histogram:" << std::endl;
34 std::cout <<
" " << *rs->at(0).m_minVal << std::endl;
36 std::map<double, unsigned>::iterator it = rs->at(0).m_histogramR->begin();
37 while (it != rs->at(0).m_histogramR->end())
41 for (
unsigned i = 0; i < it->second; i+=200)
44 std::cout << std::endl;
50 std::cout <<
" " << *rs->at(0).m_maxVal << std::endl;
54 std::cout <<
"Done!" << std::endl << std::endl;
56 catch(
const std::exception& e)
58 std::cout << std::endl <<
"An exception has occurred in RasterInMemory(): " << e.what() << std::endl;
62 std::cout << std::endl <<
"An unexpected exception has occurred in RasterInMemory()!" << std::endl;
void RasterInMemory()
An example to use the memory driver.
A raster class for memory.
This file contains include headers for the memory data source of TerraLib.
A singleton for keeping raster summaries (most statistics).
This is the abstract factory for Rasters.
static RasterSummaryManager & getInstance()
It returns a reference to the singleton instance.
An abstract class for raster data strucutures.
boost::ptr_vector< BandSummary > RasterSummary
RasterSummary is just a typedef of a boost::ptr_vector.
These routines show how to use the raster module and the GDAL data source module. ...
Calculate all the summary types.
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.