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
76 m_feederRasterPtr = 0;
77 m_inputRastersBands.clear();
78 m_geomTransfName =
"Affine";
81 m_forceInputNoDataValue =
false;
83 m_autoEqualize =
true;
84 m_useRasterCache =
true;
85 m_enableMultiThread =
true;
86 m_enableProgress =
false;
87 m_tiePointsLocationBandIndex = 0;
88 m_outDataSetsNamePrefix.clear();
89 m_outDataSetsNameSufix.clear();
90 m_minRequiredTiePointsCoveredAreaPercent = 25.0;
91 m_locatorParams.reset();
113 m_minRequiredTiePointsCoveredAreaPercent =
146 m_sequencesInfo.clear();
177 m_dataSetName.clear();
178 m_rasterFeederIndexes.clear();
194 throw( te::rp::Exception )
203 "Invalid data source" );
205 "Invalid data source" );
211 std::auto_ptr< te::common::TaskProgress > progressPtr;
218 progressPtr->setMessage(
"Mosaicking" );
226 std::vector< unsigned int > dummyRasterBandsIndexes;
228 for(
unsigned int bandIdx = 0 ; bandIdx <
230 dummyRasterBandsIndexes.push_back( bandIdx );
233 std::auto_ptr< te::mem::ExpansibleRaster > mosaicRasterHandler;
234 std::vector< double > mosaicTargetMeans;
235 std::vector< double > mosaicTargetVariances;
237 std::vector< double > mosaicBandsRangeMin;
238 std::vector< double > mosaicBandsRangeMax;
239 unsigned int prevRasterMosaicFirstCol = 0;
240 unsigned int prevRasterMosaicFirstRow = 0;
241 unsigned int prevRasterMosaicLastCol = 0;
242 unsigned int prevRasterMosaicLastRow = 0;
248 const unsigned int inputRasterIdx =
254 std::auto_ptr< te::mem::CachedRaster > cachedInputRasterPtr;
260 inputRasterPtr = cachedInputRasterPtr.get();
277 if( mosaicRasterHandler.get() == 0 )
281 unsigned int mosaicNBlocksX = 4;
282 unsigned int mosaicNBlocksY = 4;
287 if( ( mosaicNBlocksX * mosaicNBlocksY ) < nProc )
289 mosaicNBlocksX = mosaicNBlocksY = (
unsigned int)std::ceil(
290 std::sqrt( (
double)nProc ) );
294 unsigned int mosaicBlockW = (
unsigned int)std::ceil( ((
double) inputRasterPtr->
getNumberOfColumns())
295 / ((
double)mosaicNBlocksX) );
296 unsigned int mosaicBlockH = (
unsigned int)std::ceil( ((
double)inputRasterPtr->
getNumberOfRows())
297 / ((
double)mosaicNBlocksY ) );
299 unsigned int mosaicNCols = mosaicBlockW * mosaicNBlocksX;
300 unsigned int mosaicNRows = mosaicBlockH * mosaicNBlocksY;
304 std::vector< te::rst::BandProperty* > bandsProperties;
306 for( std::vector< unsigned int >::size_type inputRastersBandsIdx = 0 ;
308 ++inputRastersBandsIdx )
312 inputRasterIdx ][ inputRastersBandsIdx ] )->
getProperty();
317 bandsProperties[ inputRastersBandsIdx ]->m_blkw = mosaicBlockW;
318 bandsProperties[ inputRastersBandsIdx ]->m_blkh = mosaicBlockH;
319 bandsProperties[ inputRastersBandsIdx ]->m_nblocksx = mosaicNBlocksX;
320 bandsProperties[ inputRastersBandsIdx ]->m_nblocksy = mosaicNBlocksY;
334 mosaicRasterHandler.reset(
339 "Output raster creation error" );
343 mosaicBandsRangeMin.resize(
344 mosaicRasterHandler->getNumberOfBands(), 0 );
345 mosaicBandsRangeMax.resize(
346 mosaicRasterHandler->getNumberOfBands(), 0 );
347 for(
unsigned int mosaicBandidx = 0 ; mosaicBandidx <
348 mosaicRasterHandler->getNumberOfBands() ; ++mosaicBandidx )
351 mosaicRasterHandler->getBand( mosaicBandidx )->getProperty()->m_type,
352 mosaicBandsRangeMin[ mosaicBandidx ],
353 mosaicBandsRangeMax[ mosaicBandidx ]);
356 prevRasterMosaicFirstCol = 0;
359 prevRasterMosaicFirstRow = 0;
361 const double& mosaicLLX = mosaicRasterHandler->getGrid()->getExtent()->m_llx;
362 const double& mosaicLLY = mosaicRasterHandler->getGrid()->getExtent()->m_lly;
363 const double& mosaicURX = mosaicRasterHandler->getGrid()->getExtent()->m_urx;
364 const double& mosaicURY = mosaicRasterHandler->getGrid()->getExtent()->m_ury;
367 auxLinearRingPtr->
setPoint( 0, mosaicLLX, mosaicURY );
368 auxLinearRingPtr->
setPoint( 1, mosaicURX, mosaicURY );
369 auxLinearRingPtr->
setPoint( 2, mosaicURX, mosaicLLY );
370 auxLinearRingPtr->
setPoint( 3, mosaicLLX, mosaicLLY );
371 auxLinearRingPtr->
setPoint( 4, mosaicLLX, mosaicURY );
372 auxLinearRingPtr->
setSRID( mosaicRasterHandler->getGrid()->getSRID() );
375 mosaicRasterHandler->getGrid()->getSRID(), 0 );
376 outPolPtr->
add( auxLinearRingPtr );
378 mosaicValidAreaPols.
clear();
379 mosaicValidAreaPols.
add( outPolPtr );
380 mosaicValidAreaPols.
setSRID( mosaicRasterHandler->getGrid()->getSRID() );
385 const unsigned int nBands = mosaicRasterHandler->getNumberOfBands();
386 const unsigned int inputRasterNRows = inputRasterPtr->
getNumberOfRows();
388 const unsigned int mosaicNRows = mosaicRasterHandler->getNumberOfRows();
389 const unsigned int mosaicNCols = mosaicRasterHandler->getNumberOfColumns();
390 unsigned int validPixelsNumber = 0;
391 unsigned int outCol = 0;
392 unsigned int outRow = 0;
393 double pixelValue = 0;
395 mosaicTargetMeans.resize( nBands, 0.0 );
396 mosaicTargetVariances.resize( nBands, 0.0 );
398 for(
unsigned int inputRastersBandsIdx = 0 ; inputRastersBandsIdx <
399 nBands ; ++inputRastersBandsIdx )
401 const unsigned int inputBandIdx =
404 (*mosaicRasterHandler->getBand( inputRastersBandsIdx ));
406 (*inputRasterPtr->
getBand( inputBandIdx ));
412 double& mean = mosaicTargetMeans[ inputRastersBandsIdx ];
415 for( outRow = 0 ; outRow < mosaicNRows ; ++outRow )
417 for( outCol = 0 ; outCol < mosaicNCols ; ++outCol )
419 if( ( outRow < inputRasterNRows ) && ( outCol < inputRasterNCols ) )
421 inBand.
getValue( outCol, outRow, pixelValue );
423 if( pixelValue != inputBandNoDataValue )
425 outBand.
setValue( outCol, outRow, pixelValue );
433 outBand.
setValue( outCol, outRow, outputBandNoDataValue );
438 mean /= ( (double)validPixelsNumber );
444 double& variance = mosaicTargetVariances[ inputRastersBandsIdx ];
447 double pixelValue = 0;
449 for( outRow = 0 ; outRow < inputRasterNRows ; ++outRow )
451 for( outCol = 0 ; outCol < inputRasterNCols ; ++outCol )
453 outBand.
getValue( outCol, outRow, pixelValue );
455 if( pixelValue != inputBandNoDataValue )
457 variance += ( ( pixelValue - mean ) * ( pixelValue -
458 mean ) ) / ( (
double)validPixelsNumber );
471 std::vector< te::gm::GTParameters::TiePoint >() );
475 cachedInputRasterPtr.reset();
481 progressPtr->pulse();
482 if( ! progressPtr->isActive() )
return false;
508 prevRasterMosaicLastCol - prevRasterMosaicFirstCol + 1 );
510 prevRasterMosaicLastRow - prevRasterMosaicFirstRow + 1 );
530 if( mosaicRasterHandler->getSRID() == inputRasterPtr->
getSRID() )
541 mosaicRasterHandler->getSRID() );
546 ( inputRasterExtent.getHeight() / ((double)inputRasterPtr->
getNumberOfRows()) );
557 locatorInParams ),
"Tie points locator init error" );
558 if( ! locatorInstance.
execute( locatorOutParams ) )
560 locatorInParams.
reset();
601 boost::lexical_cast< std::string >( outParamsPtr->
m_sequencesInfo.size() ) +
608 assert( mosaicRasterHandler.get() );
611 *( mosaicRasterHandler.get() ), outParamsPtr->
m_outputDSPtr ),
612 "Data set creation error" );
613 mosaicRasterHandler.reset();
615 currentMosaicSquenceInfo.
clear();
621 std::vector< double > currentRasterBandsOffsets;
622 std::vector< double > currentRasterBandsScales;
626 double currentRasterVariance = 0;
627 double currentRasterMean = 0;
629 for(
unsigned int inputRastersBandsIdx = 0 ; inputRastersBandsIdx <
631 ++inputRastersBandsIdx )
634 inputRastersBandsIdx ];
640 currentRasterVariance );
642 currentRasterBandsScales.push_back(
643 std::sqrt( mosaicTargetVariances[ inputRastersBandsIdx ] )
645 std::sqrt( currentRasterVariance ) );
646 currentRasterBandsOffsets.push_back( mosaicTargetMeans[ inputRastersBandsIdx ]
647 - ( currentRasterBandsScales[ inputRastersBandsIdx ] * currentRasterMean ) );
652 currentRasterBandsOffsets = dummyRasterOffsets;
653 currentRasterBandsScales = dummyRasterScales;
667 *inputRasterPtr->
getGrid(), inRasterIndexedDetailedExtent ),
668 "Error creating the raster detailed extent" );
674 std::auto_ptr< te::gm::GeometricTransformation > geoTransPtr(
680 double mappedLRX = std::numeric_limits< double >::min();
681 double mappedLRY = std::numeric_limits< double >::min();
682 double mappedULX = std::numeric_limits< double >::max();
683 double mappedULY = std::numeric_limits< double >::max();
686 for(
unsigned int inRasterDetExtentIdx = 0 ; inRasterDetExtentIdx <
687 inRasterIndexedDetailedExtent.
size() ; ++inRasterDetExtentIdx )
690 inRasterIndexedDetailedExtent.
getX( inRasterDetExtentIdx ),
691 inRasterIndexedDetailedExtent.
getY( inRasterDetExtentIdx ),
695 if( mappedLRX < mappedX ) mappedLRX = mappedX;
696 if( mappedLRY < mappedY ) mappedLRY = mappedY;
697 if( mappedULX > mappedX ) mappedULX = mappedX;
698 if( mappedULY > mappedY ) mappedULY = mappedY;
703 double oldMosaicReferenceX = 0;
704 double oldMosaicReferenceY = 0;
705 mosaicRasterHandler->getGrid()->gridToGeo( 0.0, 0.0, oldMosaicReferenceX,
706 oldMosaicReferenceY );
710 double mosaicReferenceHasChanged =
false;
712 if( mappedULX < 0.0 )
715 (
unsigned int)std::ceil( -1.0 * mappedULX ) ),
716 "Mosaic expansion error" );
717 mosaicReferenceHasChanged =
true;
720 if( mappedULY < 0.0 )
723 (
unsigned int)std::ceil( -1.0 * mappedULY ) ),
724 "Mosaic expansion error" );
725 mosaicReferenceHasChanged =
true;
728 if( mappedLRX > ((
double)(mosaicRasterHandler->getNumberOfColumns() - 1) ) )
731 (
unsigned int)std::ceil( mappedLRX -
732 ((
double)(mosaicRasterHandler->getNumberOfColumns() - 1)) ) ),
733 "Mosaic expansion error" );
736 if( mappedLRY > ((
double)(mosaicRasterHandler->getNumberOfRows() - 1) ) )
739 (
unsigned int)std::ceil( mappedLRY -
740 ((
double)(mosaicRasterHandler->getNumberOfRows() - 1) ) ) ),
741 "Mosaic expansion error" );
746 if( mosaicReferenceHasChanged )
748 double expansionOffSetX = 0;
749 double expansionOffSetY = 0;
750 mosaicRasterHandler->getGrid()->geoToGrid( oldMosaicReferenceX,
751 oldMosaicReferenceY, expansionOffSetX, expansionOffSetY );
755 geoTransPtr->getParameters().m_tiePoints;
757 for(
unsigned int tpIdx = 0 ; tpIdx <
760 newTransParams.
m_tiePoints[ tpIdx ].first.x += expansionOffSetX;
761 newTransParams.
m_tiePoints[ tpIdx ].first.y += expansionOffSetY;
765 "Geometric transformation parameters calcule error" );
775 *( mosaicRasterHandler.get() ),
776 dummyRasterBandsIndexes,
787 currentRasterBandsOffsets,
788 currentRasterBandsScales,
789 &mosaicValidAreaPols,
794 "Blender initiazing error" );
797 "Error blending images" );
810 for(
unsigned int inRasterDetExtentIdx = 0 ; inRasterDetExtentIdx <
811 inRasterIndexedDetailedExtent.
size() ; ++inRasterDetExtentIdx )
814 inRasterIndexedDetailedExtent.
getX( inRasterDetExtentIdx ),
815 inRasterIndexedDetailedExtent.
getY( inRasterDetExtentIdx ),
819 inRasterDetailedExtent.
setPoint( inRasterDetExtentIdx, mappedX, mappedY );
826 prevRasterMosaicLastCol = 0;
827 prevRasterMosaicLastRow = 0;
828 prevRasterMosaicFirstCol = std::numeric_limits< unsigned int >::max();
829 prevRasterMosaicFirstRow = std::numeric_limits< unsigned int >::max();
833 for(
unsigned int inRasterDetExtentIdx = 0 ; inRasterDetExtentIdx <
834 inRasterDetailedExtent.
size() ; ++inRasterDetExtentIdx )
836 geoTransPtr->inverseMap(
837 inRasterDetailedExtent.
getX( inRasterDetExtentIdx ),
838 inRasterDetailedExtent.
getY( inRasterDetExtentIdx ),
842 mappedX = std::max( mappedX, 0.0 );
843 mappedX = std::min( mappedX,
844 (
double)( mosaicRasterHandler->getNumberOfColumns() - 1 ) );
846 mappedY = std::max( mappedY, 0.0 );
847 mappedY = std::min( mappedY,
848 (
double)( mosaicRasterHandler->getNumberOfRows() - 1 ) );
850 if( prevRasterMosaicLastCol < mappedX ) prevRasterMosaicLastCol = mappedX;
851 if( prevRasterMosaicLastRow < mappedY ) prevRasterMosaicLastRow = mappedY;
852 if( prevRasterMosaicFirstCol > mappedX ) prevRasterMosaicFirstCol = mappedX;
853 if( prevRasterMosaicFirstRow > mappedY ) prevRasterMosaicFirstRow = mappedY;
864 inRasterDetailedExtent ) );
865 lastMosaicAddedRasterPol.
setSRID( mosaicRasterHandler->getSRID() );
869 std::auto_ptr< te::gm::Geometry > unionMultiPolPtr(
870 mosaicValidAreaPols.
Union( &lastMosaicAddedRasterPol ) );
872 unionMultiPolPtr->setSRID( mosaicRasterHandler->getSRID() );
880 mosaicValidAreaPols.
clear();
881 mosaicValidAreaPols.
setSRID( unionMultiPolPtr->getSRID() );
892 cachedInputRasterPtr.reset();
898 progressPtr->pulse();
899 if( ! progressPtr->isActive() )
return false;
905 if( mosaicRasterHandler.get() )
910 boost::lexical_cast< std::string >( outParamsPtr->
m_sequencesInfo.size() ) +
917 *( mosaicRasterHandler.get() ), outParamsPtr->
m_outputDSPtr ),
918 "Data set creation error" );
920 currentMosaicSquenceInfo.
clear();
933 throw( te::rp::Exception )
946 "Invalid m_feederRasterPtr" )
950 "Invalid number of rasters" )
961 for( std::vector< std::vector< unsigned int > >::size_type
962 inputRastersBandsIdx = 0 ; inputRastersBandsIdx <
966 != 0,
"Invalid raster" )
969 inputRastersBandsIdx ].size() > 0,
"Invalid bands number" );
973 0 ].size(),
"Bands number mismatch" );
975 for( std::vector< unsigned int >::size_type currRasterBandidx = 0 ;
977 inputRastersBandsIdx ].size() ; ++currRasterBandidx )
980 inputRastersBandsIdx ][ currRasterBandidx ] <
982 "Invalid band index" );
986 "Invalid parameter m_tiePointsLocationBandIndex" );
995 "Invalid parameter m_minRequiredTiePointsCoveredAreaPercent" );
1008 const bool& forceNoDataValue,
1009 const double& noDataValue,
1010 double& mean,
double& variance )
1015 double internalNoDataValue = 0;
1016 if( forceNoDataValue )
1017 internalNoDataValue = noDataValue;
1026 double pixelsNumber = 0;
1028 unsigned int col = 0;
1029 unsigned int line = 0;
1031 for( line = 0 ; line < nLines ; ++line )
1032 for( col = 0 ; col < nCols ; ++col )
1036 if( value != internalNoDataValue )
1043 if( pixelsNumber != 0.0 )
1045 mean /= pixelsNumber;
1047 for( line = 0 ; line < nLines ; ++line )
1048 for( col = 0 ; col < nCols ; ++col )
1052 if( value != internalNoDataValue )
1054 variance += ( ( value - mean ) * ( value - mean ) ) / pixelsNumber;
1064 if( dataSetName.empty() )
return false;
1066 if( dataSourcePtr == 0 )
return false;
1067 if( ! dataSourcePtr->
isValid() )
return false;
1073 std::vector< te::rst::BandProperty* > bandsProperties;
1074 unsigned int bandIdx = 0;
1075 for( bandIdx = 0 ; bandIdx < nBands ; ++bandIdx )
1083 bandsProperties, dataSetName, *dataSourcePtr, outRasterHandler) )
1086 unsigned int col = 0;
1087 unsigned int row = 0;
1090 for( bandIdx = 0 ; bandIdx < nBands ; ++bandIdx )
1095 for( row = 0 ; row < nRows ; ++row )
1097 for( col = 0 ; col < nCols ; ++col )
1099 inBand.
getValue( col, row, value );
1100 outBand.
setValue( col, row, value );
1111 std::map<std::string, std::string> rInfo;
1112 rInfo[
"URI"] = fileName;
1116 std::vector<te::rst::BandProperty*> bandsProperties;
1117 unsigned int bandIdx = 0;
1118 for( bandIdx = 0 ; bandIdx < nBands ; ++bandIdx )
1124 std::auto_ptr< te::rst::Raster > outputRasterPtr(
1126 if( outputRasterPtr.get() == 0 )
return false;
1128 unsigned int line = 0;
1129 unsigned int col = 0;
1135 for( bandIdx = 0 ; bandIdx < nBands ; ++bandIdx )
1138 te::rst::Band& outBand = *outputRasterPtr->getBand( bandIdx );
1140 for( line = 0 ; line < nLines ; ++line )
1141 for( col = 0 ; col < nCols ; ++col )
1143 inBand.
getValue( col, line, value );
1144 outBand.
setValue( col, line, value );
virtual unsigned int getObjsCount() const =0
Return the total number of feeder objects.
void add(Curve *ring)
It adds the ring to the curve polygon.
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.
virtual bool isValid() const =0
It checks if the data source is valid (available for using).
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.
virtual void getValue(unsigned int c, unsigned int r, double &value) const =0
Returns the cell attribute value.
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.
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.
virtual const Band * getBand(std::size_t i) const =0
Returns the raster i-th band.
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...
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::max().
const double & getUpperRightY() const
It returns a constant refernce to the x coordinate of the upper right corner.
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.
Raster Processing functions.
double getResolutionY() const
Returns the grid vertical (y-axis) resolution.
#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...
const Algorithm & operator=(const Algorithm &)
te::common::AccessPolicy getAccessPolicy() const
Returns the raster access policy.
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.
std::auto_ptr< te::gm::GeometricTransformation > m_transformationPtr
The generated geometric transformation with the base mininum required tie-points set ( depending on t...
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.
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).
virtual std::size_t getNumberOfBands() const =0
Returns the number of bands (dimension of cells attribute values) in the raster.
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.
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.
#define TERP_LOG_AND_RETURN_FALSE(message)
Logs a warning message will and return false.
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.
virtual bool moveNext()=0
Advances to the next sequence obeject.
int m_blkh
Block height (pixels).
virtual Geometry * Union(const Geometry *const rhs) const
It returns a geometric object that represents the point set union with another geometry.
virtual te::rst::Raster const * getCurrentObj() const =0
Return the current sequence object.
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.
void clear()
Clear the internal allocated resources.
virtual unsigned int getCurrentOffset() const =0
Return the index of the current object.
#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.
AbstractParameters * clone() const
Create a clone copy of this instance.
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.