Raster processing auxiliary functions. More...

Enumerations

enum  te::rp::WaveletAtrousFilterType { te::rp::InvalidWAFilter, te::rp::B3SplineWAFilter, te::rp::TriangleWAFilter }
 Wavelet Atrous Filter types. More...
 

Functions

TERASTEREXPORT bool te::rp::AlignRaster (const te::rst::Raster &inputRaster, const std::vector< unsigned int > &inRasterBands, const int outputSRID, const double llx, const double lly, const double urx, const double ury, const std::map< std::string, std::string > &routInfo, const te::rst::Interpolator::Method &interpMethod, std::unique_ptr< te::rst::Raster > &outputRasterPtr)
 Raster data alignment by reprojection and clipping following a user defined area. More...
 
TERPEXPORT bool te::rp::ComposeBands (const std::vector< te::rst::Raster const * > &inputRasters, const std::vector< unsigned int > &inputRasterBands, const te::rst::Interpolator::Method &interpMethod, const std::map< std::string, std::string > &outputRasterInfo, const std::string &outputDataSourceType, const unsigned int maxThreads, const bool allowNoDataPixels, const bool enableProgress, std::unique_ptr< te::rst::Raster > &outputRasterPtr)
 Compose a set of bands into one multi-band raster. More...
 
void TERPEXPORT te::rp::Convert2DoublesVector (void *inputVector, const int inputVectorDataType, unsigned int inputVectorSize, double *outputVector)
 Convert vector elements. More...
 
void TERPEXPORT te::rp::ConvertDoublesVector (double *inputVector, unsigned int inputVectorSize, const int outputVectorDataType, void *outputVector)
 Convert a doubles vector. More...
 
TERPEXPORT bool te::rp::ConvertHLS2RGB (const te::rst::Raster &inputHLSRaster, const unsigned int hueBandIdx, const unsigned int lightBandIdx, const unsigned int saturationBandIdx, const double rgbRangeMin, const double rgbRangeMax, te::rst::Raster &outputRGBRaster)
 HLS to RGB conversion. More...
 
TERPEXPORT bool te::rp::ConvertHLS2RGB (const te::rst::Raster &inputHRaster, const unsigned int hueBandIdx, const te::rst::Raster &inputLRaster, const unsigned int lightBandIdx, const te::rst::Raster &inputSRaster, const unsigned int saturationBandIdx, const double rgbRangeMin, const double rgbRangeMax, te::rst::Raster &outputRGBRaster)
 HLS to RGB conversion. More...
 
TERPEXPORT bool te::rp::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. More...
 
TERPEXPORT bool te::rp::ConvertIHS2RGB (const te::rst::Raster &inputIRaster, const unsigned int intensityBandIdx, const te::rst::Raster &inputHRaster, const unsigned int hueBandIdx, const te::rst::Raster &inputSRaster, const unsigned int saturationBandIdx, const double rgbRangeMin, const double rgbRangeMax, te::rst::Raster &outputRGBRaster)
 IHS to RGB conversion. More...
 
TERPEXPORT bool te::rp::ConvertRGB2HLS (const te::rst::Raster &inputRedRaster, const unsigned int redBandIdx, const te::rst::Raster &inputGreenRaster, const unsigned int greenBandIdx, const te::rst::Raster &inputBlueRaster, const unsigned int blueBandIdx, const double rgbRangeMin, const double rgbRangeMax, te::rst::Raster &outputHLSRaster)
 RGB to HLS conversion. More...
 
TERPEXPORT bool te::rp::ConvertRGB2HLS (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 &outputHLSRaster)
 RGB to HLS conversion. More...
 
TERPEXPORT bool te::rp::ConvertRGB2IHS (const te::rst::Raster &inputRedRaster, const unsigned int redBandIdx, const te::rst::Raster &inputGreenRaster, const unsigned int greenBandIdx, const te::rst::Raster &inputBlueRaster, const unsigned int blueBandIdx, const double rgbRangeMin, const double rgbRangeMax, te::rst::Raster &outputIHSRaster)
 RGB to IHS conversion. More...
 
TERPEXPORT bool te::rp::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. More...
 
bool TERPEXPORT te::rp::Copy2DiskRaster (const te::rst::Raster &inputRaster, const std::string &fileName)
 Create a new raster into a GDAL datasource. More...
 
TERPEXPORT void te::rp::CreateFixedStepPalette (const unsigned int paletteSize, const bool randomize, std::vector< te::rst::BandProperty::ColorEntry > &palette)
 Create a fixed step sequential color palette. More...
 
bool TERPEXPORT te::rp::CreateNewGdalRaster (const te::rst::Grid &rasterGrid, std::vector< te::rst::BandProperty * > bandsProperties, const std::string &fileName, RasterHandler &outRasterHandler)
 Create a new raster into a GDAL datasource. More...
 
bool TERPEXPORT te::rp::CreateNewGdalRaster (const te::rst::Grid &rasterGrid, std::vector< te::rst::BandProperty * > bandsProperties, const std::string &fileName, std::unique_ptr< te::rst::Raster > &outRasterPtr)
 Create a new raster into a GDAL datasource. More...
 
bool TERPEXPORT te::rp::CreateNewMemRaster (const te::rst::Grid &rasterGrid, std::vector< te::rst::BandProperty * > bandsProperties, RasterHandler &outRasterHandler)
 Create a new raster into a new memory datasource. More...
 
bool TERPEXPORT te::rp::CreateNewRaster (const te::rst::Grid &rasterGrid, const std::vector< te::rst::BandProperty * > &bandsProperties, const std::map< std::string, std::string > &rasterInfo, const std::string &rasterType, std::unique_ptr< te::rst::Raster > &outRasterPtr)
 Create a new raster into the givem data source. More...
 
bool TERPEXPORT te::rp::CreateNewRaster (const te::rst::Grid &rasterGrid, const std::vector< te::rst::BandProperty * > &bandsProperties, const std::string &outDataSetName, const std::string &dataSourceType, RasterHandler &outRasterHandler)
 Create a new raster into the givem data source. More...
 
bool TERPEXPORT te::rp::CreateNewRaster (const te::rst::Grid &rasterGrid, const std::vector< te::rst::BandProperty * > &bandsProperties, const std::string &outDataSetName, te::da::DataSource &outDataSource, RasterHandler &outRasterHandler)
 Create a new raster into the givem data source. More...
 
template<typename MatrixElementT >
bool te::rp::CreateRasterFileFromMatrix (const te::rp::Matrix< MatrixElementT > &matrix, const bool normalize, const std::string &fileName)
 Create a tiff file from a matrix. More...
 
