27 #include "../Config.h" 32 #include <boost/shared_ptr.hpp> 39 std::vector< te::rst::BandProperty * > bandsProps;
40 for(
unsigned int bandsPropsIdx = 0 ; bandsPropsIdx < nBands ; ++bandsPropsIdx )
48 std::map< std::string, std::string >(), 0, 0 ) );
50 unsigned int band = 0;
51 unsigned int line = 0;
55 for( band = 0 ; band < nBands ; ++
band )
59 rasterPointer->setValue( col, line, pixelValue, band );
68 const unsigned int nBands = 10;
69 const unsigned int nLines = 10;
70 const unsigned int nCols = 10;
72 boost::shared_ptr< te::rst::Raster > inputRasterPointer;
79 unsigned int band = 0;
80 unsigned int line = 0;
84 for( band = 0 ; band < nBands ; ++
band )
88 cachedRaster.
getValue( col, line, pixelValue, band );
89 cachedRaster.
setValue( col, line, pixelValue + 10.0, band );
96 unsigned int band = 0;
97 unsigned int line = 0;
100 double readPixelValue = 0;
102 for( band = 0 ; band < nBands ; ++
band )
104 for( col = 0 ; col <
nCols ; ++
col )
106 inputRasterPointer->getValue( col, line, readPixelValue, band );
107 CPPUNIT_ASSERT_DOUBLES_EQUAL( pixelValue + 10.0, readPixelValue, 0.0000001 );
117 const unsigned int nBands = 10;
118 const unsigned int nLines = 10;
119 const unsigned int nCols = 10;
121 boost::shared_ptr< te::rst::Raster > inputRasterPointer;
128 unsigned int band = 0;
129 unsigned int line = 0;
130 unsigned int col = 0;
133 for( band = 0 ; band < nBands ; ++
band )
135 for( col = 0 ; col <
nCols ; ++
col )
137 cachedRaster.
getValue( col, line, pixelValue, band );
138 cachedRaster.
setValue( col, line, pixelValue + 10.0, band );
145 unsigned int band = 0;
146 unsigned int line = 0;
147 unsigned int col = 0;
149 double readPixelValue = 0;
151 for( band = 0 ; band < nBands ; ++
band )
153 for( col = 0 ; col <
nCols ; ++
col )
155 inputRasterPointer->getValue( col, line, readPixelValue, band );
156 CPPUNIT_ASSERT_DOUBLES_EQUAL( pixelValue + 10.0, readPixelValue, 0.0000001 );
unsigned int unsigned int std::unique_ptr< te::rst::Raster > & rasterPointer
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.
A test suit for the Cached Raster class interface.
unsigned int unsigned int nCols
A RAM cache adaptor to an external existent raster that must always be avaliable. ...
void CreateTestRaster(unsigned int nBands, unsigned int nLines, unsigned int nCols, boost::shared_ptr< te::rst::Raster > &rasterPointer)
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.
static Raster * make()
It creates and returns an empty raster with default raster driver.
A test suit for the Cached Raster Class.
A rectified grid is the spatial support for raster data.
This file contains include headers for the Data Access module of TerraLib.
CPPUNIT_TEST_SUITE_REGISTRATION(TsCachedRaster)