30 #include "../raster/Grid.h" 31 #include "../raster/BandProperty.h" 32 #include "../raster/Utils.h" 33 #include "../raster/RasterFactory.h" 34 #include "../memory/CachedRaster.h" 35 #include "../memory/ExpansibleRaster.h" 36 #include "../geometry/Envelope.h" 37 #include "../geometry/GeometricTransformation.h" 38 #include "../geometry/Polygon.h" 39 #include "../geometry/LinearRing.h" 40 #include "../geometry/MultiPolygon.h" 41 #include "../geometry/MultiPoint.h" 42 #include "../geometry/Point.h" 43 #include "../common/progress/TaskProgress.h" 44 #include "../common/PlatformUtils.h" 46 #include <boost/lexical_cast.hpp> 51 #define SEQUENCE_RASTER_MAX_MOSAIC_MEM_USE 10 145 m_outputDSPtr =
nullptr;
146 m_sequencesInfo.clear();
173 m_dataSetName.clear();
174 m_rasterFeederIndexes.clear();
188 throw( te::rp::Exception )
197 "Invalid data source" );
199 "Invalid data source" );
205 std::unique_ptr< te::common::TaskProgress > progressPtr;
212 progressPtr->setMessage(
"Mosaicking" );
220 std::vector< unsigned int > dummyRasterBandsIndexes;
222 for(
unsigned int bandIdx = 0 ; bandIdx <
224 dummyRasterBandsIndexes.push_back( bandIdx );
227 std::unique_ptr< te::mem::ExpansibleRaster > mosaicRasterHandler;
228 std::vector< double > mosaicTargetMeans;
229 std::vector< double > mosaicTargetVariances;
231 std::vector< double > mosaicBandsRangeMin;
232 std::vector< double > mosaicBandsRangeMax;
233 unsigned int prevRasterMosaicFirstCol = 0;
234 unsigned int prevRasterMosaicFirstRow = 0;
235 unsigned int prevRasterMosaicLastCol = 0;
236 unsigned int prevRasterMosaicLastRow = 0;
242 const unsigned int inputRasterIdx =
248 std::unique_ptr< te::mem::CachedRaster > cachedInputRasterPtr;
254 inputRasterPtr = cachedInputRasterPtr.get();
271 if( mosaicRasterHandler.get() == nullptr )
275 unsigned int mosaicNBlocksX = 4;
276 unsigned int mosaicNBlocksY = 4;
281 if( ( mosaicNBlocksX * mosaicNBlocksY ) < nProc )
283 mosaicNBlocksX = mosaicNBlocksY = (
unsigned int)std::ceil(
284 std::sqrt( (
double)nProc ) );
289 / ((
double)mosaicNBlocksX) );
290 unsigned int mosaicBlockH = (
unsigned int)std::ceil( ((
double)inputRasterPtr->
getNumberOfRows())
291 / ((
double)mosaicNBlocksY ) );
293 unsigned int mosaicNCols = mosaicBlockW * mosaicNBlocksX;
294 unsigned int mosaicNRows = mosaicBlockH * mosaicNBlocksY;
298 std::vector< te::rst::BandProperty* > bandsProperties;
300 for( std::vector< unsigned int >::size_type inputRastersBandsIdx = 0 ;
302 ++inputRastersBandsIdx )
306 inputRasterIdx ][ inputRastersBandsIdx ] )->
getProperty();
311 bandsProperties[ inputRastersBandsIdx ]->m_blkw = mosaicBlockW;
312 bandsProperties[ inputRastersBandsIdx ]->m_blkh = mosaicBlockH;
313 bandsProperties[ inputRastersBandsIdx ]->m_nblocksx = mosaicNBlocksX;
314 bandsProperties[ inputRastersBandsIdx ]->m_nblocksy = mosaicNBlocksY;
328 mosaicRasterHandler.reset(
333 "Output raster creation error" );
337 mosaicBandsRangeMin.resize(
338 mosaicRasterHandler->getNumberOfBands(), 0 );
339 mosaicBandsRangeMax.resize(
340 mosaicRasterHandler->getNumberOfBands(), 0 );
341 for(
unsigned int mosaicBandidx = 0 ; mosaicBandidx <
342 mosaicRasterHandler->getNumberOfBands() ; ++mosaicBandidx )
345 mosaicRasterHandler->getBand( mosaicBandidx )->getProperty()->m_type,
346 mosaicBandsRangeMin[ mosaicBandidx ],
347 mosaicBandsRangeMax[ mosaicBandidx ]);
350 prevRasterMosaicFirstCol = 0;
353 prevRasterMosaicFirstRow = 0;
355 const double& mosaicLLX = mosaicRasterHandler->getGrid()->getExtent()->m_llx;
356 const double& mosaicLLY = mosaicRasterHandler->getGrid()->getExtent()->m_lly;
357 const double& mosaicURX = mosaicRasterHandler->getGrid()->getExtent()->m_urx;
358 const double& mosaicURY = mosaicRasterHandler->getGrid()->getExtent()->m_ury;
361 auxLinearRingPtr->
setPoint( 0, mosaicLLX, mosaicURY );
362 auxLinearRingPtr->
setPoint( 1, mosaicURX, mosaicURY );
363 auxLinearRingPtr->
setPoint( 2, mosaicURX, mosaicLLY );
364 auxLinearRingPtr->
setPoint( 3, mosaicLLX, mosaicLLY );
365 auxLinearRingPtr->
setPoint( 4, mosaicLLX, mosaicURY );
366 auxLinearRingPtr->
setSRID( mosaicRasterHandler->getGrid()->getSRID() );
369 mosaicRasterHandler->getGrid()->getSRID(), nullptr );
370 outPolPtr->
add( auxLinearRingPtr );
372 mosaicValidAreaPols.
clear();
373 mosaicValidAreaPols.
add( outPolPtr );
374 mosaicValidAreaPols.
setSRID( mosaicRasterHandler->getGrid()->getSRID() );
379 const unsigned int nBands =
static_cast<unsigned int>(mosaicRasterHandler->getNumberOfBands());
380 const unsigned int inputRasterNRows = inputRasterPtr->
getNumberOfRows();
382 const unsigned int mosaicNRows = mosaicRasterHandler->getNumberOfRows();
383 const unsigned int mosaicNCols = mosaicRasterHandler->getNumberOfColumns();
384 unsigned long int validPixelsNumber = 0;
385 unsigned int outCol = 0;
386 unsigned int outRow = 0;
389 mosaicTargetMeans.resize( nBands, 0.0 );
390 mosaicTargetVariances.resize( nBands, 0.0 );
392 for(
unsigned int inputRastersBandsIdx = 0 ; inputRastersBandsIdx <
393 nBands ; ++inputRastersBandsIdx )
395 const unsigned int inputBandIdx =
398 (*mosaicRasterHandler->getBand( inputRastersBandsIdx ));
400 (*inputRasterPtr->
getBand( inputBandIdx ));
408 for( outRow = 0 ; outRow < mosaicNRows ; ++outRow )
410 for( outCol = 0 ; outCol < mosaicNCols ; ++outCol )
412 if( ( outRow < inputRasterNRows ) && ( outCol < inputRasterNCols ) )
414 inBand.
getValue( outCol, outRow, pixelValue );
416 if( pixelValue != inputBandNoDataValue )
418 outBand.
setValue( outCol, outRow, pixelValue );
426 outBand.
setValue( outCol, outRow, outputBandNoDataValue );
435 mean /= ( (double)validPixelsNumber );
436 mosaicTargetMeans[ inputRastersBandsIdx ] = mean;
438 double& variance = mosaicTargetVariances[ inputRastersBandsIdx ];
441 double pixelValue = 0;
443 for( outRow = 0 ; outRow < inputRasterNRows ; ++outRow )
445 for( outCol = 0 ; outCol < inputRasterNCols ; ++outCol )
447 outBand.
getValue( outCol, outRow, pixelValue );
449 if( pixelValue != inputBandNoDataValue )
451 variance += ( ( pixelValue - mean ) * ( pixelValue -
452 mean ) ) / ( (
double)validPixelsNumber );
465 std::vector< te::gm::GTParameters::TiePoint >() );
469 cachedInputRasterPtr.reset();
475 progressPtr->pulse();
476 if( ! progressPtr->isActive() )
return false;
502 prevRasterMosaicLastCol - prevRasterMosaicFirstCol + 1 );
504 prevRasterMosaicLastRow - prevRasterMosaicFirstRow + 1 );
524 if( mosaicRasterHandler->getSRID() == inputRasterPtr->
getSRID() )
535 mosaicRasterHandler->getSRID() );
540 ( inputRasterExtent.getHeight() / ((double)inputRasterPtr->
getNumberOfRows()) );
551 locatorInParams ),
"Tie points locator init error" );
552 if( ! locatorInstance.
execute( locatorOutParams ) )
554 locatorInParams.
reset();
595 boost::lexical_cast< std::string >( outParamsPtr->
m_sequencesInfo.size() ) +
602 assert( mosaicRasterHandler.get() );
605 *( mosaicRasterHandler.get() ), outParamsPtr->
m_outputDSPtr ),
606 "Data set creation error" );
607 mosaicRasterHandler.reset();
609 currentMosaicSquenceInfo.
clear();
615 std::vector< double > currentRasterBandsOffsets = dummyRasterOffsets;
616 std::vector< double > currentRasterBandsScales = dummyRasterScales;
620 double currentRasterVariance = 0;
621 double currentRasterMean = 0;
623 for(
unsigned int inputRastersBandsIdx = 0 ; inputRastersBandsIdx <
625 ++inputRastersBandsIdx )
628 inputRastersBandsIdx ];
631 ( mosaicTargetMeans[ inputRastersBandsIdx ] != 0.0 )
633 ( mosaicTargetVariances[ inputRastersBandsIdx ] != 0.0 )
640 currentRasterVariance );
642 currentRasterBandsScales[ inputRastersBandsIdx ] =
644 std::sqrt( mosaicTargetVariances[ inputRastersBandsIdx ] )
646 std::sqrt( currentRasterVariance )
648 currentRasterBandsOffsets[ inputRastersBandsIdx ] =
650 mosaicTargetMeans[ inputRastersBandsIdx ]
653 currentRasterBandsScales[ inputRastersBandsIdx ]
673 *inputRasterPtr->
getGrid(), inRasterIndexedDetailedExtent ),
674 "Error creating the raster detailed extent" );
680 std::unique_ptr< te::gm::GeometricTransformation > geoTransPtr(
686 double mappedLRX = std::numeric_limits< double >::min();
687 double mappedLRY = std::numeric_limits< double >::min();
688 double mappedULX = std::numeric_limits< double >::max();
689 double mappedULY = std::numeric_limits< double >::max();
692 for(
unsigned int inRasterDetExtentIdx = 0 ; inRasterDetExtentIdx <
693 inRasterIndexedDetailedExtent.
size() ; ++inRasterDetExtentIdx )
696 inRasterIndexedDetailedExtent.
getX( inRasterDetExtentIdx ),
697 inRasterIndexedDetailedExtent.
getY( inRasterDetExtentIdx ),
701 if( mappedLRX < mappedX ) mappedLRX = mappedX;
702 if( mappedLRY < mappedY ) mappedLRY = mappedY;
703 if( mappedULX > mappedX ) mappedULX = mappedX;
704 if( mappedULY > mappedY ) mappedULY = mappedY;
709 double oldMosaicReferenceX = 0;
710 double oldMosaicReferenceY = 0;
711 mosaicRasterHandler->getGrid()->gridToGeo( 0.0, 0.0, oldMosaicReferenceX,
712 oldMosaicReferenceY );
716 double mosaicReferenceHasChanged =
false;
718 if( mappedULX < 0.0 )
721 (
unsigned int)std::ceil( -1.0 * mappedULX ) ),
722 "Mosaic expansion error" );
723 mosaicReferenceHasChanged =
true;
726 if( mappedULY < 0.0 )
729 (
unsigned int)std::ceil( -1.0 * mappedULY ) ),
730 "Mosaic expansion error" );
731 mosaicReferenceHasChanged =
true;
734 if( mappedLRX > ((
double)(mosaicRasterHandler->getNumberOfColumns() - 1) ) )
737 (
unsigned int)std::ceil( mappedLRX -
738 ((
double)(mosaicRasterHandler->getNumberOfColumns() - 1)) ) ),
739 "Mosaic expansion error" );
742 if( mappedLRY > ((
double)(mosaicRasterHandler->getNumberOfRows() - 1) ) )
745 (
unsigned int)std::ceil( mappedLRY -
746 ((
double)(mosaicRasterHandler->getNumberOfRows() - 1) ) ) ),
747 "Mosaic expansion error" );
752 if( mosaicReferenceHasChanged )
754 double expansionOffSetX = 0;
755 double expansionOffSetY = 0;
756 mosaicRasterHandler->getGrid()->geoToGrid( oldMosaicReferenceX,
757 oldMosaicReferenceY, expansionOffSetX, expansionOffSetY );
761 geoTransPtr->getParameters().m_tiePoints;
763 for(
unsigned int tpIdx = 0 ; tpIdx <
766 newTransParams.
m_tiePoints[ tpIdx ].first.x += expansionOffSetX;
767 newTransParams.
m_tiePoints[ tpIdx ].first.y += expansionOffSetY;
771 "Geometric transformation parameters calcule error" );
781 *( mosaicRasterHandler.get() ),
782 dummyRasterBandsIndexes,
793 currentRasterBandsOffsets,
794 currentRasterBandsScales,
795 &mosaicValidAreaPols,
800 "Blender initiazing error" );
803 "Error blending images" );
816 for(
unsigned int inRasterDetExtentIdx = 0 ; inRasterDetExtentIdx <
817 inRasterIndexedDetailedExtent.
size() ; ++inRasterDetExtentIdx )
820 inRasterIndexedDetailedExtent.
getX( inRasterDetExtentIdx ),
821 inRasterIndexedDetailedExtent.
getY( inRasterDetExtentIdx ),
825 inRasterDetailedExtent.setPoint( inRasterDetExtentIdx, mappedX, mappedY );
832 prevRasterMosaicLastCol = 0;
833 prevRasterMosaicLastRow = 0;
834 prevRasterMosaicFirstCol = std::numeric_limits< unsigned int >::max();
835 prevRasterMosaicFirstRow = std::numeric_limits< unsigned int >::max();
839 for(
unsigned int inRasterDetExtentIdx = 0 ; inRasterDetExtentIdx <
840 inRasterDetailedExtent.size() ; ++inRasterDetExtentIdx )
842 geoTransPtr->inverseMap(
843 inRasterDetailedExtent.getX( inRasterDetExtentIdx ),
844 inRasterDetailedExtent.getY( inRasterDetExtentIdx ),
848 mappedX = std::max( mappedX, 0.0 );
849 mappedX = std::min( mappedX,
850 (
double)( mosaicRasterHandler->getNumberOfColumns() - 1 ) );
852 mappedY = std::max( mappedY, 0.0 );
853 mappedY = std::min( mappedY,
854 (
double)( mosaicRasterHandler->getNumberOfRows() - 1 ) );
856 if (prevRasterMosaicLastCol < static_cast<unsigned int>(mappedX)) prevRasterMosaicLastCol =
static_cast<unsigned int>(mappedX);
857 if (prevRasterMosaicLastRow < static_cast<unsigned int>(mappedY)) prevRasterMosaicLastRow = static_cast<unsigned int>(mappedY);
858 if (prevRasterMosaicFirstCol > static_cast<unsigned int>(mappedX)) prevRasterMosaicFirstCol = static_cast<unsigned int>(mappedX);
859 if (prevRasterMosaicFirstRow > static_cast<unsigned int>(mappedY)) prevRasterMosaicFirstRow = static_cast<unsigned int>(mappedY);
870 inRasterDetailedExtent ) );
871 lastMosaicAddedRasterPol.
setSRID( mosaicRasterHandler->getSRID() );
875 std::unique_ptr< te::gm::Geometry > unionMultiPolPtr(
876 mosaicValidAreaPols.
Union( &lastMosaicAddedRasterPol ) );
878 unionMultiPolPtr->setSRID( mosaicRasterHandler->getSRID() );
902 mosaicValidAreaPols.
clear();
903 mosaicValidAreaPols.
setSRID( unionMultiPolPtr->getSRID() );
914 cachedInputRasterPtr.reset();
920 progressPtr->pulse();
921 if( ! progressPtr->isActive() )
return false;
927 if( mosaicRasterHandler.get() )
932 boost::lexical_cast< std::string >( outParamsPtr->
m_sequencesInfo.size() ) +
939 *( mosaicRasterHandler.get() ), outParamsPtr->
m_outputDSPtr ),
940 "Data set creation error" );
942 currentMosaicSquenceInfo.
clear();
957 throw( te::rp::Exception )
970 "Invalid m_feederRasterPtr" )
974 "Invalid number of rasters" )
985 for( std::vector< std::vector< unsigned int > >::size_type
986 inputRastersBandsIdx = 0 ; inputRastersBandsIdx <
990 !=
nullptr,
"Invalid raster" )
993 inputRastersBandsIdx ].size() > 0,
"Invalid bands number" );
997 0 ].size(),
"Bands number mismatch" );
999 for( std::vector< unsigned int >::size_type currRasterBandidx = 0 ;
1001 inputRastersBandsIdx ].size() ; ++currRasterBandidx )
1004 inputRastersBandsIdx ][ currRasterBandidx ] <
1006 "Invalid band index" );
1010 "Invalid parameter m_tiePointsLocationBandIndex" );
1019 "Invalid parameter m_minRequiredTiePointsCoveredAreaPercent" );
1032 const bool& forceNoDataValue,
1033 const double& noDataValue,
1034 double& mean,
double& variance )
1039 double internalNoDataValue = 0;
1040 if( forceNoDataValue )
1041 internalNoDataValue = noDataValue;
1050 double pixelsNumber = 0;
1052 unsigned int col = 0;
1053 unsigned int line = 0;
1056 for( col = 0 ; col <
nCols ; ++
col )
1060 if( value != internalNoDataValue )
1067 if( pixelsNumber != 0.0 )
1069 mean /= pixelsNumber;
1072 for( col = 0 ; col <
nCols ; ++
col )
1076 if( value != internalNoDataValue )
1078 variance += ( ( value - mean ) * ( value - mean ) ) / pixelsNumber;
1088 if( dataSetName.empty() )
return false;
1090 if( dataSourcePtr ==
nullptr )
return false;
1091 if( ! dataSourcePtr->
isValid() )
return false;
1095 const unsigned int nBands =
static_cast<unsigned int>(sourceRaster.
getNumberOfBands());
1097 std::vector< te::rst::BandProperty* > bandsProperties;
1098 unsigned int bandIdx = 0;
1099 for( bandIdx = 0 ; bandIdx < nBands ; ++bandIdx )
1107 bandsProperties, dataSetName, *dataSourcePtr, outRasterHandler) )
1110 unsigned int col = 0;
1111 unsigned int row = 0;
1114 for( bandIdx = 0 ; bandIdx < nBands ; ++bandIdx )
1119 for( row = 0 ; row < nRows ; ++row )
1121 for( col = 0 ; col <
nCols ; ++
col )
1123 inBand.
getValue( col, row, value );
1124 outBand.
setValue( col, row, value );
1135 std::map<std::string, std::string> rInfo;
1136 rInfo[
"URI"] = fileName;
1138 const unsigned int nBands =
static_cast<unsigned int>(sourceRaster.
getNumberOfBands());
1140 std::vector<te::rst::BandProperty*> bandsProperties;
1141 unsigned int bandIdx = 0;
1142 for( bandIdx = 0 ; bandIdx < nBands ; ++bandIdx )
1148 std::unique_ptr< te::rst::Raster > outputRasterPtr(
1150 if( outputRasterPtr.get() == nullptr )
return false;
1152 unsigned int line = 0;
1153 unsigned int col = 0;
1159 for( bandIdx = 0 ; bandIdx < nBands ; ++bandIdx )
1162 te::rst::Band& outBand = *outputRasterPtr->getBand( bandIdx );
1165 for( col = 0 ; col <
nCols ; ++
col )
1167 inBand.
getValue( col, line, value );
1168 outBand.
setValue( col, line, value );
void add(Curve *ring)
It adds the ring to the curve polygon.
virtual bool isValid() const =0
It checks if the data source is valid (available for using).
void push_back(Curve *ring)
It adds the curve to the curve polygon.
bool createDiskRasterCopy(const std::string &fileName, const te::rst::Raster &sourceRaster) const
Create copy of the given raster into a disk file.
MultiPolygon is a MultiSurface whose elements are Polygons.
Near neighborhood interpolation method.
std::vector< te::gm::GTParameters::TiePoint > m_tiePoints
The generated tie-points (te::gm::GTParameters::TiePoint::first are raster 1 line/column indexes...
std::vector< TiePoint > m_tiePoints
Tie points.
TERASTEREXPORT void GetDataTypeRanges(const int &dataType, double &min, double &max)
Return the values range of a given data type.
Index into a lookup table.
bool execute(AlgorithmOutputParameters &outputParams)
Executes the algorithm using the supplied parameters.
void setSRID(int srid)
It sets the Spatial Reference System ID of the geometry and all its parts if it is a GeometryCollecti...
Mosaic output parameters.
A raster band description.
Blended pixel value calculation for two overlaped rasters.
Base exception class for plugin module.
unsigned int getNumberOfColumns() const
Returns the raster number of columns.
int m_nblocksx
The number of blocks in x.
double GetTPConvexHullArea(const ContainerT &tiePoints, const bool useTPSecondCoordPair)
Returns the tie points converx hull area.
static void calcBandStatistics(const te::rst::Band &band, const bool &forceNoDataValue, const double &noDataValue, double &mean, double &variance)
Raster band statistics calcule.
int m_nblocksy
The number of blocks in y.
std::vector< std::vector< te::gm::GTParameters::TiePoint > > m_tiePoints
The generated tie-pionts (te::gm::GTParameters::TiePoint::first are mosaic coods, te::gm::GTParameter...
#define TERP_LOGWARN(message)
Logs a warning message.
This class can be used to inform the progress of a task.
Raster Processing algorithm output parameters base interface.
An utility struct for representing 2D coordinates.
An abstract class for data providers like a DBMS, Web Services or a regular file. ...
double m_noDataValue
Value to indicate elements where there is no data, default is std::numeric_limits<double>::max().
const double & getUpperRightY() const
It returns a constant refernce to the x coordinate of the upper right corner.
virtual te::rst::Raster const * getCurrentObj() const =0
Return the current sequence object.
virtual Geometry * Union(const Geometry *const rhs) const _NOEXCEPT_OP(false)
It returns a geometric object that represents the point set union with another geometry.
bool execute(AlgorithmOutputParameters &outputParams)
Executes the algorithm using the supplied parameters.
std::vector< MosaicSequenceInfo > m_sequencesInfo
const double & getY(std::size_t i) const
It returns the n-th y coordinate value.
bool blendIntoRaster1()
Execute blending of the given input rasters and write the result into raster1.
double getResolutionY() const
Returns the grid vertical (y-axis) resolution.
std::unique_ptr< te::gm::GeometricTransformation > m_transformationPtr
The generated geometric transformation with the base mininum required tie-points set ( depending on t...
te::common::AccessPolicy getAccessPolicy() const
Returns the raster access policy.
unsigned int unsigned int nCols
A LinearRing is a LineString that is both closed and simple.
TECOMMONEXPORT unsigned int GetPhysProcNumber()
Returns the number of physical processors.
void setPoint(std::size_t i, const double &x, const double &y)
It sets the value of the specified point.
virtual void reset()=0
Reset the feeder to the first position (subsequent accesses will start from the first sequence obejct...
An Envelope defines a 2D rectangular region.
An abstract class for raster data strucutures.
void clear()
It deletes all the elements of the collection.
unsigned int getNumberOfRows() const
Returns the raster number of rows.
virtual std::size_t getNumberOfBands() const =0
Returns the number of bands (dimension of cells attribute values) in the raster.
const double & getX(std::size_t i) const
It returns the n-th x coordinate value.
BandProperty * getProperty()
Returns the band property.
int m_blkw
Block width (pixels).
SequenceMosaic::InputParameters m_inputParameters
Input execution parameters.
const OutputParameters & operator=(const OutputParameters ¶ms)
Create mosaics from a sequence of overlapped rasters using an automatic tie-points detection method...
double getResolutionX() const
Returns the raster horizontal (x-axis) resolution.
double getResolutionX() const
Returns the grid horizontal (x-axis) resolution.
A RAM cache adaptor to an external existent raster that must always be avaliable. ...
std::vector< unsigned int > m_rasterFeederIndexes
The indexes (inside the input rasters feeder) of the rasters written to this mosaic sequence...
A raster band description.
virtual const Band * getBand(std::size_t i) const =0
Returns the raster i-th band.
Grid * getGrid()
It returns the raster grid.
#define SEQUENCE_RASTER_MAX_MOSAIC_MEM_USE
TiePointsLocator output parameters.
bool initialize(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 forceRaster1NoDataValue, const bool forceRaster2NoDataValue, const std::vector< double > &pixelOffsets1, const std::vector< double > &pixelScales1, const std::vector< double > &pixelOffsets2, const std::vector< double > &pixelScales2, te::gm::MultiPolygon const *const r1ValidDataDelimiterPtr, te::gm::MultiPolygon const *const r2ValidDataDelimiterPtr, const te::gm::GeometricTransformation &geomTransformation, const unsigned int threadsNumber, const bool enableProgressInterface)
Inititate the blender instance.
virtual void setValue(unsigned int c, unsigned int r, const double value)=0
Sets the cell attribute value.
bool 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.
Abstract parameters base interface.
int getSRID() const
Returns the raster spatial reference system identifier.
Polygon is a subclass of CurvePolygon whose rings are defined by linear rings.
void setSRID(int srid)
It sets the Spatial Reference System ID of the geometry collection and all its parts.
A raster (stored in memory and eventually swapped to disk) where it is possible to dynamically add li...
std::string m_dataSetName
The generated data set name for this mosaic sequence.
void add(Geometry *g)
It adds the geometry into the collection.
bool m_isInitialized
Tells if this instance is initialized.
static Raster * make()
It creates and returns an empty raster with default raster driver.
const double & getLowerLeftX() const
It returns a constant reference to the x coordinate of the lower left corner.
bool GetIndexedDetailedExtent(const te::rst::Grid &grid, te::gm::LinearRing &indexedDetailedExtent)
Create a indexed (lines,columns) datailed extent from the given grid.
void reset()
Clear all internal allocated objects and reset the algorithm to its initial state.
te::gm::Envelope * getExtent()
Returns the geographic extension of the grid.
void setSRID(int srid)
It sets the Spatial Reference System ID of the linestring.
double getResolutionY() const
Returns the raster vertical (y-axis) resolution.
te::rst::Raster * getRasterPtr()
Returns a pointer the the handled raster instance or NULL if no instance is handled.
2D Geometric transformation parameters.
Raster Processing functions.
virtual bool moveNext()=0
Advances to the next sequence obeject.
int m_blkh
Block height (pixels).
virtual void reset() _NOEXCEPT_OP(false)
Clear all internal allocated objects and reset the algorithm to its initial state.
A rectified grid is the spatial support for raster data.
ColorInterp m_colorInterp
The color interpretation.
bool isInitialized() const
Returns true if the algorithm instance is initialized and ready for execution.
void transform(int oldsrid, int newsrid)
It will transform the coordinates of the Envelope from the old SRS to the new one.
#define TERP_INSTANCE_TRUE_OR_RETURN_FALSE(value, message)
Checks if value is true. For false values a warning message will be logged, the current instance erro...
void clear()
Clear the internal allocated resources.
#define TERP_TRUE_OR_THROW(value, message)
Checks if value is true and throws an exception if not.
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...
std::size_t size() const
It returns the number of points (vertexes) in the geometry.
virtual void getValue(unsigned int c, unsigned int r, double &value) const =0
Returns the cell attribute value.
virtual unsigned int getCurrentOffset() const =0
Return the index of the current object.
AbstractParameters * clone() const
Create a clone copy of this instance.
virtual unsigned int getObjsCount() const =0
Return the total number of feeder objects.
bool initialize(const AlgorithmInputParameters &inputParams)
Initialize the algorithm instance making it ready for execution.
bool createRasterDataSet(const std::string &dataSetName, const te::rst::Raster &sourceRaster, te::da::DataSource *dataSourcePtr) const
Create a raster data set from the given raster.
te::da::DataSource * m_outputDSPtr
The mosaic sequences info.