TERPEXPORT boost::numeric::ublas::matrix< double > te::rp::CreateWaveletAtrousFilter (const WaveletAtrousFilterType &filterType)
 Create a Wavele Atrous Filter. More...
 
TERPEXPORT bool te::rp::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. More...
 
TERPEXPORT bool te::rp::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. More...
 
TERPEXPORT bool te::rp::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. More...
 
TERPEXPORT bool te::rp::FillBand (te::rst::Raster &raster, const unsigned int bandIndex, const std::complex< double > &value)
 
TERPEXPORT void te::rp::GetAllSpectralBandInfos (std::map< std::string, struct SpectralSensorParams > &specBandInfos)
 Get all spectral band infos. More...
 
TERPEXPORT std::vector< std::string > te::rp::GetBandNames ()
 Returns a vector os with band's names. More...
 
TERPEXPORT bool te::rp::GetCovarianceValue (const te::rst::Raster &inputRaster1, const unsigned int inputBandIndex1, const te::rst::Raster &inputRaster2, const unsigned int inputBandIndex2, const unsigned int maxThreads, double const *const mean1ValuePtr, double const *const mean2ValuePtr, double &covarianceValue)
 Get the covariance of band pixel values. More...
 
void TERPEXPORT te::rp::GetDataTypeRange (const int dataType, double &min, double &max)
 Returns the real data type range (all values that can be represented by the given data type). More...
 
TERPEXPORT bool te::rp::GetDetailedExtent (const te::rst::Grid &grid, te::gm::LinearRing &detailedExtent)
 Create a datailed extent from the given grid. More...
 
TERPEXPORT std::pair< double, double > te::rp::GetDigitalNumberBandInfo (std::string bandName)
 Returns the maximun and minimum digital numbers of a given sensor/band. More...
 
TERPEXPORT double te::rp::GetDigitalNumberBandMax (std::string bandName)
 Returns the maximum digital number of a given sensor/band. More...
 
TERPEXPORT double te::rp::GetDigitalNumberBandMin (std::string bandName)
 Returns the minimum digital number of a given sensor/band. More...
 
TERPEXPORT bool te::rp::GetExternalValidDataPolygon (const te::rst::Raster &inputRaster, const std::vector< unsigned int > &inputRasterBandsIdx, const std::vector< double > &bandNoDataValues, std::unique_ptr< te::gm::Polygon > &outPolygonPtr)
 Compute the external raster valid data area polygon. More...
 
TERPEXPORT bool te::rp::getHistograms (const te::rst::Raster &raster, const unsigned int bandIndex, const std::vector< te::gm::Polygon const * > &rois, const unsigned int histoBins, const unsigned int maxThreads, const te::rst::PolygonIterator< double >::IterationType roisItType, std::map< double, unsigned > &rHistogram, std::map< double, unsigned > &iHistogram)
 Compute and return the histogram soccurring values (real and imaginary) inside defined regions of interest. More...
 
TERPEXPORT void te::rp::getHistogramStats (const std::map< double, unsigned int > &histogram, double &min, double &max, double &mean, double &stdDev, double &mode, double &entropy, double &sum, double &sum2, double &sum3, double &sum4, double &variance, double &median)
 Compute statiscts from the given histogram. More...
 
TERPEXPORT bool te::rp::GetIndexedDetailedExtent (const te::rst::Grid &grid, te::gm::LinearRing &indexedDetailedExtent)
 Create a indexed (lines,columns) datailed extent from the given grid. More...
 
TERPEXPORT bool te::rp::getJointHistograms (const te::rst::Raster &raster, const unsigned int bandIndex1, const unsigned int bandIndex2, const std::vector< te::gm::Polygon const * > &rois, const unsigned int histoBins, const unsigned int maxThreads, const te::rst::PolygonIterator< double >::IterationType roisItType, std::map< std::pair< double, double >, unsigned int > &realJointHistogram, std::map< std::pair< double, double >, unsigned int > &imagJointHistogram, std::map< double, unsigned int > const *const rasterRealHistogram1ptr, std::map< double, unsigned int > const *const rasterImagHistogram1Ptr, std::map< double, unsigned int > const *const rasterRealHistogram2Ptr, std::map< double, unsigned int > const *const rasterImagHistogram2Ptr)
 Compute and return the joint histogram of occurring values (real and imaginary) inside defined regions of interest. More...
 
TERPEXPORT bool te::rp::GetMeanValue (const te::rst::Raster &inputRaster, const unsigned int inputBandIndex, const unsigned int maxThreads, const bool forceNoDataValue, const double noDataValue, double &meanValue)
 Get the mean of band pixel values. 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...
 
TERPEXPORT std::string te::rp::GetSensorFilename ()
 Returns a json filename with spectral sensors parameters. More...
 
TERPEXPORT std::map< std::string, SpectralSensorParamste::rp::getSensorParams ()
 Returns a map with spectral sensors parameters defined in SpectralSensor.json file. More...
 
TERPEXPORT bool te::rp::GetSpectralBandInfo (const std::string &bandName, SpectralSensorParams &specBandInfo)
 Get the maximun and minimum reflectance values of a given sensor/band. More...
 
TERPEXPORT double te::rp::GetSpectralBandMax (std::string bandName)
 Returns the maximum reflectance value of a given sensor/band. More...
 
TERPEXPORT double te::rp::GetSpectralBandMin (std::string bandName)
 Returns the minimum reflectance value of a given sensor/band. More...
 
TERPEXPORT bool te::rp::GetStdDevValue (const te::rst::Raster &inputRaster, const unsigned int inputBandIndex, const unsigned int maxThreads, const bool forceNoDataValue, const double noDataValue, double const *const meanValuePtr, double &stdDevValue)
 Get the standard deviation of band pixel values. More...
 
template<typename ContainerT >
double te::rp::GetTPConvexHullArea (const ContainerT &tiePoints, const bool useTPSecondCoordPair)
 Returns the tie points converx hull area. More...
 
TERPEXPORT bool te::rp::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. More...
 
TERPEXPORT bool te::rp::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. More...
 
TERPEXPORT te::rst::Rasterte::rp::NormalizeRaster (const te::rst::Raster *inputRaster)
 Normalizes a raster in a given interval. More...
 
TERPEXPORT bool te::rp::NormalizeRaster (te::rst::Raster &inputRaster, double nmin=0.0, double nmax=255.0)
 Normalizes one raster in a given interval. More...
 
TERPEXPORT bool te::rp::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 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...
 
TERPEXPORT bool te::rp::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::vector< double > const *slicesLimitsPtr, std::vector< double > const *slicesOutputValuesPtr)
 Create a new raster grouping pixel values following the number of slices and/or slice limits. More...
 
