27 #include "../Config.h" 37 #define BOOST_TEST_NO_MAIN 38 #include <boost/test/unit_test.hpp> 39 #include <boost/lexical_cast.hpp> 40 #include <boost/timer.hpp> 46 std::vector< te::rst::BandProperty * > bandsProps;
56 bandsProps[ 0 ]->m_noDataValue = std::numeric_limits< double >::max();
57 bandsProps[ 1 ]->m_noDataValue = std::numeric_limits< double >::max();
58 bandsProps[ 2 ]->m_noDataValue = std::numeric_limits< double >::max();
60 std::map< std::string, std::string > rInfo;
61 rInfo[
"URI"] =
"terralib_unittest_rp_functions_CreateFixedStepPalette.tif";
67 std::vector< te::rst::BandProperty::ColorEntry > palette;
70 unsigned int line = 0;
73 for( line = 0 ; line < 256 ; ++
line )
74 for( col = 0 ; col < 256 ; ++
col )
76 rasterPointer->setValue( col, line, (
double)palette[ line ].c1, 0 );
77 rasterPointer->setValue( col, line, (
double)palette[ line ].c2, 1 );
78 rasterPointer->setValue( col, line, (
double)palette[ line ].c3, 2 );
86 std::map<std::string, std::string> auxRasterInfo;
87 std::map<double, double> limits;
88 for (
int lim = 0; lim < 255; lim += 25)
89 limits.insert(std::pair<double, double>((
double)lim, (
double)lim + 25));
91 auxRasterInfo[
"URI"] = TERRALIB_DATA_DIR
"/geotiff/cbers2b_hrc_crop.tif";
94 BOOST_CHECK( diskRasterPtr.get() );
97 std::unique_ptr< te::rst::Raster > outRasterPtr;
98 std::map<std::string, std::string> auxRasterInfo2;
99 auxRasterInfo2[
"URI"] =
"terralib_unittest_rp_functions_RasterSlicing_RGB.tif";
101 *diskRasterPtr.get(),
115 std::unique_ptr< te::rst::Raster > outRasterPtr;
116 std::map<std::string, std::string> auxRasterInfo2;
117 auxRasterInfo2[
"URI"] =
"terralib_unittest_rp_functions_RasterSlicing_palette.tif";
119 *diskRasterPtr.get(),
137 std::map<std::string, std::string> auxRasterInfo;
139 auxRasterInfo[
"URI"] = TERRALIB_DATA_DIR
"/geotiff/cbers2b_rgb342_crop.tif";
142 BOOST_CHECK( diskRasterPtr.get() );
144 auxRasterInfo.clear();
145 auxRasterInfo[
"MEM_RASTER_NROWS"] = boost::lexical_cast< std::string >(
146 diskRasterPtr->getNumberOfRows() );
147 auxRasterInfo[
"MEM_RASTER_NCOLS"] = boost::lexical_cast< std::string >(
148 diskRasterPtr->getNumberOfColumns() );
150 auxRasterInfo[
"MEM_RASTER_NBANDS"] =
"3";
153 "MEM", 0, std::vector<te::rst::BandProperty*>(), auxRasterInfo) );
154 BOOST_CHECK( ihsRasterPtr.get() );
160 auxRasterInfo.clear();
161 auxRasterInfo[
"MEM_RASTER_NROWS"] = boost::lexical_cast< std::string >(
162 diskRasterPtr->getNumberOfRows() );
163 auxRasterInfo[
"MEM_RASTER_NCOLS"] = boost::lexical_cast< std::string >(
164 diskRasterPtr->getNumberOfColumns() );
166 auxRasterInfo[
"MEM_RASTER_NBANDS"] =
"3";
169 "MEM", 0, std::vector<te::rst::BandProperty*>(), auxRasterInfo) );
170 BOOST_CHECK( rgbRasterPtr.get() );
174 std::vector< te::rst::BandProperty * > bandProps;
179 auxRasterInfo[
"URI"] =
"terralib_unittest_rp_functions_ihs2rgb.tif";
182 "GDAL",
new te::rst::Grid( *( diskRasterPtr->getGrid() ) ), bandProps,
183 auxRasterInfo, 0, 0 ) );
184 BOOST_CHECK( outDiskRasterPtr.get() );
186 const size_t nBands = outDiskRasterPtr->getNumberOfBands();
187 const unsigned int nCols = outDiskRasterPtr->getNumberOfColumns();
188 const unsigned int nRows = outDiskRasterPtr->getNumberOfRows();
189 unsigned int col = 0;
190 unsigned int row = 0;
195 for( row = 0 ; row < nRows ; ++row )
197 for( col = 0 ; col <
nCols ; ++
col )
199 rgbRasterPtr->getValue( col, row, value,
band );
200 outDiskRasterPtr->setValue( col, row, value,
band );
210 std::map<std::string, std::string> auxRasterInfo;
212 auxRasterInfo[
"URI"] = TERRALIB_DATA_DIR
"/geotiff/cbers2b_rgb342_crop.tif";
215 BOOST_CHECK(diskRasterPtr.get());
217 auxRasterInfo.clear();
218 auxRasterInfo[
"MEM_RASTER_NROWS"] = boost::lexical_cast< std::string >(
219 diskRasterPtr->getNumberOfRows());
220 auxRasterInfo[
"MEM_RASTER_NCOLS"] = boost::lexical_cast< std::string >(
221 diskRasterPtr->getNumberOfColumns());
223 auxRasterInfo[
"MEM_RASTER_NBANDS"] =
"3";
226 "MEM", 0, std::vector<te::rst::BandProperty*>(), auxRasterInfo));
227 BOOST_CHECK(hlsRasterPtr.get());
233 auxRasterInfo.clear();
234 auxRasterInfo[
"MEM_RASTER_NROWS"] = boost::lexical_cast< std::string >(
235 diskRasterPtr->getNumberOfRows());
236 auxRasterInfo[
"MEM_RASTER_NCOLS"] = boost::lexical_cast< std::string >(
237 diskRasterPtr->getNumberOfColumns());
239 auxRasterInfo[
"MEM_RASTER_NBANDS"] =
"3";
242 "MEM", 0, std::vector<te::rst::BandProperty*>(), auxRasterInfo));
243 BOOST_CHECK(rgbRasterPtr.get());
247 std::vector< te::rst::BandProperty * > bandProps;
252 auxRasterInfo[
"URI"] =
"terralib_unittest_rp_functions_hls2rgb.tif";
255 "GDAL",
new te::rst::Grid(*(diskRasterPtr->getGrid())), bandProps,
256 auxRasterInfo, 0, 0));
257 BOOST_CHECK(outDiskRasterPtr.get());
259 const size_t nBands = outDiskRasterPtr->getNumberOfBands();
260 const unsigned int nCols = outDiskRasterPtr->getNumberOfColumns();
261 const unsigned int nRows = outDiskRasterPtr->getNumberOfRows();
262 unsigned int col = 0;
263 unsigned int row = 0;
268 for (row = 0; row < nRows; ++row)
272 rgbRasterPtr->getValue(col, row, value,
band);
273 outDiskRasterPtr->setValue(col, row, value,
band);
283 std::map<std::string, std::string> auxRasterInfo;
285 auxRasterInfo[
"URI"] = TERRALIB_DATA_DIR
"/geotiff/cbers2b_hrc_crop.tif";
288 BOOST_CHECK( diskRasterPtr.get() );
290 double meanValue = 0;
295 BOOST_CHECK_CLOSE( 181.340256531345, meanValue, 0.0001 );
302 std::map<std::string, std::string> auxRasterInfo;
304 auxRasterInfo[
"URI"] = TERRALIB_DATA_DIR
"/geotiff/cbers2b_hrc_crop.tif";
307 BOOST_CHECK( diskRasterPtr.get() );
309 double meanValue = 0;
314 BOOST_CHECK_CLOSE( 181.340256531345, meanValue, 0.0001 );
321 std::map<std::string, std::string> auxRasterInfo;
323 auxRasterInfo[
"URI"] = TERRALIB_DATA_DIR
"/geotiff/cbers2b_hrc_crop.tif";
326 BOOST_CHECK( diskRasterPtr.get() );
328 double covarianceValue = 0;
332 *diskRasterPtr->getBand( 0 ), 1, 0, 0, covarianceValue) );
334 BOOST_CHECK_CLOSE( 2143.89743610679, covarianceValue, 0.0001 );
341 std::map<std::string, std::string> auxRasterInfo;
343 auxRasterInfo[
"URI"] = TERRALIB_DATA_DIR
"/geotiff/cbers2b_hrc_crop.tif";
346 BOOST_CHECK( diskRasterPtr.get() );
348 double covarianceValue = 0;
352 *diskRasterPtr->getBand( 0 ), 4, 0, 0, covarianceValue) );
354 BOOST_CHECK_CLOSE( 2143.89743610679, covarianceValue, 0.0001 );
361 std::map<std::string, std::string> auxRasterInfo;
363 auxRasterInfo[
"URI"] = TERRALIB_DATA_DIR
"/geotiff/cbers2b_rgb342_crop.tif";
366 BOOST_CHECK( diskRasterPtr.get() );
368 std::vector< te::rst::BandProperty * > bandProps1;
369 bandProps1.push_back(
new te::rst::BandProperty( *( diskRasterPtr->getBand( 0 )->getProperty() ) ) );
370 bandProps1[ 0 ]->m_blkh = diskRasterPtr->getNumberOfRows();
371 bandProps1[ 0 ]->m_blkw = diskRasterPtr->getNumberOfColumns();
372 bandProps1[ 0 ]->m_nblocksx = 1;
373 bandProps1[ 0 ]->m_nblocksy = 1;
375 bandProps1.push_back(
new te::rst::BandProperty( *( diskRasterPtr->getBand( 1 )->getProperty() ) ) );
376 bandProps1[ 1 ]->m_blkh = diskRasterPtr->getNumberOfRows();
377 bandProps1[ 1 ]->m_blkw = diskRasterPtr->getNumberOfColumns();
378 bandProps1[ 1 ]->m_nblocksx = 1;
379 bandProps1[ 1 ]->m_nblocksy = 1;
381 bandProps1.push_back(
new te::rst::BandProperty( *( diskRasterPtr->getBand( 2 )->getProperty() ) ) );
382 bandProps1[ 2 ]->m_blkh = diskRasterPtr->getNumberOfRows();
383 bandProps1[ 2 ]->m_blkw = diskRasterPtr->getNumberOfColumns();
384 bandProps1[ 2 ]->m_nblocksx = 1;
385 bandProps1[ 2 ]->m_nblocksy = 1;
389 "MEM",
new te::rst::Grid( *( diskRasterPtr->getGrid() ) ), bandProps1,
390 std::map<std::string, std::string>(), 0, 0 ) );
391 BOOST_CHECK( pcaRasterPtr.get() );
393 std::vector< unsigned int > inputRasterBands;
394 inputRasterBands.push_back( 0 );
395 inputRasterBands.push_back( 1 );
396 inputRasterBands.push_back( 2 );
398 boost::numeric::ublas::matrix< double > pcaMatrix;
408 BOOST_CHECK(
te::rp::Copy2DiskRaster( *pcaRasterPtr,
"terralib_unittest_rp_functions_DirectPrincipalComponents.tif" ) ) ;
410 auxRasterInfo.clear();
411 auxRasterInfo[
"URI"] =
"terralib_unittest_rp_functions_InversePrincipalComponents.tif";
413 std::vector< te::rst::BandProperty * > bandProps2;
414 bandProps2.push_back(
new te::rst::BandProperty( *( diskRasterPtr->getBand( 0 )->getProperty() ) ) );
415 bandProps2.push_back(
new te::rst::BandProperty( *( diskRasterPtr->getBand( 1 )->getProperty() ) ) );
416 bandProps2.push_back(
new te::rst::BandProperty( *( diskRasterPtr->getBand( 2 )->getProperty() ) ) );
419 "GDAL",
new te::rst::Grid( *( diskRasterPtr->getGrid() ) ), bandProps2,
420 auxRasterInfo, 0, 0 ) );
421 BOOST_CHECK( outDiskRasterPtr.get() );
435 std::map<std::string, std::string> auxRasterInfo;
437 auxRasterInfo[
"URI"] = TERRALIB_DATA_DIR
"/geotiff/cbers2b_rgb342_crop.tif";
440 BOOST_CHECK( diskRasterPtr.get() );
442 std::vector< te::rst::BandProperty * > bandProps1;
443 bandProps1.push_back(
new te::rst::BandProperty( *( diskRasterPtr->getBand( 0 )->getProperty() ) ) );
445 bandProps1.push_back(
new te::rst::BandProperty( *( diskRasterPtr->getBand( 1 )->getProperty() ) ) );
447 bandProps1.push_back(
new te::rst::BandProperty( *( diskRasterPtr->getBand( 2 )->getProperty() ) ) );
451 "MEM",
new te::rst::Grid( *( diskRasterPtr->getGrid() ) ), bandProps1,
452 std::map<std::string, std::string>(), 0, 0 ) );
453 BOOST_CHECK( pcaRasterPtr.get() );
455 std::vector< unsigned int > inputRasterBands;
456 inputRasterBands.push_back( 0 );
457 inputRasterBands.push_back( 1 );
458 inputRasterBands.push_back( 2 );
460 boost::numeric::ublas::matrix< double > pcaMatrix;
470 BOOST_CHECK(
te::rp::Copy2DiskRaster( *pcaRasterPtr,
"terralib_unittest_rp_functions_DirectPrincipalComponentsOptimized.tif" ) ) ;
472 std::vector< te::rst::BandProperty * > bandProps;
477 auxRasterInfo.clear();
478 auxRasterInfo[
"URI"] =
"terralib_unittest_rp_functions_InversePrincipalComponentsOptimized.tif";
481 "GDAL",
new te::rst::Grid( *( diskRasterPtr->getGrid() ) ), bandProps,
482 auxRasterInfo, 0, 0 ) );
483 BOOST_CHECK( outDiskRasterPtr.get() );
497 std::map<std::string, std::string> auxRasterInfo;
499 auxRasterInfo[
"URI"] = TERRALIB_DATA_DIR
"/geotiff/cbers2b_hrc_crop.tif";
502 BOOST_CHECK( diskRasterPtr.get() );
504 double stdDevValue = 0;
509 BOOST_CHECK_CLOSE( 46.302240075, stdDevValue, 0.0001 );
516 std::map<std::string, std::string> auxRasterInfo;
518 auxRasterInfo[
"URI"] = TERRALIB_DATA_DIR
"/geotiff/cbers2b_hrc_crop.tif";
521 BOOST_CHECK( diskRasterPtr.get() );
523 double stdDevValue = 0;
528 BOOST_CHECK_CLOSE( 46.302240075, stdDevValue, 0.0001 );
535 std::map<std::string, std::string> auxRasterInfo;
537 auxRasterInfo[
"URI"] = TERRALIB_DATA_DIR
"/geotiff/cbers2b_rgb342_crop.tif";
540 BOOST_CHECK( diskRasterPtr.get() );
542 std::vector< unsigned int > inputRasterBands;
543 inputRasterBands.push_back( 2 );
544 inputRasterBands.push_back( 0 );
546 std::vector< std::map<std::string, std::string> > outputRastersInfos( 2 );
547 outputRastersInfos[ 0 ][
"URI" ] =
"terralib_unittest_rp_functions_DecomposeBands_2.tif";
548 outputRastersInfos[ 1 ][
"URI" ] =
"terralib_unittest_rp_functions_DecomposeBands_0.tif";
550 std::vector< boost::shared_ptr< te::rst::Raster > > outputRastersPtrs;
553 outputRastersInfos,
"GDAL", outputRastersPtrs ) );
560 std::map<std::string, std::string> auxRasterInfo;
562 auxRasterInfo[
"URI"] = TERRALIB_DATA_DIR
"/geotiff/cbers_rgb342_crop2.tif";
565 BOOST_CHECK( diskRasterPtr1.get() );
567 auxRasterInfo[
"URI"] = TERRALIB_DATA_DIR
"/geotiff/cbers_rgb342_crop3.tif";
570 BOOST_CHECK( diskRasterPtr2.get() );
572 std::vector< const te::rst::Raster * >
rasters;
573 rasters.push_back( diskRasterPtr1.get() );
574 rasters.push_back( diskRasterPtr2.get() );
578 std::vector< unsigned int > inputRasterBands;
579 inputRasterBands.push_back( 2 );
580 inputRasterBands.push_back( 0 );
582 std::map<std::string, std::string> outputRasterInfo;
583 outputRasterInfo[
"URI"] =
"terralib_unittest_rp_functions_ComposeBandsSameSRID.tif";
585 std::unique_ptr< te::rst::Raster > outputRasterPtr;
589 "GDAL", outputRasterPtr ) );
596 std::map<std::string, std::string> auxRasterInfo;
598 auxRasterInfo[
"URI"] = TERRALIB_DATA_DIR
"/geotiff/cbers_rgb342_crop2.tif";
601 BOOST_CHECK( diskRasterPtr1.get() );
603 auxRasterInfo[
"URI"] = TERRALIB_DATA_DIR
"/geotiff/cbers_rgb342_crop3_EPSG_22522.tif";
606 BOOST_CHECK( diskRasterPtr2.get() );
608 std::vector< const te::rst::Raster * >
rasters;
609 rasters.push_back( diskRasterPtr1.get() );
610 rasters.push_back( diskRasterPtr2.get() );
614 std::vector< unsigned int > inputRasterBands;
615 inputRasterBands.push_back( 2 );
616 inputRasterBands.push_back( 0 );
618 std::map<std::string, std::string> outputRasterInfo;
619 outputRasterInfo[
"URI"] =
"terralib_unittest_rp_functions_ComposeBandsDifSRID.tif";
621 std::unique_ptr< te::rst::Raster > outputRasterPtr;
625 "GDAL", outputRasterPtr ) );
635 BOOST_CHECK( lr.
size() == 9 );
637 BOOST_CHECK_CLOSE( lr.
getX( 0 ), 0.0 , 0.0000000001 );
638 BOOST_CHECK_CLOSE( lr.
getY( 0 ), 2.0 , 0.0000000001 );
640 BOOST_CHECK_CLOSE( lr.
getX( 1 ), 1.0 , 0.0000000001 );
641 BOOST_CHECK_CLOSE( lr.
getY( 1 ), 2.0 , 0.0000000001 );
643 BOOST_CHECK_CLOSE( lr.
getX( 2 ), 2.0 , 0.0000000001 );
644 BOOST_CHECK_CLOSE( lr.
getY( 2 ), 2.0 , 0.0000000001 );
646 BOOST_CHECK_CLOSE( lr.
getX( 3 ), 2.0 , 0.0000000001 );
647 BOOST_CHECK_CLOSE( lr.
getY( 3 ), 1.0 , 0.0000000001 );
649 BOOST_CHECK_CLOSE( lr.
getX( 4 ), 2.0 , 0.0000000001 );
650 BOOST_CHECK_CLOSE( lr.
getY( 4 ), 0.0 , 0.0000000001 );
652 BOOST_CHECK_CLOSE( lr.
getX( 5 ), 1.0 , 0.0000000001 );
653 BOOST_CHECK_CLOSE( lr.
getY( 5 ), 0.0 , 0.0000000001 );
655 BOOST_CHECK_CLOSE( lr.
getX( 6 ), 0.0 , 0.0000000001 );
656 BOOST_CHECK_CLOSE( lr.
getY( 6 ), 0.0 , 0.0000000001 );
658 BOOST_CHECK_CLOSE( lr.
getX( 7 ), 0.0 , 0.0000000001 );
659 BOOST_CHECK_CLOSE( lr.
getY( 7 ), 1.0 , 0.0000000001 );
661 BOOST_CHECK_CLOSE( lr.
getX( 8 ), 0.0 , 0.0000000001 );
662 BOOST_CHECK_CLOSE( lr.
getY( 8 ), 2.0 , 0.0000000001 );
677 BOOST_CHECK( lr.
size() == 9 );
679 BOOST_CHECK_CLOSE( lr.
getX( 0 ), -0.5 , 0.0000000001 );
680 BOOST_CHECK_CLOSE( lr.
getY( 0 ), -0.5 , 0.0000000001 );
682 BOOST_CHECK_CLOSE( lr.
getX( 1 ), 0.5 , 0.0000000001 );
683 BOOST_CHECK_CLOSE( lr.
getY( 1 ), -0.5 , 0.0000000001 );
685 BOOST_CHECK_CLOSE( lr.
getX( 2 ), 1.5 , 0.0000000001 );
686 BOOST_CHECK_CLOSE( lr.
getY( 2 ), -0.5 , 0.0000000001 );
688 BOOST_CHECK_CLOSE( lr.
getX( 3 ), 1.5 , 0.0000000001 );
689 BOOST_CHECK_CLOSE( lr.
getY( 3 ), 0.5 , 0.0000000001 );
691 BOOST_CHECK_CLOSE( lr.
getX( 4 ), 1.5 , 0.0000000001 );
692 BOOST_CHECK_CLOSE( lr.
getY( 4 ), 1.5 , 0.0000000001 );
694 BOOST_CHECK_CLOSE( lr.
getX( 5 ), 0.5 , 0.0000000001 );
695 BOOST_CHECK_CLOSE( lr.
getY( 5 ), 1.5 , 0.0000000001 );
697 BOOST_CHECK_CLOSE( lr.
getX( 6 ), -0.5 , 0.0000000001 );
698 BOOST_CHECK_CLOSE( lr.
getY( 6 ), 1.5 , 0.0000000001 );
700 BOOST_CHECK_CLOSE( lr.
getX( 7 ), -0.5 , 0.0000000001 );
701 BOOST_CHECK_CLOSE( lr.
getY( 7 ), 0.5 , 0.0000000001 );
703 BOOST_CHECK_CLOSE( lr.
getX( 8 ), -0.5 , 0.0000000001 );
704 BOOST_CHECK_CLOSE( lr.
getY( 8 ), -0.5 , 0.0000000001 );
714 const unsigned int waveletDecompLevelsNumb = 3;
718 std::map<std::string, std::string> auxRasterInfo;
720 auxRasterInfo[
"URI"] = TERRALIB_DATA_DIR
"/geotiff/cbers2b_rgb342_crop.tif";
723 BOOST_CHECK( diskRasterPtr.get() );
725 std::vector< te::rst::BandProperty * > waveletRasterBandProps;
726 for(
unsigned int bandIdx = 0 ; bandIdx < diskRasterPtr->getNumberOfBands() ;
729 for(
unsigned int levelIdx = 0 ; levelIdx < waveletDecompLevelsNumb ;
733 *( diskRasterPtr->getBand( 0 )->getProperty() ) ) );
734 waveletRasterBandProps.back()->m_blkh = diskRasterPtr->getNumberOfRows();
735 waveletRasterBandProps.back()->m_blkw = diskRasterPtr->getNumberOfColumns();
736 waveletRasterBandProps.back()->m_nblocksx = 1;
737 waveletRasterBandProps.back()->m_nblocksy = 1;
741 *( diskRasterPtr->getBand( 0 )->getProperty() ) ) );
742 waveletRasterBandProps.back()->m_blkh = diskRasterPtr->getNumberOfRows();
743 waveletRasterBandProps.back()->m_blkw = diskRasterPtr->getNumberOfColumns();
744 waveletRasterBandProps.back()->m_nblocksx = 1;
745 waveletRasterBandProps.back()->m_nblocksy = 1;
751 "MEM",
new te::rst::Grid( *( diskRasterPtr->getGrid() ) ), waveletRasterBandProps,
752 std::map<std::string, std::string>(), 0, 0 ) );
753 BOOST_CHECK( waveletRasterPtr.get() );
755 std::vector< unsigned int > inputRasterBands;
756 inputRasterBands.push_back( 0 );
757 inputRasterBands.push_back( 1 );
758 inputRasterBands.push_back( 2 );
767 waveletDecompLevelsNumb,
770 BOOST_CHECK(
te::rp::Copy2DiskRaster( *waveletRasterPtr,
"terralib_unittest_rp_functions_DirectWaveletAtrous.tif" ) ) ;
772 auxRasterInfo.clear();
773 auxRasterInfo[
"URI"] =
"terralib_unittest_rp_functions_InverseWaveletAtrous.tif";
775 std::vector< te::rst::BandProperty * > bandProps2;
776 bandProps2.push_back(
new te::rst::BandProperty( *( diskRasterPtr->getBand( 0 )->getProperty() ) ) );
777 bandProps2.push_back(
new te::rst::BandProperty( *( diskRasterPtr->getBand( 1 )->getProperty() ) ) );
778 bandProps2.push_back(
new te::rst::BandProperty( *( diskRasterPtr->getBand( 2 )->getProperty() ) ) );
781 "GDAL",
new te::rst::Grid( *( diskRasterPtr->getGrid() ) ), bandProps2,
782 auxRasterInfo, 0, 0 ) );
783 BOOST_CHECK( outDiskRasterPtr.get() );
787 waveletDecompLevelsNumb,
789 inputRasterBands ) );
792 BOOST_AUTO_TEST_SUITE_END()
unsigned int unsigned int std::unique_ptr< te::rst::Raster > & rasterPointer
bool GetMeanValue(const te::rst::Band &band, const unsigned int maxThreads, double &meanValue)
Get the mean of band pixel values.
Near neighborhood interpolation method.
A feeder from a input rasters vector;.
A raster band description.
bool RasterSlicing(const te::rst::Raster &inputRaster, const unsigned int inputRasterBand, const bool createPaletteRaster, const unsigned int slicesNumber, const bool eqHistogram, const std::map< std::string, std::string > &rasterInfo, const std::string &rasterType, const bool enableProgress, std::vector< te::rst::BandProperty::ColorEntry > const *const palettePtr, std::unique_ptr< te::rst::Raster > &outRasterPtr, std::map< double, double > limits)
Generate all wavelet planes from the given input raster.
bool ConvertIHS2RGB(const te::rst::Raster &inputIHSRaster, const unsigned int intensityBandIdx, const unsigned int hueBandIdx, const unsigned int saturationBandIdx, const double rgbRangeMin, const double rgbRangeMax, te::rst::Raster &outputRGBRaster)
IHS to RGB conversion.
double m_urx
Upper right corner x-coordinate.
Red channel color interpretation.
bool ComposeBands(te::rp::FeederConstRaster &feeder, const std::vector< unsigned int > &inputRasterBands, const te::rst::Interpolator::Method &interpMethod, const std::map< std::string, std::string > &outputRasterInfo, const std::string &outputDataSourceType, std::unique_ptr< te::rst::Raster > &outputRasterPtr)
Compose a set of bands into one multi-band raster.
bool DirectPrincipalComponents(const te::rst::Raster &inputRaster, const std::vector< unsigned int > &inputRasterBands, boost::numeric::ublas::matrix< double > &pcaMatrix, te::rst::Raster &pcaRaster, const std::vector< unsigned int > &pcaRasterBands, const unsigned int maxThreads)
Generate all principal components from the given input raster.
bool DecomposeBands(const te::rst::Raster &inputRaster, const std::vector< unsigned int > &inputRasterBands, const std::vector< std::map< std::string, std::string > > &outputRastersInfos, const std::string &outputDataSourceType, std::vector< boost::shared_ptr< te::rst::Raster > > &outputRastersPtrs)
Decompose a multi-band raster into a set of one-band rasters.
const double & getY(std::size_t i) const
It returns the n-th y coordinate value.
bool ConvertRGB2IHS(const te::rst::Raster &inputRGBRaster, const unsigned int redBandIdx, const unsigned int greenBandIdx, const unsigned int blueBandIdx, const double rgbRangeMin, const double rgbRangeMax, te::rst::Raster &outputIHSRaster)
RGB to IHS conversion.
bool ConvertHLS2RGB(const te::rst::Raster &inputHLSRaster, const unsigned int hueBandIdx, const unsigned int lightBandIdx, const unsigned int saturationBandIdx, const double, const double rgbRangeMax, te::rst::Raster &outputRGBRaster)
HLS to RGB conversion.
unsigned int unsigned int nCols
bool TERPEXPORT Copy2DiskRaster(const te::rst::Raster &inputRaster, const std::string &fileName)
Create a new raster into a GDAL datasource.
A LinearRing is a LineString that is both closed and simple.
double m_llx
Lower left corner x-coordinate.
An Envelope defines a 2D rectangular region.
const double & getX(std::size_t i) const
It returns the n-th x coordinate value.
bool InverseWaveletAtrous(const te::rst::Raster &waveletRaster, const unsigned int levelsNumber, te::rst::Raster &outputRaster, const std::vector< unsigned int > &outputRasterBands)
Regenerate the original raster from its wavelets planes.
bool DirectWaveletAtrous(const te::rst::Raster &inputRaster, const std::vector< unsigned int > &inputRasterBands, te::rst::Raster &waveletRaster, const unsigned int levelsNumber, const boost::numeric::ublas::matrix< double > &filter)
Generate all wavelet planes from the given input raster.
This file contains include headers for the TerraLib Raster Processing module.
bool GetDetailedExtent(const te::rst::Grid &grid, te::gm::LinearRing &detailedExtent)
Create a datailed extent from the given grid.
bool ConvertRGB2HLS(const te::rst::Raster &inputRGBRaster, const unsigned int redBandIdx, const unsigned int greenBandIdx, const unsigned int blueBandIdx, const double, const double rgbRangeMax, te::rst::Raster &outputHLSRaster)
RGB to HLS conversion.
double m_lly
Lower left corner y-coordinate.
boost::numeric::ublas::matrix< double > CreateWaveletAtrousFilter(const WaveletAtrousFilterType &filterType)
Create a Wavele Atrous Filter.
bool GetCovarianceValue(const te::rst::Band &band1, const te::rst::Band &band2, const unsigned int maxThreads, double const *const mean1ValuePtr, double const *const mean2ValuePtr, double &covarianceValue)
Get the covariance of band pixel values.
double m_ury
Upper right corner y-coordinate.
static Raster * make()
It creates and returns an empty raster with default raster driver.
bool GetIndexedDetailedExtent(const te::rst::Grid &grid, te::gm::LinearRing &indexedDetailedExtent)
Create a indexed (lines,columns) datailed extent from the given grid.
te::gm::Envelope * getExtent()
Returns the geographic extension of the grid.
bool InversePrincipalComponents(const te::rst::Raster &pcaRaster, const boost::numeric::ublas::matrix< double > &pcaMatrix, te::rst::Raster &outputRaster, const std::vector< unsigned int > &outputRasterBands, const unsigned int maxThreads)
Regenerate the original raster from its principal components.
void CreateFixedStepPalette(const unsigned int paletteSize, const bool randomize, std::vector< te::rst::BandProperty::ColorEntry > &palette)
Create a fixed step sequential color palette.
BOOST_AUTO_TEST_SUITE(functions_tests) BOOST_AUTO_TEST_CASE(createFixedStepPalette_test)
BOOST_AUTO_TEST_CASE(rasterSlicing_test)
Blue channel color interpretation.
A rectified grid is the spatial support for raster data.
This file contains include headers for the Data Access module of TerraLib.
Green channel color interpretation.
bool GetStdDevValue(const te::rst::Band &band, const unsigned int maxThreads, double const *const meanValuePtr, double &stdDevValue)
Get the standard deviation of band pixel values.
std::size_t size() const
It returns the number of points (vertexes) in the geometry.
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.