28 #include "../raster/Interpolator.h"
29 #include "../raster/Enums.h"
30 #include "../raster/RasterFactory.h"
31 #include "../raster/Grid.h"
32 #include "../raster/Band.h"
33 #include "../raster/BandProperty.h"
34 #include "../raster/PositionIterator.h"
35 #include "../raster/Utils.h"
36 #include "../memory/CachedRaster.h"
37 #include "../geometry/Envelope.h"
38 #include "../geometry/GTFactory.h"
39 #include "../geometry/Polygon.h"
40 #include "../geometry/LinearRing.h"
41 #include "../geometry/MultiPolygon.h"
42 #include "../srs/Converter.h"
44 #include <boost/shared_ptr.hpp>
74 m_feederRasterPtr = 0;
75 m_inputRastersBands.clear();
77 m_geomTransfName =
"Affine";
80 m_forceInputNoDataValue =
false;
82 m_autoEqualize =
true;
83 m_useRasterCache =
true;
130 m_outputRasterPtr.reset();
159 throw( te::rp::Exception )
169 double mosaicXResolution = 0.0;
170 double mosaicYResolution = 0.0;
171 double mosaicLLX = DBL_MAX;
172 double mosaicLLY = DBL_MAX;
173 double mosaicURX = -1.0 * DBL_MAX;
174 double mosaicURY = -1.0 * DBL_MAX;
176 std::vector< double > mosaicBandsRangeMin;
177 std::vector< double > mosaicBandsRangeMax;
179 std::vector< te::gm::Polygon > rastersBBoxes;
182 std::vector< boost::shared_ptr< te::gm::GeometricTransformation > >
183 eachRasterPixelToFirstRasterPixelGeomTransfms;
188 std::vector< te::rst::Grid > rastersGrids;
193 unsigned int inputRasterIdx = 0;
195 boost::shared_ptr< te::gm::GeometricTransformation > auxTransPtr;
209 rastersGrids.push_back( (*inputRasterPtr->
getGrid()) );
213 if( inputRasterIdx == 0 )
231 auxLinearRingPtr->
setPoint( 0, mosaicLLX, mosaicURY );
232 auxLinearRingPtr->
setPoint( 1, mosaicURX, mosaicURY );
233 auxLinearRingPtr->
setPoint( 2, mosaicURX, mosaicLLY );
234 auxLinearRingPtr->
setPoint( 3, mosaicLLX, mosaicLLY );
235 auxLinearRingPtr->
setPoint( 4, mosaicLLX, mosaicURY );
236 auxPolygon.
push_back( auxLinearRingPtr );
237 auxPolygon.
setSRID( mosaicSRID );
238 rastersBBoxes.push_back( auxPolygon );
244 if( ( inputRasterIdx == 1 ) ||
255 const std::vector< te::gm::GTParameters::TiePoint >& inputTPs =
257 const unsigned int inputTPsSize = inputTPs.size();
259 (*eachRasterPixelToFirstRasterPixelGeomTransfms[ inputRasterIdx - 2 ].get());
261 for(
unsigned int inputTPsIdx = 0 ; inputTPsIdx < inputTPsSize ;
264 auxTP.second = inputTPs[ inputTPsIdx ].second;
265 lastTransf.
inverseMap( inputTPs[ inputTPsIdx ].first, auxTP.first );
273 "Geometric transformation instatiation error" );
275 "Geometric transformation parameters calcule error" );
276 eachRasterPixelToFirstRasterPixelGeomTransfms.push_back( auxTransPtr );
290 auxTransPtr->inverseMap( urCoord2, urCoord1 );
291 auxTransPtr->inverseMap( llCoord2, llCoord1 );
295 rastersGrids[ 0 ].gridToGeo( urCoord1.
x, urCoord1.
y, urCoord2.
x,
297 rastersGrids[ 0 ].gridToGeo( llCoord1.
x, llCoord1.
y, llCoord2.
x,
302 mosaicLLX = std::min( mosaicLLX, urCoord2.
x );
303 mosaicLLX = std::min( mosaicLLX, llCoord2.
x );
305 mosaicLLY = std::min( mosaicLLY, urCoord2.
y );
306 mosaicLLY = std::min( mosaicLLY, llCoord2.
y );
308 mosaicURX = std::max( mosaicURX, urCoord2.
x );
309 mosaicURX = std::max( mosaicURX, llCoord2.
x );
311 mosaicURY = std::max( mosaicURY, urCoord2.
y );
312 mosaicURY = std::max( mosaicURY, llCoord2.
y );
318 auxLinearRingPtr->
setPoint( 0, llCoord2.
x, urCoord2.
y );
319 auxLinearRingPtr->
setPoint( 1, urCoord2.
x, urCoord2.
y );
320 auxLinearRingPtr->
setPoint( 2, urCoord2.
x, llCoord2.
y );
321 auxLinearRingPtr->
setPoint( 3, llCoord2.
x, llCoord2.
y );
322 auxLinearRingPtr->
setPoint( 4, llCoord2.
x, urCoord2.
y );
323 auxPolygon.
push_back( auxLinearRingPtr );
324 auxPolygon.
setSRID( mosaicSRID );
325 rastersBBoxes.push_back( auxPolygon );
330 for( std::vector< unsigned int >::size_type inputRastersBandsIdx = 0 ;
331 inputRastersBandsIdx <
333 ++inputRastersBandsIdx )
335 const unsigned int& currBand =
354 mosaicBandsRangeMin.resize(
356 mosaicBandsRangeMax.resize(
359 std::vector< te::rst::BandProperty* > bandsProperties;
360 for( std::vector< unsigned int >::size_type bandIdx = 0 ; bandIdx <
368 mosaicBandsRangeMin[ bandIdx ],
369 mosaicBandsRangeMax[ bandIdx ]);
374 mosaicURY ), mosaicSRID );
385 "Output raster creation error" );
390 std::auto_ptr< te::mem::CachedRaster > cachedOutputRasterInstancePtr;
397 outputRasterPtr = cachedOutputRasterInstancePtr.get();
404 std::vector< boost::shared_ptr< te::gm::GeometricTransformation > >
405 eachRasterPixelToMosaicRasterPixelGeomTransfms;
408 const double firstRasterColOffset = std::abs( rastersBBoxes[ 0 ].getMBR()->m_llx -
411 const double firstRasterLinOffset = std::abs( rastersBBoxes[ 0 ].getMBR()->m_ury -
421 const double prevRasterColOffset = std::abs( rastersBBoxes[ tiePointsIdx ].getMBR()->m_llx -
424 const double prevRasterLinOffset = std::abs( rastersBBoxes[ tiePointsIdx ].getMBR()->m_ury -
428 for(
unsigned int tpIdx = 0 ; tpIdx < transfParams.
m_tiePoints.size() ;
433 transfParams.
m_tiePoints[ tpIdx ].first.x += firstRasterColOffset;
434 transfParams.
m_tiePoints[ tpIdx ].first.y += firstRasterLinOffset;
438 transfParams.
m_tiePoints[ tpIdx ].first.x += prevRasterColOffset;
439 transfParams.
m_tiePoints[ tpIdx ].first.y += prevRasterLinOffset;
443 boost::shared_ptr< te::gm::GeometricTransformation > auxTransPtr(
446 "Geometric transformation instatiation error" );
448 "Geometric transformation parameters calcule error" );
449 eachRasterPixelToMosaicRasterPixelGeomTransfms.push_back( auxTransPtr );
459 unsigned int col = 0;
460 unsigned int row = 0;
461 unsigned int bandIdx = 0;
463 for( bandIdx = 0 ; bandIdx < nBands ; ++bandIdx )
467 for( row = 0 ; row < nRows ; ++row )
469 for( col = 0 ; col < nCols ; ++col )
480 std::vector< double > mosaicTargetMeans( outputRasterPtr->
getNumberOfBands(), 0 );
481 std::vector< double > mosaicTargetVariances( outputRasterPtr->
getNumberOfBands(), 0 );
490 double inXStartGeo = 0;
491 double inYStartGeo = 0;
493 double outRowStartDouble = 0;
494 double outColStartDouble = 0;
496 outColStartDouble, outRowStartDouble );
498 const unsigned int outRowStart = (
unsigned int)std::max( 0.0, outRowStartDouble );
499 const unsigned int outColStart = (
unsigned int)std::max( 0.0, outColStartDouble );
500 const unsigned int outRowsBound = std::min( outRowStart +
503 const unsigned int outColsBound = std::min( outColStart +
507 const unsigned int nBands = (
unsigned int)
509 unsigned int outCol = 0;
510 unsigned int outRow = 0;
513 double bandNoDataValue = -1.0 * DBL_MAX;
514 std::complex< double > pixelCValue = 0;
517 unsigned int inputBandIdx = 0;
519 for(
unsigned int inputRastersBandsIdx = 0 ; inputRastersBandsIdx <
520 nBands ; ++inputRastersBandsIdx )
523 inputRastersBandsIdx ] ;
528 (*outputRasterPtr->
getBand( inputRastersBandsIdx ));
529 unsigned int validPixelsNumber = 0;
531 double& mean = mosaicTargetMeans[ inputRastersBandsIdx ];
534 for( outRow = outRowStart ; outRow < outRowsBound ; ++outRow )
536 inRow = ((double)outRow) - outRowStartDouble;
538 for( outCol = outColStart ; outCol < outColsBound ; ++outCol )
540 inCol = ((double)outCol) - outColStartDouble;
542 interpInstance.
getValue( inCol, inRow, pixelCValue, inputBandIdx );
544 if( pixelCValue.real() != bandNoDataValue )
546 outBand.
setValue( outCol, outRow, pixelCValue );
547 mean += pixelCValue.real();
553 mean /= ( (double)validPixelsNumber );
559 double& variance = mosaicTargetVariances[ inputRastersBandsIdx ];
562 double pixelValue = 0;
564 for( outRow = outRowStart ; outRow < outRowsBound ; ++outRow )
566 for( outCol = outColStart ; outCol < outColsBound ; ++outCol )
568 outBand.
getValue( outCol, outRow, pixelValue );
572 variance += ( ( pixelValue - mean ) * ( pixelValue -
573 mean ) ) / ( (
double)validPixelsNumber );
583 std::auto_ptr< te::gm::MultiPolygon > mosaicBBoxesUnionPtr(
586 mosaicBBoxesUnionPtr->add( (
te::gm::Polygon*)rastersBBoxes[ 0 ].clone() );
590 std::vector< unsigned int > outputRasterBands;
591 std::vector< double > dummyRasterOffsets;
592 std::vector< double > dummyRasterScales;
593 for(
unsigned int outputRasterBandsIdx = 0 ; outputRasterBandsIdx <
596 outputRasterBands.push_back( outputRasterBandsIdx );
597 dummyRasterOffsets.push_back( 0.0 );
598 dummyRasterScales.push_back( 1.0 );
614 std::auto_ptr< te::mem::CachedRaster > cachedInputRasterPtr;
618 *nonCachedInputRasterPtr, 25, 0 ) );
619 inputRasterPtr = cachedInputRasterPtr.get();
624 std::vector< double > currentRasterBandsOffsets;
625 std::vector< double > currentRasterBandsScales;
629 double currentRasterVariance = 0;
630 double currentRasterMean = 0;
632 for(
unsigned int inputRastersBandsIdx = 0 ; inputRastersBandsIdx <
634 ++inputRastersBandsIdx )
637 inputRastersBandsIdx ];
643 currentRasterVariance );
645 currentRasterBandsScales.push_back( std::sqrt( mosaicTargetVariances[ inputRastersBandsIdx ] /
646 currentRasterVariance ) );
647 currentRasterBandsOffsets.push_back( mosaicTargetMeans[ inputRastersBandsIdx ] -
648 ( currentRasterBandsScales[ inputRastersBandsIdx ] * currentRasterMean ) );
653 currentRasterBandsOffsets = dummyRasterOffsets;
654 currentRasterBandsScales = dummyRasterScales;
665 const double currentRasterColOffset = std::abs( rastersBBoxes[ inputRasterIdx ].getMBR()->m_llx -
668 const double currentRasterRowOffset = std::abs( rastersBBoxes[ inputRasterIdx ].getMBR()->m_ury -
672 const unsigned int outRowStart = (
unsigned int)std::max( 0.0, currentRasterRowOffset );
673 const unsigned int outColStart = (
unsigned int)std::max( 0.0, currentRasterColOffset );
674 const unsigned int outRowsBound = std::min( outRowStart +
677 const unsigned int outColsBound = std::min( outColStart +
685 *(eachRasterPixelToMosaicRasterPixelGeomTransfms[ inputRasterIdx - 1 ]);
687 for(
unsigned int inputRastersBandsIdx = 0 ; inputRastersBandsIdx <
688 nBands ; ++inputRastersBandsIdx )
690 const unsigned int inputBandIdx =
692 const double inputNoDataValue =
698 (*outputRasterPtr->
getBand( inputRastersBandsIdx ));
700 double outputBandRangeMin = 0;
701 double outputBandRangeMax = 0;
703 outputBandRangeMin, outputBandRangeMax );
705 unsigned int outCol = 0;
706 unsigned int outRow = 0;
709 std::complex< double > pixelCValue = 0;
710 double pixelValue = 0;
712 for( outRow = outRowStart ; outRow < outRowsBound ; ++outRow )
714 for( outCol = outColStart ; outCol < outColsBound ; ++outCol )
716 transformation.
directMap( (
double)outCol, (
double)outRow, inCol, inRow );
718 interpInstance.
getValue( inCol, inRow, pixelCValue, inputBandIdx );
720 if( pixelCValue.real() != inputNoDataValue )
722 pixelValue = pixelCValue.real() * currentRasterBandsScales[
723 inputRastersBandsIdx ] + currentRasterBandsOffsets[
724 inputRastersBandsIdx ];
725 pixelValue = std::max( pixelValue, outputBandRangeMin );
726 pixelValue = std::min( pixelValue, outputBandRangeMax );
728 outBand.
setValue( outCol, outRow, pixelValue );
741 for( std::size_t mosaicBBoxesUnionIdx = 0 ; mosaicBBoxesUnionIdx <
742 mosaicBBoxesUnionPtr->getNumGeometries() ; ++mosaicBBoxesUnionIdx )
746 mosaicBBoxesUnionPtr->getGeometryN( mosaicBBoxesUnionIdx ) );
752 std::auto_ptr< te::gm::MultiPolygon > overlappedResult;
755 std::auto_ptr< te::gm::Geometry > auxResultPtr(
756 rastersBBoxes[ inputRasterIdx ].intersection( mosaicBBoxesUnionElementPtr ) );
758 if( auxResultPtr.get() )
760 auxResultPtr->setSRID( mosaicBBoxesUnionElementPtr->
getSRID() );
771 auxMultiPol->
add( auxResultPtr.release() );
772 overlappedResult.reset( auxMultiPol );
779 if( overlappedResult.get() )
795 currentRasterBandsOffsets,
796 currentRasterBandsScales,
797 mosaicBBoxesUnionElementPtr,
799 *( eachRasterPixelToMosaicRasterPixelGeomTransfms[ inputRasterIdx - 1 ] ) ),
800 "Blender initiazing error" );
802 for(
unsigned int overlappedResultIdx = 0 ; overlappedResultIdx <
803 overlappedResult->getNumGeometries() ; ++overlappedResultIdx )
807 (
te::gm::Polygon const*)overlappedResult->getGeometryN( overlappedResultIdx ) );
810 (
te::gm::Polygon const*)overlappedResult->getGeometryN( overlappedResultIdx ) );
813 unsigned int outputRow = 0;
814 unsigned int outputCol = 0;
816 unsigned int outBandIdx = 0;
826 for( outBandIdx = 0 ; outBandIdx < nBands ; ++outBandIdx )
828 double& blendedValue = blendedValues[ outBandIdx ];
832 blendedValue = std::max( blendedValue ,
833 mosaicBandsRangeMin[ outBandIdx ] );
834 blendedValue = std::min( blendedValue ,
835 mosaicBandsRangeMax[ outBandIdx ] );
837 outputRaster.
setValue( outputCol, outputRow, blendedValue, outBandIdx );
849 std::auto_ptr< te::gm::MultiPolygon > nonOverlappedResult;
852 std::auto_ptr< te::gm::Geometry > auxResultPtr(
853 rastersBBoxes[ inputRasterIdx ].difference( mosaicBBoxesUnionPtr.get() ) );
855 if( auxResultPtr.get() )
857 auxResultPtr->setSRID( mosaicBBoxesUnionPtr->getSRID() );
868 auxMultiPol->
add( auxResultPtr.release() );
869 nonOverlappedResult.reset( auxMultiPol );
879 nonOverlappedResult.reset( auxMultiPol );
885 if( nonOverlappedResult.get() )
890 *(eachRasterPixelToMosaicRasterPixelGeomTransfms[ inputRasterIdx - 1 ]);
892 for(
unsigned int inputRastersBandsIdx = 0 ; inputRastersBandsIdx <
894 ++inputRastersBandsIdx )
897 inputRastersBandsIdx ];
900 double outputBandRangeMin = 0;
901 double outputBandRangeMax = 0;
903 outputBandRangeMin, outputBandRangeMax );
905 const std::size_t nonOverlappednResultSize =
906 nonOverlappedResult->getNumGeometries();
911 for(
unsigned int nonOverlappednResultIdx = 0 ; nonOverlappednResultIdx < nonOverlappednResultSize ;
912 ++nonOverlappednResultIdx )
916 nonOverlappedResult->getGeometryN( nonOverlappednResultIdx ) );
920 unsigned int outputRow = 0;
921 unsigned int outputCol = 0;
924 std::complex< double > pixelCValue = 0;
925 double pixelValue = 0;
928 nonOverlappednResultElementPtr );
930 nonOverlappednResultElementPtr );
937 transformation.
directMap( (
double)outputCol, (
double)outputRow, inputCol, inputRow );
939 interpInstance.
getValue( inputCol, inputRow, pixelCValue, inputBandIdx );
941 if( pixelCValue.real() != inputBandNoDataValue )
943 pixelValue = pixelCValue.real() * currentRasterBandsScales[
944 inputRastersBandsIdx ] + currentRasterBandsOffsets[
945 inputRastersBandsIdx ];
946 pixelValue = std::max( pixelValue, outputBandRangeMin );
947 pixelValue = std::min( pixelValue, outputBandRangeMax );
949 outputBand.
setValue( outputCol, outputRow, pixelValue );
974 throw( te::rp::Exception )
987 "Invalid m_feederRasterPtr" )
991 "Invalid number of rasters" )
1000 for( std::vector< std::vector< unsigned int > >::size_type
1001 inputRastersBandsIdx = 0 ; inputRastersBandsIdx <
1005 inputRastersBandsIdx ].size() > 0,
"Invalid bands number" );
1009 0 ].size(),
"Bands number mismatch" );
1030 const bool& forceNoDataValue,
1031 const double& noDataValue,
1032 double& mean,
double& variance )
1037 double internalNoDataValue = 0;
1038 if( forceNoDataValue )
1039 internalNoDataValue = noDataValue;
1048 double pixelsNumber = 0;
1050 unsigned int col = 0;
1051 unsigned int line = 0;
1053 for( line = 0 ; line < nLines ; ++line )
1054 for( col = 0 ; col < nCols ; ++col )
1058 if( value != internalNoDataValue )
1065 if( pixelsNumber != 0.0 )
1067 mean /= pixelsNumber;
1069 for( line = 0 ; line < nLines ; ++line )
1070 for( col = 0 ; col < nCols ; ++col )
1074 if( value != internalNoDataValue )
1076 variance += ( ( value - mean ) * ( value - mean ) ) / pixelsNumber;
virtual unsigned int getObjsCount() const =0
Return the total number of feeder objects.
int m_blkh
Block height (pixels).
#define TERP_DEBUG_TRUE_OR_THROW(value, message)
Checks if value is true and throws an exception if not.
bool m_autoEqualize
Auto equalization will be performed using the overlaped image areas (default:true).
int getSRID() const
It returns the Spatial Reference System ID associated to this geometric object.
static void calcBandStatistics(const te::rst::Band &band, const bool &forceNoDataValue, const double &noDataValue, double &mean, double &variance)
Raster band statistics calcule.
virtual te::rst::Raster const * getCurrentObj() const =0
Return the current sequence object.
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.
std::auto_ptr< te::rst::Raster > m_outputRasterPtr
The generated output mosaic raster.
unsigned int getNumberOfRows() const
Returns the raster number of rows.
Polygon is a subclass of CurvePolygon whose rings are defined by linear rings.
A LinearRing is a LineString that is both closed and simple.
unsigned int getRow() const
Returns the current row in iterator.
virtual unsigned int getCurrentOffset() const =0
Return the index of the current object.
void setSRID(int srid)
It sets the Spatial Reference System ID of the geometry and all its parts if it is a GeometryCollecti...
void reset()
Clear all internal allocated resources and reset the parameters instance to its initial state...
double m_noDataValue
The pixel value used where no raster data is avaliable (defaul:0).
Grid * getGrid()
It returns the raster grid.
bool m_useRasterCache
Enable(true) or disable the use of raster caching (default:true).
static Raster * make()
It creates and returns an empty raster with default raster driver.
void reset()
Clear all internal allocated objects and reset the algorithm to its initial state.
virtual void getValue(unsigned int c, unsigned int r, double &value) const =0
Returns the cell attribute value.
te::rst::Interpolator::Method m_interpMethod
The raster interpolator method (default:NearestNeighbor).
bool initialize(const AlgorithmInputParameters &inputParams)
Initialize the algorithm instance making it ready for execution.
void reset()
Clear all internal allocated resources and reset the parameters instance to its initial state...
double getResolutionY() const
Returns the grid vertical (y-axis) resolution.
Tie-points linking any raster to the first sequence raster (te::gm::GTParameters::TiePoint::first are...
void getValue(const double &c, const double &r, std::complex< double > &v, const std::size_t &b)
Get the interpolated value at specific band.
int m_nblocksy
The number of blocks in y.
virtual std::size_t getNumberOfBands() const =0
Returns the number of bands (dimension of cells attribute values) in the raster.
TiePointsMosaic::InputParameters m_inputParameters
Input execution parameters.
Blended pixel value calculation for two overlaped rasters.
It interpolates one pixel based on a selected algorithm. Methods currently available are Nearest Neig...
static GeometricTransformation * make(const std::string &factoryKey)
It creates an object with the appropriated factory.
An utility struct for representing 2D coordinates.
bool m_isInitialized
Tells if this instance is initialized.
unsigned int getNumberOfRows() const
Returns the grid number of rows.
void getBlendedValues(const double &line, const double &col, std::vector< double > &values)
Blend a pixel value using the current parameters.
static PolygonIterator begin(const te::rst::Raster *r, const te::gm::Polygon *p)
Returns an iterator referring to the first value of the band.
bool isInitialized() const
Returns true if the algorithm instance is initialized and ready for execution.
void add(Geometry *g)
It adds the geometry into the collection.
#define TERP_TRUE_OR_RETURN_FALSE(value, message)
Checks if value is true. For false values a warning message will be logged and a return of context wi...
FeederConstRaster * m_feederRasterPtr
Input rasters feeder.
int m_type
The data type of the elements in the band.
Abstract parameters base interface.
std::vector< TiePoint > m_tiePoints
Tie points.
A raster band description.
A rectified grid is the spatial support for raster data.
MultiPolygon is a MultiSurface whose elements are Polygons.
double m_lly
Lower left corner y-coordinate.
const OutputParameters & operator=(const OutputParameters ¶ms)
int m_blkw
Block width (pixels).
std::string m_geomTransfName
The name of the geometric transformation used if tie-points are supplied (see each te::gm::GTFactory ...
virtual void setValue(unsigned int c, unsigned int r, const double value)=0
Sets the cell attribute value.
double m_ury
Upper right corner y-coordinate.
te::rp::Blender::BlendMethod m_blendMethod
The pixel blending method (default: NoBlendMethod).
te::gm::Envelope * getExtent()
Returns the geographic extension of the grid.
void clear()
It deletes all the rings of the CurvePolygon and clear it.
double getResolutionX() const
Returns the grid horizontal (x-axis) resolution.
This class implements the strategy to iterate with spatial restriction, the iteration occurs inside a...
double m_urx
Upper right corner x-coordinate.
unsigned int getColumn() const
Returns the current column in iterator.
Create a mosaic from a set of rasters using tie-points.
unsigned int getNumberOfColumns() const
Returns the raster number of columns.
const Algorithm & operator=(const Algorithm &)
const InputParameters & operator=(const InputParameters ¶ms)
void setPoint(std::size_t i, const double &x, const double &y)
It sets the value of the specified point.
A raster band description.
double m_noDataValue
Value to indicate elements where there is no data, default is std::numeric_limits<double>::max().
std::map< std::string, std::string > m_rInfo
The necessary information to create the output rasters (as described in te::raster::RasterFactory).
virtual void reset()=0
Reset the feeder to the first position (subsequent accesses will start from the first sequence obejct...
2D Geometric transformation base class.
void gridToGeo(const double &col, const double &row, double &x, double &y) const
Get the spatial location of a grid point.
#define TERP_TRUE_OR_THROW(value, message)
Checks if value is true and throws an exception if not.
A Converter is responsible for the conversion of coordinates between different Coordinate Systems (CS...
Mosaic output parameters.
AbstractParameters * clone() const
Create a clone copy of this instance.
A RAM cache adaptor to an external existent raster that must always be avaliable. ...
std::string m_rType
Output raster data source type (as described in te::raster::RasterFactory ).
Raster Processing algorithm output parameters base interface.
double m_llx
Lower left corner x-coordinate.
int m_nblocksx
The number of blocks in x.
An abstract class for raster data strucutures.
BandProperty * getProperty()
Returns the band property.
virtual const Band * getBand(std::size_t i) const =0
Returns the raster i-th band.
unsigned int getNumberOfColumns() const
Returns the grid number of columns.
static PolygonIterator end(const te::rst::Raster *r, const te::gm::Polygon *p)
Returns an iterator referring to after the end of the iterator.
int getSRID() const
Returns the grid spatial reference system identifier.
TiePointsLinkType m_tiePointsLinkType
The given tie points linking type, see TiePointsLinkType.
AbstractParameters * clone() const
Create a clone copy of this instance.
bool m_forceInputNoDataValue
If true, m_noDataValue will be used as the no-data value for input rasters (defalt:false).
2D Geometric transformation parameters.
std::pair< Coord2D, Coord2D > TiePoint
Tie point type definition.
bool execute(AlgorithmOutputParameters &outputParams)
Executes the algorithm using the supplied parameters.
An Envelope defines a 2D rectangular region.
Near neighborhood interpolation method.
TERASTEREXPORT void GetDataTypeRanges(const int &dataType, double &min, double &max)
Return the values range of a given data type.
void geoToGrid(const double &x, const double &y, double &col, double &row) const
Get the grid point associated to a spatial location.
virtual void directMap(const GTParameters ¶ms, const double &pt1X, const double &pt1Y, double &pt2X, double &pt2Y) const =0
Direct mapping (from pt1 space into pt2 space).
Index into a lookup table.
std::vector< std::vector< te::gm::GTParameters::TiePoint > > m_tiePoints
Tie-points between each adjacent raster pair (te::gm::GTParameters::TiePoint::first are raster (with ...
void push_back(Curve *ring)
It adds the curve to the curve polygon.
std::vector< std::vector< unsigned int > > m_inputRastersBands
Bands to process for each input raster.
bool initialize(const te::rst::Raster &raster1, const std::vector< unsigned int > &raster1Bands, const te::rst::Raster &raster2, const std::vector< unsigned int > &raster2Bands, const BlendMethod &blendMethod, const te::rst::Interpolator::Method &interpMethod1, const te::rst::Interpolator::Method &interpMethod2, const double &noDataValue, const bool forceInputNoDataValue, const std::vector< double > &pixelOffsets1, const std::vector< double > &pixelScales1, const std::vector< double > &pixelOffsets2, const std::vector< double > &pixelScales2, te::gm::Polygon const *const r1ValidDataDelimiterPtr, te::gm::Polygon const *const r2ValidDataDelimiterPtr, const te::gm::GeometricTransformation &geomTransformation)
Inititate the blender instance.
te::common::AccessPolicy getAccessPolicy() const
Returns the raster access policy.
virtual void inverseMap(const GTParameters ¶ms, const double &pt2X, const double &pt2Y, double &pt1X, double &pt1Y) const =0
Inverse mapping (from pt2 space into pt1 space).
virtual bool moveNext()=0
Advances to the next sequence obeject.
Raster Processing algorithm input parameters base interface.
#define TERP_DEBUG_TRUE_OR_RETURN_FALSE(value, message)
Checks if value is true. For false values a warning message will be logged and a return of context wi...