TERPEXPORT bool te::rp::RemapValues (const te::rst::Raster &inputRaster, const std::vector< unsigned int > &inputRasterBands, const boost::numeric::ublas::matrix< double > &remapMatrix, te::rst::Raster &outputRaster, const std::vector< unsigned int > &outputRasterBands, const unsigned int maxThreads)
 Remap pixel values using a remap function matrix. More...
 
TERPEXPORT bool te::rp::ReplaceContiguousSegmentValues (const te::rst::Raster &inputRaster, const unsigned int &inputRasterBandIdx, te::rst::Raster &outputRaster, const unsigned int &outputRasterBandIdx, const unsigned targetInputRow, const unsigned targetInputCol, const double &outputValue)
 Replace a contiguos segment pixel values. More...
 
TERPEXPORT bool te::rp::ReplaceContiguousSegmentValues (te::rst::Raster &inputRaster, const unsigned int &inputRasterBandIdx, const unsigned targetRow, const unsigned targetCol, const double &outputValue)
 Replace a contiguos segment pixel values. More...
 
TERPEXPORT void te::rp::SaveSensorParams (std::map< std::string, SpectralSensorParams > &)
 Saves in SpectralSensor.json file the spectral sensors parameters. More...
 
TERPEXPORT bool te::rp::SelectiveReplaceValues (const te::rst::Raster &inputRaster, const unsigned int &inputRasterBandIdx, const std::vector< std::pair< double, double > > &targetValues, const bool enableProgress, const std::vector< te::gm::Polygon * > &restrictionPols, te::rst::Raster &outputRaster, const unsigned int &outputRasterBandIdx)
 Remap all pixel values using a user supplied target values (non-target values are just copied from input to output). More...
 

Detailed Description

Raster processing auxiliary functions.

Enumeration Type Documentation

◆ WaveletAtrousFilterType

Wavelet Atrous Filter types.

Enumerator
InvalidWAFilter 

Invalid filter type.

B3SplineWAFilter 

Spline filter type.

TriangleWAFilter 

Triangle filter type.

Definition at line 74 of file Functions.h.

Function Documentation

◆ AlignRaster()

TERASTEREXPORT bool te::rp::AlignRaster ( const te::rst::Raster inputRaster,
const std::vector< unsigned int > &  inRasterBands,
const int  outputSRID,
const double  llx,
const double  lly,
const double  urx,
const double  ury,
const std::map< std::string, std::string > &  routInfo,
const te::rst::Interpolator::Method interpMethod,
std::unique_ptr< te::rst::Raster > &  outputRasterPtr 
)

Raster data alignment by reprojection and clipping following a user defined area.

Parameters
inputRasterThe input raster.
inRasterBandsInput raster bands to process.
outputSRIDThe target SRID for the reprojection.
llxLower-left X-coordinate of target area (in the output SRS).
llyLower-left Y-coordinate of target area (in the output SRS).
urxUpper-Right X-coordinate of target area (in the output SRS).
uryUpper-Right Y-coordinate of target area (in the output SRS).
routInfoThe basic parameters necessary to create the output raster.
interpMethodThe method of interpolation to apply.
outputRasterPtrOutput raster pointer.
Returns
true if OK, false on errors.
Note
The output raster extent will be created from llx, lly, urx, ury.

◆ ComposeBands()

TERPEXPORT bool te::rp::ComposeBands ( const std::vector< te::rst::Raster const * > &  inputRasters,
const std::vector< unsigned int > &  inputRasterBands,
const te::rst::Interpolator::Method interpMethod,
const std::map< std::string, std::string > &  outputRasterInfo,
const std::string &  outputDataSourceType,
const unsigned int  maxThreads,
const bool  allowNoDataPixels,
const bool  enableProgress,
std::unique_ptr< te::rst::Raster > &  outputRasterPtr 
)

Compose a set of bands into one multi-band raster.

Parameters
inputRastersInput rasters.
inputRasterBandsInput raster bands (one band for each input raster).
interpMethodThe interpolator method to use.
outputRasterInfoOutput raster connection info.
outputDataSourceTypeOutput raster datasource type.
maxThreadsThe maximum number of threads to use (0-auto, 1-single thread used).
outputRasterPtrA pointer to the generated output raster.
allowNoDataPixelsIf disabled only pixels with valid data on all bands will be written to the output raster.
enableProgressEnable/disable the progress interface.
Returns
true if OK, false on errors.
Note
The first raster Grid will be taken as reference for the composed raster.

◆ Convert2DoublesVector()

void TERPEXPORT te::rp::Convert2DoublesVector ( void *  inputVector,
const int  inputVectorDataType,
unsigned int  inputVectorSize,
double *  outputVector 
)

Convert vector elements.

Parameters
inputVectorInput vector.
inputVectorDataTypeInput vector data type.
inputVectorSizeThe numer of input vector elements.
outputVectorA pré-allocated output vector.
Note
The types are listed in terralib/datatype/DataTypes.h

◆ ConvertDoublesVector()

void TERPEXPORT te::rp::ConvertDoublesVector ( double *  inputVector,
unsigned int  inputVectorSize,
const int  outputVectorDataType,
void *  outputVector 
)

Convert a doubles vector.

Parameters
inputVectorInput vector.
inputVectorSizeThe numer of input vector elements.
inputVectorDataTypeInput vector data type.
outputVectorA pré-allocated output vector.
Note
The types are listed in terralib/datatype/DataTypes.h

◆ ConvertHLS2RGB() [1/2]

TERPEXPORT bool te::rp::ConvertHLS2RGB ( const te::rst::Raster inputHLSRaster,
const unsigned int  hueBandIdx,
const unsigned int  lightBandIdx,
const unsigned int  saturationBandIdx,
const double  rgbRangeMin,
const double  rgbRangeMax,
te::rst::Raster outputRGBRaster 
)

HLS to RGB conversion.

Parameters
inputHLSRasterThe input raster.
hueBandIdxThe hue band index.
lightBandIdxThe light band index.
saturationBandIdxThe saturation band index.
rgbRangeMinThe minimum RGB value.
rgbRangeMaxThe maximum RGB value.
outputRGBRasterAn output pré-initiated raster (with the same dimensions of inputHLSRaster) where the RGB data will be written.
Returns
true if OK, false on errors.

◆ ConvertHLS2RGB() [2/2]

TERPEXPORT bool te::rp::ConvertHLS2RGB ( const te::rst::Raster inputHRaster,
const unsigned int  hueBandIdx,
const te::rst::Raster inputLRaster,
const unsigned int  lightBandIdx,
const te::rst::Raster inputSRaster,
const unsigned int  saturationBandIdx,
const double  rgbRangeMin,
const double  rgbRangeMax,
te::rst::Raster outputRGBRaster 
)

HLS to RGB conversion.

