Utils.h File Reference

Utility functions for the raster module. More...

#include "Band.h"
#include "BandProperty.h"
#include "Config.h"
#include "Grid.h"
#include "Raster.h"
#include "Interpolator.h"
#include "../common/MathUtils.h"
#include <memory>
#include <map>
#include <vector>

Go to the source code of this file.

Namespaces

 te
 TerraLib.
 
 te::rst
 Namespace for the Raster module of TerraLib.
 

Functions

TERASTEREXPORT std::string te::rst::ConvertColorInterpTypeToString (const te::rst::ColorInterp &ci)
 Function used to convert from a Color Interp Enum to a string. More...
 
TERASTEREXPORT std::string te::rst::ConvertPalleteInterpTypeToString (const te::rst::PaletteInterpretation &pi)
 Function used to convert from a Pallete Interp Enum to a string. More...
 
TERASTEREXPORT void te::rst::Copy (const Band &bin, Band &bout)
 Copies the pixel values from one band to another. More...
 
TERASTEREXPORT void te::rst::Copy (const Raster &rin, Raster &rout)
 Copies the pixel values from one raster to another. More...
 
TERASTEREXPORT void te::rst::Copy (unsigned int drow, unsigned int dcolumn, unsigned int height, unsigned int width, const Raster &rin, Raster &rout)
 Copy a subset of the raster, given a box. More...
 
TERASTEREXPORT te::rst::RasterPtr te::rst::CreateCopy (const te::rst::Raster &rin, const std::string &uri, const std::string &rType=std::string("GDAL"))
 Create a new raster from existing one. More...
 
TERASTEREXPORT std::unique_ptr< te::rst::Rasterte::rst::CropRaster (const te::rst::Raster &rin, const std::vector< te::gm::Geometry const * > geometries, const std::map< std::string, std::string > &rinfo, const std::string &rType)
 Creates a raster crop using a polygon delimiter. More...
 
TERASTEREXPORT te::rst::RasterPtr te::rst::CropRaster (const te::rst::Raster &rin, const te::gm::Polygon &pin, const std::map< std::string, std::string > &rinfo, const std::string &rType=std::string("GDAL"))
 Creates a raster crop using a polygon delimiter. More...
 
TERASTEREXPORT void te::rst::FillBand (te::rst::Band *bin, const std::complex< double > &value)
 Fill a Raster Band with provided value. More...
 
TERASTEREXPORT void te::rst::fillHistogramGaps (const std::map< double, unsigned > &inputHistogram, std::map< double, unsigned > &outputHistogram)
 Create a a new histogram with all missing integer values filled with zero frequencies. More...
 
TERASTEREXPORT void te::rst::FillRaster (te::rst::Raster *rin, const std::complex< double > &value)
 Fill a Raster with provided value (all bands). More...
 
TERASTEREXPORT std::vector< BandProperty * > te::rst::GetBandProperties (const std::map< std::string, std::string > &rinfo)
 Returns a vector of band properties, based on a given raster info. More...
 
TERASTEREXPORT void te::rst::GetDataTypeRanges (const int &dataType, double &min, double &max)
 Return the values range of a given data type. More...
 
TERASTEREXPORT Grid * te::rst::GetGrid (const std::map< std::string, std::string > &rinfo)
 Returns a grid based on a given raster info. More...
 
TERASTEREXPORT bool te::rst::getHistograms (const te::rst::Raster &raster, const unsigned int bandIndex, const unsigned int rowStart, const unsigned int colStart, const unsigned int finalRow, const unsigned int finalCol, const unsigned int histoBins, const unsigned int sampleStep, const unsigned int maxThreads, std::map< double, unsigned > &rHistogram, std::map< double, unsigned > &iHistogram)
 Compute and return the histogram soccurring values (real and imaginary) in a window of the band. More...
 
TERASTEREXPORT void te::rst::getHistogramStats (const std::map< double, unsigned > &histogram, double &min, double &max, double &mean, double &stdDev)
 Compute statiscts from the given histogram. More...
 
TERASTEREXPORT void te::rst::getInterpMethods (std::vector< std::pair< te::rst::InterpolationMethod, std::string > > &interpMethods)
 Get the avaliable interpolation methods. More...
 
TERASTEREXPORT int te::rst::GetPixelSize (int datatype)
 Returns the byte size of a given datatype. More...
 
TERASTEREXPORT std::vector< te::gm::Point * > te::rst::GetRandomPointsInRaster (const te::rst::Raster &inputRaster, unsigned int numberOfPoints=1000, bool ignoreNoDataValues=false)
 Creates a vector of random positions (points) inside the raster. More...
 
TERASTEREXPORT bool te::rst::getRealHistogram (const te::rst::Raster &raster, const unsigned int bandIndex, std::map< double, unsigned > &rHistogram)
 Compute and return the real histogram of the band. More...
 
TERASTEREXPORT bool te::rst::interpolateHistogram (const std::map< double, unsigned > &inputHistogram, std::map< double, unsigned > &outputHistogram, const unsigned int outputBinsNumber, const double outputMinValue, const double outputMaxValue)
 Create a interpolated histogram from the input histogram with the new bins number. More...
 
TERASTEREXPORT bool te::rst::rasterResample (const te::rst::Raster &inputRaster, const std::vector< unsigned int > &inputRasterBands, const te::rst::Interpolator::Method interpMethod, const unsigned int interpWindowRadius, const unsigned int firstRow, const unsigned int firstColumn, const unsigned int height, const unsigned int width, const unsigned int newheight, const unsigned int newwidth, const unsigned int maxThreads, const std::map< std::string, std::string > &rinfo, const std::string &dataSourceType, std::unique_ptr< te::rst::Raster > &resampledRasterPtr)
 Resample a subset of the raster, given a box. More...
 
TERASTEREXPORT int te::rst::Round (double val)
 Round a double value to a integer value. More...
 

Detailed Description

Utility functions for the raster module.

Definition in file Utils.h.