17 std::cout <<
"This test resample one raster based on user defined parameters." << std::endl << std::endl;
19 std::map<std::string, std::string> rinfo;
22 rinfo[
"URI"] = TERRALIB_DATA_DIR
"/geotiff/cbers2b_rgb342_crop.tif";
28 std::map<std::string, std::string> nnname;
29 nnname[
"URI"] = TERRALIB_DATA_DIR
"/geotiff/resampled_nn_scale_plus2.tif";
31 std::map<std::string, std::string> biliname;
32 biliname[
"URI"] = TERRALIB_DATA_DIR
"/geotiff/resampled_bili_scale_minus2.tif";
34 std::map<std::string, std::string> bicname;
35 bicname[
"URI"] = TERRALIB_DATA_DIR
"/geotiff/resampled_bic_scale_minus3.tif";
40 std::cout <<
" Raster " << nnname[
"URI"] <<
" created!" << std::endl;
44 std::cout <<
" Raster " << biliname[
"URI"] <<
" created!" << std::endl;
48 std::cout <<
" Raster " << bicname[
"URI"] <<
" created!" << std::endl;
52 std::cout <<
"Done!" << std::endl << std::endl;
54 catch(
const std::exception& e)
56 std::cout << std::endl <<
"An exception has occurred in MakeRasterBlock(): " << e.what() << std::endl;
60 std::cout << std::endl <<
"An unexpected exception has occurred in MakeRasterBlock()!" << std::endl;
void ResampleRaster()
Resample one Raster based on user defined parameters.
Near neighborhood interpolation method.
virtual Raster * resample(int method, unsigned int drow, unsigned int dcolumn, unsigned int height, unsigned int width, unsigned int newheight, unsigned int newwidth, const std::map< std::string, std::string > &rinfo) const
Resample a subset of the raster, given a box.
This is the abstract factory for Rasters.
An abstract class for raster data strucutures.
Bicubic interpolation method.
These routines show how to use the raster module and the GDAL data source module. ...
Bilinear interpolation method.
It interpolates one pixel based on a selected algorithm.
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.