Parameters
inputHRasterThe input hue raster.
hueBandIdxThe hue band index.
inputLRasterThe input light raster.
lightBandIdxThe light band index.
inputSRasterThe input saturation raster.
saturationBandIdxThe saturation band index.
rgbRangeMinThe minimum RGB value.
rgbRangeMaxThe maximum RGB value.
outputRGBRasterAn output pré-initiated raster (with the same dimensions of inputHLSRaster) where the RGB data will be written.
Returns
true if OK, false on errors.

◆ ConvertIHS2RGB() [1/2]

TERPEXPORT bool te::rp::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.

Parameters
inputIHSRasterThe input raster.
intensityBandIdxThe intensity band index.
hueBandIdxThe hue band index.
saturationBandIdxThe saturation band index.
rgbRangeMinThe minimum RGB value.
rgbRangeMaxThe maximum RGB value.
outputRGBRasterAn output pré-initiated raster (with the same dimensions of inputIHSRaster) where the RGB data will be written.
Returns
true if OK, false on errors.
Note
IHS data with the following channels ranges: I:[0,1] H:[0,2pi] (radians) S:[0,1].

◆ ConvertIHS2RGB() [2/2]

TERPEXPORT bool te::rp::ConvertIHS2RGB ( const te::rst::Raster inputIRaster,
const unsigned int  intensityBandIdx,
const te::rst::Raster inputHRaster,
const unsigned int  hueBandIdx,
const te::rst::Raster inputSRaster,
const unsigned int  saturationBandIdx,
const double  rgbRangeMin,
const double  rgbRangeMax,
te::rst::Raster outputRGBRaster 
)

IHS to RGB conversion.

Parameters
inputIRasterThe input intensity raster.
intensityBandIdxThe intensity band index.
inputHRasterThe input hue raster.
hueBandIdxThe hue band index.
inputSRasterThe input saturation raster.
saturationBandIdxThe saturation band index.
rgbRangeMinThe minimum RGB value.
rgbRangeMaxThe maximum RGB value.
outputRGBRasterAn output pré-initiated raster (with the same dimensions of inputIHSRaster) where the RGB data will be written.
Returns
true if OK, false on errors.
Note
IHS data with the following channels ranges: I:[0,1] H:[0,2pi] (radians) S:[0,1].

◆ ConvertRGB2HLS() [1/2]

TERPEXPORT bool te::rp::ConvertRGB2HLS ( const te::rst::Raster inputRedRaster,
const unsigned int  redBandIdx,
const te::rst::Raster inputGreenRaster,
const unsigned int  greenBandIdx,
const te::rst::Raster inputBlueRaster,
const unsigned int  blueBandIdx,
const double  rgbRangeMin,
const double  rgbRangeMax,
te::rst::Raster outputHLSRaster 
)

RGB to HLS conversion.

Parameters
inputRedRasterThe input red raster.
redBandIdxThe red band index.
inputGreenRasterThe input green raster.
greenBandIdxThe green band index.
inputBlueRasterThe input blue raster.
blueBandIdxThe blue band index.
rgbRangeMinThe minimum RGB value.
rgbRangeMaxThe maximum RGB value.
outputHLSRasterAn output pré-initiated raster (with the same dimensions of inputRGBRaster) where the HLS data will be written (double or float as the data type).
Returns
true if OK, false on errors.
Note
The outputHLSRaster mas have a float or double data type.

◆ ConvertRGB2HLS() [2/2]

TERPEXPORT bool te::rp::ConvertRGB2HLS ( 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 outputHLSRaster 
)

RGB to HLS conversion.

Parameters
inputRGBRasterThe input raster.
redBandIdxThe red band index.
greenBandIdxThe red band index.
blueBandIdxThe red band index.
rgbRangeMinThe minimum RGB value.
rgbRangeMaxThe maximum RGB value.
outputHLSRasterAn output pré-initiated raster (with the same dimensions of inputRGBRaster) where the HLS data will be written (double or float as the data type).
Returns
true if OK, false on errors.
Note
The outputHLSRaster mas have a float or double data type.

◆ ConvertRGB2IHS() [1/2]

TERPEXPORT bool te::rp::ConvertRGB2IHS ( const te::rst::Raster inputRedRaster,
const unsigned int  redBandIdx,
const te::rst::Raster inputGreenRaster,
const unsigned int  greenBandIdx,
const te::rst::Raster inputBlueRaster,
const unsigned int  blueBandIdx,
const double  rgbRangeMin,
const double  rgbRangeMax,
te::rst::Raster outputIHSRaster 
)

RGB to IHS conversion.

Parameters
inputRedRasterThe input red raster.
redBandIdxThe red band index.
inputGreenRasterThe input green raster.
greenBandIdxThe green band index.
inputBlueRasterThe input blue raster.
blueBandIdxThe blue band index.
rgbRangeMinThe minimum RGB value.
rgbRangeMaxThe maximum RGB value.
outputIHSRasterAn output pré-initiated raster (with the same dimensions of inputRGBRaster) where the IHS data will be written (double or float as the data type).
Returns
true if OK, false on errors.
Note
The outputIHSRaster mas have a float or double data type.
IHS data with the following channels ranges: I:[0,1] H:[0,2pi] (radians) S:[0,1].

◆ ConvertRGB2IHS() [2/2]

TERPEXPORT bool te::rp::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.

Parameters
inputRGBRasterThe input raster.
redBandIdxThe red band index.
greenBandIdxThe red band index.
blueBandIdxThe red band index.
rgbRangeMinThe minimum RGB value.
rgbRangeMaxThe maximum RGB value.
outputIHSRasterAn output pré-initiated raster (with the same dimensions of inputRGBRaster) where the IHS data will be written (double or float as the data type).
Returns
true if OK, false on errors.
Note
The outputIHSRaster mas have a float or double data type.
IHS data with the following channels ranges: I:[0,1] H:[0,2pi] (radians) S:[0,1].


◆ Copy2DiskRaster()

bool TERPEXPORT te::rp::Copy2DiskRaster ( const te::rst::Raster inputRaster,
const std::string &  fileName 
)

Create a new raster into a GDAL datasource.

Parameters
rasterGridThe template grid used to create the output raster.
bandsPropertiesThe template band properties used to create the output raster.
fileNameThe output tif file name.
outRasterHandlerThe created raster handler.
Returns
true if OK, false on errors.
Note
All bandsProperties pointed objects will be acquired by this function and must not be deleted.

◆ CreateFixedStepPalette()

TERPEXPORT void te::rp::CreateFixedStepPalette ( const unsigned int  paletteSize,
const bool  randomize,
std::vector< te::rst::BandProperty::ColorEntry > &  palette 
)

Create a fixed step sequential color palette.

Parameters
paletteSizeThe desired palette size.
paletteThe crated palette.

◆ CreateNewGdalRaster() [1/2]

bool TERPEXPORT te::rp::CreateNewGdalRaster ( const te::rst::Grid rasterGrid,
std::vector< te::rst::BandProperty * >  bandsProperties,
const std::string &  fileName,
RasterHandler outRasterHandler 
)

Create a new raster into a GDAL datasource.

Parameters
rasterGridThe template grid used to create the output raster.
bandsPropertiesThe template band properties used to create the output raster.
fileNameThe output tif file name.
outRasterHandlerThe created raster handler.
Returns
true if OK, false on errors.
Note
All bandsProperties pointed objects will be acquired by this function and must not be deleted.

◆ CreateNewGdalRaster() [2/2]

bool TERPEXPORT te::rp::CreateNewGdalRaster ( const te::rst::Grid rasterGrid,
std::vector< te::rst::BandProperty * >  bandsProperties,
const std::string &  fileName,
std::unique_ptr< te::rst::Raster > &  outRasterPtr 
)

Create a new raster into a GDAL datasource.

Parameters
rasterGridThe template grid used to create the output raster.
bandsPropertiesThe template band properties used to create the output raster.
fileNameThe output tif file name.
outRasterPtrThe created raster pointer.
Returns
true if OK, false on errors.
Note
All bandsProperties pointed objects will be acquired by this function and must not be deleted.

◆ CreateNewMemRaster()

bool TERPEXPORT te::rp::CreateNewMemRaster ( const te::rst::Grid rasterGrid,
std::vector< te::rst::BandProperty * >  bandsProperties,
RasterHandler outRasterHandler 
)

Create a new raster into a new memory datasource.

Parameters
rasterGridThe template grid used to create the output raster.
bandsPropertiesThe template band properties used to create the output raster.
outRasterHandlerThe created raster handler.
Returns
true if OK, false on errors.
Note
All bandsProperties pointed objects will be acquired by this function and must not be deleted.

◆ CreateNewRaster() [1/3]

bool TERPEXPORT te::rp::CreateNewRaster ( const te::rst::Grid rasterGrid,
const std::vector< te::rst::BandProperty * > &  bandsProperties,
const std::map< std::string, std::string > &  rasterInfo,
const std::string &  rasterType,
std::unique_ptr< te::rst::Raster > &  outRasterPtr 
)

Create a new raster into the givem data source.

Parameters
rasterGridThe template grid used to create the output raster.
bandsPropertiesThe template band properties used to create the output raster.
rasterInfoThe output raster info (specific driver info).
rasterTypeThe output raster type (specific driver name - See te::rst::RasterFactory dictorary for more info).
outRasterPtrThe created raster pointer.
Returns
true if OK, false on errors.
Note
All bandsProperties pointed objects will be acquired by this function and must not be deleted.

◆ CreateNewRaster() [2/3]

bool TERPEXPORT te::rp::CreateNewRaster ( const te::rst::Grid rasterGrid,
const std::vector< te::rst::BandProperty * > &  bandsProperties,
const std::string &  outDataSetName,
const std::string &  dataSourceType,
RasterHandler outRasterHandler 
)

Create a new raster into the givem data source.

Parameters
rasterGridThe template grid used to create the output raster.
bandsPropertiesThe template band properties used to create the output raster.
outDataSetNameThe data set name to give to the created data set.
dataSourceTypeThe data source type string (i.e. GDAL, MEM.)( See te::rst::RasterFactory dictionary for valid registered values ).
outRasterHandlerThe created raster handler.
Returns
true if OK, false on errors.
Note
All bandsProperties pointed objects will be acquired by this function and must not be deleted.

◆ CreateNewRaster() [3/3]

bool TERPEXPORT te::rp::CreateNewRaster ( const te::rst::Grid rasterGrid,
const std::vector< te::rst::BandProperty * > &  bandsProperties,
const std::string &  outDataSetName,
te::da::DataSource outDataSource,
RasterHandler outRasterHandler 
)

Create a new raster into the givem data source.

Parameters
rasterGridThe template grid used to create the output raster.
bandsPropertiesThe template band properties used to create the output raster.
outDataSetNameThe data set name to give to the created data set.
outDataSourceThe data source to use when creating the output data set.
outRasterHandlerThe created raster handler.
Returns
true if OK, false on errors.
Note
All bandsProperties pointed objects will be acquired by this function and must not be deleted.

◆ CreateRasterFileFromMatrix()

template<typename MatrixElementT >
bool te::rp::CreateRasterFileFromMatrix ( const te::rp::Matrix< MatrixElementT > &  matrix,
const bool  normalize,
const std::string &  fileName 
)

Create a tiff file from a matrix.

Parameters
matrixThe matrix.
normalizeEnable/disable pixel normalization (8bit);
tifFileNameTif file name.
returntrue if OK, false on errors.

Definition at line 255 of file Functions.h.

References te::dt::DOUBLE_TYPE, te::rp::Matrix< TemplateElementType >::getColumnsNumber(), te::rp::Matrix< TemplateElementType >::getLinesNumber(), te::rst::GrayIdxCInt, te::sa::Grid, te::rst::RasterFactory::make(), TERP_TRUE_OR_RETURN_FALSE, and te::dt::UCHAR_TYPE.

◆ CreateWaveletAtrousFilter()

TERPEXPORT boost::numeric::ublas::matrix< double > te::rp::CreateWaveletAtrousFilter ( const WaveletAtrousFilterType filterType)

Create a Wavele Atrous Filter.

Parameters
filterTypeThe filter type.
Returns
the created filter.

◆ DecomposeBands()

TERPEXPORT bool te::rp::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.

Parameters
inputRasterInput raster.
inputRasterBandsInput raster bands.
outputRastersInfosOutput rasters connections infos. (one info for each decomposed band).
outputDataSourceTypeOutput raster datasource type.
outputRastersPtrsPointers to the generated outputs rasters.
Returns
true if OK, false on errors.

◆ DirectPrincipalComponents()

TERPEXPORT bool te::rp::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.

Parameters
inputRasterInput raster.
inputRasterBandsInput raster bands.
pcaMatrixThe matrix generated over the principal components process.
pcaRasterThe pré-initiated output PCA raster (with the same dimensions of inputRaster) and double as the data type.
pcaRasterBandsOutput raster bands.
maxThreadsThe maximum number of threads to use (0-auto, 1-single thread used).
Returns
true if OK, false on errors.
Note
Optimized for rasters where the used bands have the same blocking scheme.

◆ DirectWaveletAtrous()

TERPEXPORT bool te::rp::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.

Parameters
inputRasterInput raster.
inputRasterBandsInput raster bands.
waveletRasterThe pré-initiated output wavelet raster (with the same dimensions of inputRaster) and double as the data type.
levelsNumberThe number of decomposed wavelet levels to generate for each input raster band;
filterThe square filter to use.
Returns
true if OK, false on errors.
Note
The band order of the generated wavelet levels: { [ band0-smoothed0, band0-wavelet0, ... , band0-smoothedN, band0-waveletN ], ... }
The number of bands of waveletRaster must be ( inputRasterBands.size() * 2 * levelsNumber ) at least.

◆ FillBand()

TERPEXPORT bool te::rp::FillBand ( te::rst::Raster raster,
const unsigned int  bandIndex,
const std::complex< double > &  value 
)
Parameters
Fillthe target band with the target value.
bandIndexBand index.
valueTarget value.
Returns
true if OK, false on errors.

◆ GetAllSpectralBandInfos()

TERPEXPORT void te::rp::GetAllSpectralBandInfos ( std::map< std::string, struct SpectralSensorParams > &  specBandInfos)

Get all spectral band infos.

Parameters
specBandInfosThe requested bands infos.

◆ GetBandNames()

TERPEXPORT std::vector<std::string> te::rp::GetBandNames ( )

Returns a vector os with band's names.

◆ GetCovarianceValue()

TERPEXPORT bool te::rp::GetCovarianceValue ( const te::rst::Raster inputRaster1,
const unsigned int  inputBandIndex1,
const te::rst::Raster inputRaster2,
const unsigned int  inputBandIndex2,
const unsigned int  maxThreads,
double const *const  mean1ValuePtr,
double const *const  mean2ValuePtr,
double &  covarianceValue 
)

Get the covariance of band pixel values.

Parameters
inputRaster1The input raster 1.
inputBandIndex1Input raster 1 band index.
inputRaster2The input raster 2.
inputBandIndex2Input raster 2 band index.
maxThreadsThe maximum number of threads to use (0-auto, 1-single thread used).
mean1ValuePtrA pointer to a pre-calculated band1 mean value or zero if it does not exist.
mean2ValuePtrA pointer to a pre-calculated band2 mean value or zero if it does not exist.
covarianceValueThe calculated covariance value.
Returns
true if OK, false on errors.

◆ GetDataTypeRange()

void TERPEXPORT te::rp::GetDataTypeRange ( const int  dataType,
double &  min,
double &  max 
)
inline

Returns the real data type range (all values that can be represented by the given data type).

Parameters
dataTypeThe data type.
minThe minimum value.
maxThe maximum value.
Note
The types are listed in terralib/datatype/DataTypes.h

Definition at line 216 of file Functions.h.

References te::rst::GetDataTypeRanges().

◆ GetDetailedExtent()

TERPEXPORT bool te::rp::GetDetailedExtent ( const te::rst::Grid grid,
te::gm::LinearRing detailedExtent 
)

Create a datailed extent from the given grid.

Parameters
gridInput grid.
detailedExtentThe created detailed extent.
Returns
true if ok, false on errors.

◆ GetDigitalNumberBandInfo()

TERPEXPORT std::pair<double, double> te::rp::GetDigitalNumberBandInfo ( std::string  bandName)

Returns the maximun and minimum digital numbers of a given sensor/band.

◆ GetDigitalNumberBandMax()

TERPEXPORT double te::rp::GetDigitalNumberBandMax ( std::string  bandName)

Returns the maximum digital number of a given sensor/band.

◆ GetDigitalNumberBandMin()

TERPEXPORT double te::rp::GetDigitalNumberBandMin ( std::string  bandName)

Returns the minimum digital number of a given sensor/band.

◆ GetExternalValidDataPolygon()

TERPEXPORT bool te::rp::GetExternalValidDataPolygon ( const te::rst::Raster inputRaster,
const std::vector< unsigned int > &  inputRasterBandsIdx,
const std::vector< double > &  bandNoDataValues,
std::unique_ptr< te::gm::Polygon > &  outPolygonPtr 
)

Compute the external raster valid data area polygon.

Parameters
inputRasterInput raster.
inputRasterBandsIdxInput raster bands to use.
bandNoDataValuesOptional vector of no-data values for each target band or an empty vector to use the original raster no-data values..
outPolygonPtrThe computed external valid data area polygon.
Returns
true if OK, false on errors.
Note
The pixel centers will be used as coords.
The returned polygon is a convex hull.
If no valid raster data is present, this function returns false.

◆ getHistograms()

TERPEXPORT bool te::rp::getHistograms ( const te::rst::Raster raster,
const unsigned int  bandIndex,
const std::vector< te::gm::Polygon const * > &  rois,
const unsigned int  histoBins,
const unsigned int  maxThreads,
const te::rst::PolygonIterator< double >::IterationType  roisItType,
std::map< double, unsigned > &  rHistogram,
std::map< double, unsigned > &  iHistogram 
)

Compute and return the histogram soccurring values (real and imaginary) inside defined regions of interest.

Parameters
rasterInput raster.
bandIndexBand index.
roisRegions of interest (under the same SRID as the input raster) or an empty vector for the case where all the image must be processed.
histoBinsThe number of bins (intervals from minimum pixel to maximum). When b = 0, the histogram will be divided according to all pixel values.
maxThreadsMaximum number of used threads to use (0-Automatic, 1-No threads used).
roisItTypeROIs polygons iteration type.
rHistogramThe generated histogram (real).
iHistogramThe generated histogram (imaginary).
Returns
true if ok, false on errors
Note
This method will ignore storage specific tags and will read all raster data to compute the histograms (use te::rst::Band methods to use storage specifc tags).

◆ getHistogramStats()

TERPEXPORT void te::rp::getHistogramStats ( const std::map< double, unsigned int > &  histogram,
double &  min,
double &  max,
double &  mean,
double &  stdDev,
double &  mode,
double &  entropy,
double &  sum,
double &  sum2,
double &  sum3,
double &  sum4,
double &  variance,
double &  median 
)

Compute statiscts from the given histogram.

Parameters
histogramInput histogram.
minHistogram minimun value.
maxHistogram maximum value.
meanHistogram mean value.
stdDevHistogram standard deviation value.
modeHistogram mode value.
entropyHistogram mode value.
sumSum of all pixels values.
sum2Quadratic sum of all pixels values.
sum3The cubic sum of pixels values.
sum4The quartic sum of pixels values.
varianceHistogram variance value.
medianHistogram median value.

◆ GetIndexedDetailedExtent()

TERPEXPORT bool te::rp::GetIndexedDetailedExtent ( const te::rst::Grid grid,
te::gm::LinearRing indexedDetailedExtent 
)

Create a indexed (lines,columns) datailed extent from the given grid.

Parameters
gridInput grid.
indexedDetailedExtentThe created detailed extent.
Returns
true if ok, false on errors.

◆ getJointHistograms()

TERPEXPORT bool te::rp::getJointHistograms ( const te::rst::Raster raster,
const unsigned int  bandIndex1,
const unsigned int  bandIndex2,
const std::vector< te::gm::Polygon const * > &  rois,
const unsigned int  histoBins,
const unsigned int  maxThreads,
const te::rst::PolygonIterator< double >::IterationType  roisItType,
std::map< std::pair< double, double >, unsigned int > &  realJointHistogram,
std::map< std::pair< double, double >, unsigned int > &  imagJointHistogram,
std::map< double, unsigned int > const *const  rasterRealHistogram1ptr,
std::map< double, unsigned int > const *const  rasterImagHistogram1Ptr,
std::map< double, unsigned int > const *const  rasterRealHistogram2Ptr,
std::map< double, unsigned int > const *const  rasterImagHistogram2Ptr 
)

Compute and return the joint histogram of occurring values (real and imaginary) inside defined regions of interest.

Parameters
rasterInput raster.
bandIndex1Input raster Band 1 index.
bandIndex2Input raster Band 2 index.
roisRegions of interest (under the same SRID as the input raster) or an empty vector for the case where all the image must be processed.
histoBinsThe number of bins (intervals from minimum pixel to maximum). When b = 0, the histogram will be divided according to all pixel values.
maxThreadsMaximum number of used threads to use (0-Automatic, 1-No threads used).
roisItTypeROIs polygons iteration type.
realJointHistogramThe generated joint histogram (real).
imagJointHistogramThe generated joint histogram (imaginary).
rasterRealHistogram1ptrA pointer to a pre-calculated input raster band 1 histogram (real) or a null pointer.
rasterImagHistogram1PtrA pointer to a pre-calculated input raster band 1 histogram (imaginary) or a null pointer.
rasterRealHistogram2PtrA pointer to a pre-calculated input raster band 2 histogram (real) or a null pointer.
rasterImagHistogram2PtrA pointer to a pre-calculated input raster band 2 histogram (imaginary) or a null pointer.
Returns
true if ok, false on errors
Note
This method will ignore storage specific tags and will read all raster data to compute the histograms (use te::rst::Band methods to use storage specifc tags).

◆ GetMeanValue()

TERPEXPORT bool te::rp::GetMeanValue ( const te::rst::Raster inputRaster,
const unsigned int  inputBandIndex,
const unsigned int  maxThreads,
const bool  forceNoDataValue,
const double  noDataValue,
double &  meanValue 
)

Get the mean of band pixel values.

Parameters
inputRasterThe input raster.
inputBandIndexInput band index.
maxThreadsThe maximum number of threads to use (0-auto, 1-single thread used).
forceNoDataValueIgnore the raster original band no-data value and use the value given by the parameter noDataValue.
noDataValueThe no-data value to be used insted of the original raster band no-data value.
meanValueThe calculated mean value.
Returns
true if OK, false on errors.
Note
Optimized for rasters where the used bands have the same blocking scheme.

◆ GetRandomPointsInRaster()

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.

Parameters
inputRasterThe given raster.
numberOfPointsThe number of random positions to be created (default = 1000).
ignoreNoDataValuesFlag used to inform that pixel with no data value will not be considered.
Returns
A vector of random positions (points).

◆ GetSensorFilename()

TERPEXPORT std::string te::rp::GetSensorFilename ( )

Returns a json filename with spectral sensors parameters.

◆ getSensorParams()

TERPEXPORT std::map<std::string, SpectralSensorParams > te::rp::getSensorParams ( )

Returns a map with spectral sensors parameters defined in SpectralSensor.json file.

◆ GetSpectralBandInfo()

TERPEXPORT bool te::rp::GetSpectralBandInfo ( const std::string &  bandName,
SpectralSensorParams specBandInfo 
)

Get the maximun and minimum reflectance values of a given sensor/band.

Parameters
specBandInfoThe requested band info.
Returns
true if the requested band name was found, false if not.

◆ GetSpectralBandMax()

TERPEXPORT double te::rp::GetSpectralBandMax ( std::string  bandName)

Returns the maximum reflectance value of a given sensor/band.

◆ GetSpectralBandMin()

TERPEXPORT double te::rp::GetSpectralBandMin ( std::string  bandName)

Returns the minimum reflectance value of a given sensor/band.

◆ GetStdDevValue()

TERPEXPORT bool te::rp::GetStdDevValue ( const te::rst::Raster inputRaster,
const unsigned int  inputBandIndex,
const unsigned int  maxThreads,
const bool  forceNoDataValue,
const double  noDataValue,
double const *const  meanValuePtr,
double &  stdDevValue 
)

Get the standard deviation of band pixel values.

Parameters
inputRasterThe input raster.
inputBandIndexInput band index.
maxThreadsThe maximum number of threads to use (0-auto, 1-single thread used).
forceNoDataValueIgnore the raster original band no-data value and use the value given by the parameter noDataValue.
noDataValueThe no-data value to be used insted of the original raster band no-data value.
meanValuePtrA pointer to a pre-calculated band mean value or zero if it does not exist.
stdDevValueThe calculated standard deviation value.
Returns
true if OK, false on errors.
Note
Optimized for rasters where the used bands have the same blocking scheme.

◆ GetTPConvexHullArea()

template<typename ContainerT >
double te::rp::GetTPConvexHullArea ( const ContainerT &  tiePoints,
const bool  useTPSecondCoordPair 
)

Returns the tie points converx hull area.

Parameters
tiePointsInput tie-points (container of te::gm::GTParameters::TiePoint).
useTPSecondCoordPairIf true the sencond tie-point component (te::gm::GTParameters::TiePoint::second) will be used for the area calcule, otherwize the first component will be used.
Returns
Returns the tie points converx hull area.

Definition at line 884 of file Functions.h.

References te::gm::GeometryCollection::add(), te::gm::Geometry::convexHull(), and te::gm::MultiPointType.

◆ InversePrincipalComponents()

TERPEXPORT bool te::rp::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.

Parameters
pcaRasterThe principal components raster (with the same dimensions of outputRaster).
pcaMatrixThe matrix generated by the direct principal components process.
outputRasterThe regenerated output raster (with the same dimentions.
outputRasterBandsOutput raster bands.
maxThreadsThe maximum number of threads to use (0-auto, 1-single thread used).
Returns
true if OK, false on errors.
Note
Optimized for rasters where the used bands have the same blocking scheme.

◆ InverseWaveletAtrous()

TERPEXPORT bool te::rp::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.

Parameters
waveletRasterThe input wavelet raster (with the same dimensions of outputRaster).
levelsNumberThe number of decomposed wavelet levels present inside the wavelet raster.
outputRasterThe regenerated output raster.
outputRasterBandsOutput raster bands.
Returns
true if OK, false on errors.
Note
The band order of the expected wavelet levels: { [ band0-smoothed0, band0-wavelet0, ... , band0-smoothedN, band0-waveletN ], ... }
The number of bands of waveletRaster must be ( outputRasterBands.size() * 2 * levelsNumber ) at least.
Only the wavelet bands and the last smoothed band are used.

◆ NormalizeRaster() [1/2]

TERPEXPORT te::rst::Raster* te::rp::NormalizeRaster ( const te::rst::Raster inputRaster)

Normalizes a raster in a given interval.

Parameters
inputRasterThe given raster.
Returns
a raster normalized or null pointer on errors.

◆ NormalizeRaster() [2/2]

TERPEXPORT bool te::rp::NormalizeRaster ( te::rst::Raster inputRaster,
double  nmin = 0.0,
double  nmax = 255.0 
)

Normalizes one raster in a given interval.

Parameters
inputRasterThe given raster.
nminThe new minimum value (default = 0.0).
nmaxThe new maximum value (default = 255.0).
Returns
true if normalization occurs and false otherwise.

◆ RasterResample()

TERPEXPORT bool te::rp::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 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.

Parameters
inputRasterInput raster.
inputRasterBandsInput raster bands to process.
interpMethodThe method of interpolation.
See also
te::rst::Interpolator
Parameters
interpWindowRadiusInterpolator windows radius around the target pixel (when applicable).
firstRowThe starting row to make a subset of the image.
firstColumnThe starting column to make a subset of the image.
heightThe height of the subset.
widthThe width of the subset.
newheightThe resampled height of the new raster.
newwidthThe resampled width of the new raster.
rinfoThe parameters needed to build the output raster (see RasterFactory documentation).
dataSourceTypeData source type (raster type. I.E. GDAL).
resampledRasterPtrThe resampled raster pointer.
Returns
true if ok, false on errors.

◆ RasterSlicing()

TERPEXPORT bool te::rp::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::vector< double > const *  slicesLimitsPtr,
std::vector< double > const *  slicesOutputValuesPtr 
)

Create a new raster grouping pixel values following the number of slices and/or slice limits.

Parameters
inputRasterInput raster.
inputRasterBandInput raster band.
createPaletteRasterIf true a paletted raster will be created instead of a multi-band raster..
slicesNumberThe number of histogram slices to create;
eqHistogramIf true, the input raster will be equalized before the slicing process.
rasterInfoThe output raster info (specific driver info).
rasterTypeThe output raster type (specific driver name - See te::rst::RasterFactory dictorary for more info).
enableProgressEnable/disable the progress interface.
palettePtrA pointer to an optional user given palette (if null, an fixed step pallete will be generated).
outRasterPtrThe output sliced raster pointer.
slicesLimitsPtrA null pointer or a pointer to a container of slice limits ( the small of the the values for each slice range ).
slicesOutputValuesPtrA null pointer or a pointer to a vector of output raster values related to each slice.
Returns
true if OK, false on errors.

◆ RemapValues()

TERPEXPORT bool te::rp::RemapValues ( const te::rst::Raster inputRaster,
const std::vector< unsigned int > &  inputRasterBands,
const boost::numeric::ublas::matrix< double > &  remapMatrix,
te::rst::Raster outputRaster,
const std::vector< unsigned int > &  outputRasterBands,
const unsigned int  maxThreads 
)

Remap pixel values using a remap function matrix.

Parameters
inputRasterInput raster.
inputRasterBandsInput raster bands.
remapMatrixThe remap function matrix.
outputRasterThe pré-initiated output raster (with the same dimentions of inputRaster).
outputRasterBandsOutput raster bands.
maxThreadsThe maximum number of threads to use (0-auto, 1-single thread used).
Returns
true if OK, false on errors.
Note
Optimized for rasters where the used bands have the same blocking scheme.

◆ ReplaceContiguousSegmentValues() [1/2]

TERPEXPORT bool te::rp::ReplaceContiguousSegmentValues ( const te::rst::Raster inputRaster,
const unsigned int &  inputRasterBandIdx,
te::rst::Raster outputRaster,
const unsigned int &  outputRasterBandIdx,
const unsigned  targetInputRow,
const unsigned  targetInputCol,
const double &  outputValue 
)

Replace a contiguos segment pixel values.

Parameters
inputRasterInput raster.
inputRasterBandIdxInput raster band to use.
outputRasterInput raster.
outputRasterBandIdxInput raster band to use.
targetRowTarget row (a point inside the target segment).
targetColTarget col (a point inside the target segment).
outputValueOutput segment final value.
Returns
true if OK, false on errors.

◆ ReplaceContiguousSegmentValues() [2/2]

TERPEXPORT bool te::rp::ReplaceContiguousSegmentValues ( te::rst::Raster inputRaster,
const unsigned int &  inputRasterBandIdx,
const unsigned  targetRow,
const unsigned  targetCol,
const double &  outputValue 
)

Replace a contiguos segment pixel values.

Parameters
inputRasterInput raster.
inputRasterBandIdxInput raster band to use.
targetRowTarget row (a point inside the target segment).
targetColTarget col (a point inside the target segment).
outputValueOutput segment final value.
Returns
true if OK, false on errors.

◆ SaveSensorParams()

TERPEXPORT void te::rp::SaveSensorParams ( std::map< std::string, SpectralSensorParams > &  )

Saves in SpectralSensor.json file the spectral sensors parameters.

◆ SelectiveReplaceValues()

TERPEXPORT bool te::rp::SelectiveReplaceValues ( const te::rst::Raster inputRaster,
const unsigned int &  inputRasterBandIdx,
const std::vector< std::pair< double, double > > &  targetValues,
const bool  enableProgress,
const std::vector< te::gm::Polygon * > &  restrictionPols,
te::rst::Raster outputRaster,
const unsigned int &  outputRasterBandIdx 
)

Remap all pixel values using a user supplied target values (non-target values are just copied from input to output).

Parameters
inputRasterInput raster.
inputRasterBandIdxInput raster band.
targetValuesA vector of target values pairs in the form: std::pair< old_value, new_value >.
enableProgressEnable/disable the progress interface.
restrictionPolsA vector of polygons where the remap must be executed or an empty vector indicating all pixels must be remapped.
outputRasterThe pré-initiated output raster.
outputRasterBandIdxOutput raster band.
Returns
true if OK, false on errors.
Note
Optimized for rasters where the used bands have the same blocking scheme.