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"
45 #include <boost/lexical_cast.hpp>
49 #define SEQUENCE_RASTER_MAX_MOSAIC_MEM_USE 10
74 m_feederRasterPtr = 0;
75 m_inputRastersBands.clear();
76 m_geomTransfName =
"Affine";
79 m_forceInputNoDataValue =
false;
81 m_autoEqualize =
true;
82 m_useRasterCache =
true;
83 m_enableMultiThread =
true;
84 m_enableProgress =
false;
85 m_tiePointsLocationBandIndex = 0;
86 m_outDataSetsNamePrefix.clear();
87 m_outDataSetsNameSufix.clear();
88 m_minRequiredTiePointsCoveredAreaPercent = 0.0;
89 m_locatorParams.reset();
111 m_minRequiredTiePointsCoveredAreaPercent =
144 m_sequencesInfo.clear();
175 m_dataSetName.clear();
176 m_rasterFeederIndexes.clear();
192 throw( te::rp::Exception )
201 "Invalid data source" );
203 "Invalid data source" );
209 std::auto_ptr< te::common::TaskProgress > progressPtr;
216 progressPtr->setMessage(
"Mosaicking" );
224 std::vector< unsigned int > dummyRasterBandsIndexes;
226 for(
unsigned int bandIdx = 0 ; bandIdx <
228 dummyRasterBandsIndexes.push_back( bandIdx );
231 std::auto_ptr< te::mem::ExpansibleRaster > mosaicRasterHandler;
232 std::vector< double > mosaicTargetMeans;
233 std::vector< double > mosaicTargetVariances;
235 std::vector< double > mosaicBandsRangeMin;
236 std::vector< double > mosaicBandsRangeMax;
237 unsigned int lastInputRasterBBoxLLXIndexed = 0;
238 unsigned int lastInputRasterBBoxLLYIndexed = 0;
239 unsigned int lastInputRasterBBoxURXIndexed = 0;
240 unsigned int lastInputRasterBBoxURYIndexed = 0;
246 const unsigned int inputRasterIdx =
252 std::auto_ptr< te::mem::CachedRaster > cachedInputRasterPtr;
258 inputRasterPtr = cachedInputRasterPtr.get();
275 if( mosaicRasterHandler.get() == 0 )
283 auxLinearRingPtr->
setPoint( 0, mosaicLLX, mosaicURY );
284 auxLinearRingPtr->
setPoint( 1, mosaicURX, mosaicURY );
285 auxLinearRingPtr->
setPoint( 2, mosaicURX, mosaicLLY );
286 auxLinearRingPtr->
setPoint( 3, mosaicLLX, mosaicLLY );
287 auxLinearRingPtr->
setPoint( 4, mosaicLLX, mosaicURY );
291 outPolPtr->
add( auxLinearRingPtr );
293 mosaicValidAreaPols.
clear();
294 mosaicValidAreaPols.
add( outPolPtr );
297 lastInputRasterBBoxLLXIndexed = 0;
300 lastInputRasterBBoxURYIndexed = 0;
302 mosaicBandsRangeMin.resize(
304 mosaicBandsRangeMax.resize(
307 std::vector< te::rst::BandProperty* > bandsProperties;
308 for( std::vector< unsigned int >::size_type inputRastersBandsIdx = 0 ;
309 inputRastersBandsIdx <
311 ++inputRastersBandsIdx )
315 inputRasterIdx ][ inputRastersBandsIdx ] )->
getProperty();
320 bandsProperties[ inputRastersBandsIdx ]->m_blkw = (
unsigned int)
322 bandsProperties[ inputRastersBandsIdx ]->m_blkh = (
unsigned int)
324 bandsProperties[ inputRastersBandsIdx ]->m_nblocksx = (
unsigned int)
326 ((
double)bandsProperties[ inputRastersBandsIdx ]->m_blkw ) );
327 bandsProperties[ inputRastersBandsIdx ]->m_nblocksy = (
unsigned int)
329 ((
double)bandsProperties[ inputRastersBandsIdx ]->m_blkh ) );
332 mosaicBandsRangeMin[ inputRastersBandsIdx ],
333 mosaicBandsRangeMax[ inputRastersBandsIdx ]);
336 mosaicRasterHandler.reset(
341 "Output raster creation error" );
343 const unsigned int nBands = mosaicRasterHandler->getNumberOfBands();
345 mosaicTargetMeans.resize( nBands, 0.0 );
346 mosaicTargetVariances.resize( nBands, 0.0 );
348 for(
unsigned int inputRastersBandsIdx = 0 ; inputRastersBandsIdx <
349 nBands ; ++inputRastersBandsIdx )
351 const unsigned int inputBandIdx =
359 (*mosaicRasterHandler->getBand( inputRastersBandsIdx ));
361 (*inputRasterPtr->
getBand( inputBandIdx ));
362 unsigned int validPixelsNumber = 0;
363 unsigned int outCol = 0;
364 unsigned int outRow = 0;
365 double pixelValue = 0;
367 double& mean = mosaicTargetMeans[ inputRastersBandsIdx ];
370 for( outRow = 0 ; outRow < outRowsBound ; ++outRow )
372 for( outCol = 0 ; outCol < outColsBound ; ++outCol )
374 inBand.
getValue( outCol, outRow, pixelValue );
376 if( pixelValue != bandNoDataValue )
378 outBand.
setValue( outCol, outRow, pixelValue );
387 mean /= ( (double)validPixelsNumber );
393 double& variance = mosaicTargetVariances[ inputRastersBandsIdx ];
396 double pixelValue = 0;
398 for( outRow = 0 ; outRow < outRowsBound ; ++outRow )
400 for( outCol = 0 ; outCol < outColsBound ; ++outCol )
402 outBand.
getValue( outCol, outRow, pixelValue );
404 if( pixelValue != bandNoDataValue )
406 variance += ( ( pixelValue - mean ) * ( pixelValue -
407 mean ) ) / ( (
double)validPixelsNumber );
419 std::vector< te::gm::GTParameters::TiePoint >() );
423 cachedInputRasterPtr.reset();
429 progressPtr->pulse();
430 if( ! progressPtr->isActive() )
return false;
456 lastInputRasterBBoxURXIndexed - lastInputRasterBBoxLLXIndexed + 1 );
458 lastInputRasterBBoxLLYIndexed - lastInputRasterBBoxURYIndexed + 1 );
491 locatorInParams ),
"Tie points locator init error" );
493 locatorOutParams ),
"Tie points locator exec error" );
533 boost::lexical_cast< std::string >( outParamsPtr->
m_sequencesInfo.size() ) +
540 assert( mosaicRasterHandler.get() );
543 *( mosaicRasterHandler.get() ), outParamsPtr->
m_outputDSPtr ),
544 "Data set creation error" );
545 mosaicRasterHandler.reset();
547 currentMosaicSquenceInfo.
clear();
553 std::vector< double > currentRasterBandsOffsets;
554 std::vector< double > currentRasterBandsScales;
558 double currentRasterVariance = 0;
559 double currentRasterMean = 0;
561 for(
unsigned int inputRastersBandsIdx = 0 ; inputRastersBandsIdx <
563 ++inputRastersBandsIdx )
566 inputRastersBandsIdx ];
572 currentRasterVariance );
574 currentRasterBandsScales.push_back( std::sqrt( mosaicTargetVariances[ inputRastersBandsIdx ] /
575 currentRasterVariance ) );
576 currentRasterBandsOffsets.push_back( mosaicTargetMeans[ inputRastersBandsIdx ] -
577 ( currentRasterBandsScales[ inputRastersBandsIdx ] * currentRasterMean ) );
582 currentRasterBandsOffsets = dummyRasterOffsets;
583 currentRasterBandsScales = dummyRasterScales;
597 std::auto_ptr< te::gm::GeometricTransformation > geoTransPtr(
601 const double oldLLYIndexed =
603 const double oldURXIndexed =
606 double mappedLLX = 0;
607 double mappedLLY = 0;
608 double mappedLRX = 0;
609 double mappedLRY = 0;
610 double mappedURX = 0;
611 double mappedURY = 0;
612 double mappedULX = 0;
613 double mappedULY = 0;
635 const double newLLXIndexed = std::min( mappedLLX, std::min( mappedLRX, std::min( mappedURX, mappedULX ) ) );
636 const double newLLYIndexed = std::max( mappedLLY, std::max( mappedLRY, std::max( mappedURY, mappedULY ) ) );
637 const double newURXIndexed = std::max( mappedLLX, std::max( mappedLRX, std::max( mappedURX, mappedULX ) ) );
638 const double newURYIndexed = std::min( mappedLLY, std::min( mappedLRY, std::min( mappedURY, mappedULY ) ) );
640 double oldMosaicReferenceX = 0;
641 double oldMosaicReferenceY = 0;
642 mosaicRasterHandler->getGrid()->gridToGeo( 0.0, 0.0, oldMosaicReferenceX,
643 oldMosaicReferenceY );
645 double mosaicReferenceHasChanged =
false;
648 if( newLLXIndexed < 0.0 )
651 (
unsigned int)std::ceil( -1.0 * newLLXIndexed ) ),
652 "Mosaic expansion error" );
653 mosaicReferenceHasChanged =
true;
656 if( newURYIndexed < 0.0 )
659 (
unsigned int)std::ceil( -1.0 * newURYIndexed ) ),
660 "Mosaic expansion error" );
661 mosaicReferenceHasChanged =
true;
664 if( newURXIndexed > ((
double)(mosaicRasterHandler->getNumberOfColumns() - 1) ) )
667 (
unsigned int)std::ceil( newURXIndexed -
668 ((
double)(mosaicRasterHandler->getNumberOfColumns() - 1)) ) ),
669 "Mosaic expansion error" );
672 if( newLLYIndexed > ((
double)(mosaicRasterHandler->getNumberOfRows() - 1) ) )
675 (
unsigned int)std::ceil( newLLYIndexed -
676 ((
double)(mosaicRasterHandler->getNumberOfRows() - 1) ) ) ),
677 "Mosaic expansion error" );
682 if( mosaicReferenceHasChanged )
684 double expansionOffSetX = 0;
685 double expansionOffSetY = 0;
686 mosaicRasterHandler->getGrid()->geoToGrid( oldMosaicReferenceX,
687 oldMosaicReferenceY, expansionOffSetX, expansionOffSetY );
691 geoTransPtr->getParameters().m_tiePoints;
693 for(
unsigned int tpIdx = 0 ; tpIdx <
696 newTransParams.
m_tiePoints[ tpIdx ].first.x += expansionOffSetX;
697 newTransParams.
m_tiePoints[ tpIdx ].first.y += expansionOffSetY;
701 "Geometric transformation parameters calcule error" );
707 double inputRasterMappedLLXIndexed = 0;
708 double inputRasterMappedLLYIndexed = 0;
709 double inputRasterMappedLRXIndexed = 0;
710 double inputRasterMappedLRYIndexed = 0;
711 double inputRasterMappedURXIndexed = 0;
712 double inputRasterMappedURYIndexed = 0;
713 double inputRasterMappedULXIndexed = 0;
714 double inputRasterMappedULYIndexed = 0;
716 const double lastRowIdx =
718 const double lastColIdx =
721 geoTransPtr->inverseMap(
724 inputRasterMappedLLXIndexed,
725 inputRasterMappedLLYIndexed);
726 geoTransPtr->inverseMap(
729 inputRasterMappedLRXIndexed,
730 inputRasterMappedLRYIndexed);
731 geoTransPtr->inverseMap(
734 inputRasterMappedURXIndexed,
735 inputRasterMappedURYIndexed);
736 geoTransPtr->inverseMap(
739 inputRasterMappedULXIndexed,
740 inputRasterMappedULYIndexed);
742 lastInputRasterBBoxLLXIndexed = (
unsigned int)
744 std::min( (
double)( mosaicRasterHandler->getNumberOfColumns() - 1 ),
746 std::min( inputRasterMappedLLXIndexed,
747 std::min( inputRasterMappedLRXIndexed,
748 std::min( inputRasterMappedURXIndexed,
749 inputRasterMappedULXIndexed
757 lastInputRasterBBoxLLYIndexed = (
unsigned int)
759 std::min( (
double)( mosaicRasterHandler->getNumberOfRows() - 1 ),
761 std::max( inputRasterMappedLLYIndexed,
762 std::max( inputRasterMappedLRYIndexed,
763 std::max( inputRasterMappedURYIndexed,
764 inputRasterMappedULYIndexed
772 lastInputRasterBBoxURXIndexed = (
unsigned int)
774 std::min( (
double)( mosaicRasterHandler->getNumberOfColumns() - 1 ),
776 std::max( inputRasterMappedLLXIndexed,
777 std::max( inputRasterMappedLRXIndexed,
778 std::max( inputRasterMappedURXIndexed,
779 inputRasterMappedULXIndexed
787 lastInputRasterBBoxURYIndexed = (
unsigned int)
789 std::min( (
double)( mosaicRasterHandler->getNumberOfRows() - 1 ),
791 std::min( inputRasterMappedLLYIndexed,
792 std::min( inputRasterMappedLRYIndexed,
793 std::min( inputRasterMappedURYIndexed,
794 inputRasterMappedULYIndexed
802 assert( lastInputRasterBBoxLLXIndexed >= 0 );
803 assert( lastInputRasterBBoxLLXIndexed <=
804 ( mosaicRasterHandler->getNumberOfColumns() - 1 ) );
805 assert( lastInputRasterBBoxLLYIndexed >= 0 );
806 assert( lastInputRasterBBoxLLYIndexed <=
807 ( mosaicRasterHandler->getNumberOfRows() - 1 ) );
808 assert( lastInputRasterBBoxURXIndexed >= 0 );
809 assert( lastInputRasterBBoxURXIndexed <=
810 ( mosaicRasterHandler->getNumberOfColumns() - 1 ) );
811 assert( lastInputRasterBBoxURYIndexed >= 0 );
812 assert( lastInputRasterBBoxURYIndexed <=
813 ( mosaicRasterHandler->getNumberOfRows() - 1 ) );
822 *( mosaicRasterHandler.get() ),
823 dummyRasterBandsIndexes,
833 currentRasterBandsOffsets,
834 currentRasterBandsScales,
835 &mosaicValidAreaPols,
840 "Blender initiazing error" );
843 "Error blending images" );
850 double inputRasterMappedLLX = 0;
851 double inputRasterMappedLLY = 0;
852 mosaicRasterHandler->getGrid()->gridToGeo(
853 (
double)inputRasterMappedLLXIndexed, (
double)inputRasterMappedLLYIndexed,
854 inputRasterMappedLLX, inputRasterMappedLLY );
856 double inputRasterMappedLRX = 0;
857 double inputRasterMappedLRY = 0;
858 mosaicRasterHandler->getGrid()->gridToGeo(
859 (
double)inputRasterMappedLRXIndexed, (
double)inputRasterMappedLRYIndexed,
860 inputRasterMappedLRX, inputRasterMappedLRY );
862 double inputRasterMappedURX = 0;
863 double inputRasterMappedURY = 0;
864 mosaicRasterHandler->getGrid()->gridToGeo(
865 (
double)inputRasterMappedURXIndexed, (
double)inputRasterMappedURYIndexed,
866 inputRasterMappedURX, inputRasterMappedURY );
868 double inputRasterMappedULX = 0;
869 double inputRasterMappedULY = 0;
870 mosaicRasterHandler->getGrid()->gridToGeo(
871 (
double)inputRasterMappedULXIndexed, (
double)inputRasterMappedULYIndexed,
872 inputRasterMappedULX, inputRasterMappedULY );
875 auxLinearRingPtr->
setPoint( 0, inputRasterMappedULX, inputRasterMappedULY );
876 auxLinearRingPtr->
setPoint( 1, inputRasterMappedURX, inputRasterMappedURY );
877 auxLinearRingPtr->
setPoint( 2, inputRasterMappedLRX, inputRasterMappedLRY );
878 auxLinearRingPtr->
setPoint( 3, inputRasterMappedLLX, inputRasterMappedLLY );
879 auxLinearRingPtr->
setPoint( 4, inputRasterMappedULX, inputRasterMappedULY );
881 lastMosaicAddedRasterPol.
push_back( auxLinearRingPtr );
882 lastMosaicAddedRasterPol.
setSRID( mosaicRasterHandler->getSRID() );
886 std::auto_ptr< te::gm::Geometry > unionMultiPolPtr(
887 mosaicValidAreaPols.
Union( &lastMosaicAddedRasterPol ) );
889 unionMultiPolPtr->setSRID( mosaicRasterHandler->getSRID() );
897 mosaicValidAreaPols.
clear();
898 mosaicValidAreaPols.
setSRID( unionMultiPolPtr->getSRID() );
909 cachedInputRasterPtr.reset();
915 progressPtr->pulse();
916 if( ! progressPtr->isActive() )
return false;
922 if( mosaicRasterHandler.get() )
927 boost::lexical_cast< std::string >( outParamsPtr->
m_sequencesInfo.size() ) +
934 *( mosaicRasterHandler.get() ), outParamsPtr->
m_outputDSPtr ),
935 "Data set creation error" );
937 currentMosaicSquenceInfo.
clear();
950 throw( te::rp::Exception )
963 "Invalid m_feederRasterPtr" )
967 "Invalid number of rasters" )
978 for( std::vector< std::vector< unsigned int > >::size_type
979 inputRastersBandsIdx = 0 ; inputRastersBandsIdx <
983 != 0,
"Invalid raster" )
986 inputRastersBandsIdx ].size() > 0,
"Invalid bands number" );
990 0 ].size(),
"Bands number mismatch" );
992 for( std::vector< unsigned int >::size_type currRasterBandidx = 0 ;
994 inputRastersBandsIdx ].size() ; ++currRasterBandidx )
997 inputRastersBandsIdx ][ currRasterBandidx ] <
999 "Invalid band index" );
1003 "Invalid parameter m_tiePointsLocationBandIndex" );
1012 "Invalid parameter m_minRequiredTiePointsCoveredAreaPercent" );
1025 const bool& forceNoDataValue,
1026 const double& noDataValue,
1027 double& mean,
double& variance )
1032 double internalNoDataValue = 0;
1033 if( forceNoDataValue )
1034 internalNoDataValue = noDataValue;
1043 double pixelsNumber = 0;
1045 unsigned int col = 0;
1046 unsigned int line = 0;
1048 for( line = 0 ; line < nLines ; ++line )
1049 for( col = 0 ; col < nCols ; ++col )
1053 if( value != internalNoDataValue )
1060 if( pixelsNumber != 0.0 )
1062 mean /= pixelsNumber;
1064 for( line = 0 ; line < nLines ; ++line )
1065 for( col = 0 ; col < nCols ; ++col )
1069 if( value != internalNoDataValue )
1071 variance += ( ( value - mean ) * ( value - mean ) ) / pixelsNumber;
1081 if( dataSetName.empty() )
return false;
1083 if( dataSourcePtr == 0 )
return false;
1084 if( ! dataSourcePtr->
isValid() )
return false;
1090 std::vector< te::rst::BandProperty* > bandsProperties;
1091 unsigned int bandIdx = 0;
1092 for( bandIdx = 0 ; bandIdx < nBands ; ++bandIdx )
1100 bandsProperties, dataSetName, *dataSourcePtr, outRasterHandler) )
1103 unsigned int col = 0;
1104 unsigned int row = 0;
1107 for( bandIdx = 0 ; bandIdx < nBands ; ++bandIdx )
1112 for( row = 0 ; row < nRows ; ++row )
1114 for( col = 0 ; col < nCols ; ++col )
1116 inBand.
getValue( col, row, value );
1117 outBand.
setValue( col, row, value );
1128 std::map<std::string, std::string> rInfo;
1129 rInfo[
"URI"] = fileName;
1133 std::vector<te::rst::BandProperty*> bandsProperties;
1134 unsigned int bandIdx = 0;
1135 for( bandIdx = 0 ; bandIdx < nBands ; ++bandIdx )
1141 std::auto_ptr< te::rst::Raster > outputRasterPtr(
1143 if( outputRasterPtr.get() == 0 )
return false;
1145 unsigned int line = 0;
1146 unsigned int col = 0;
1152 for( bandIdx = 0 ; bandIdx < nBands ; ++bandIdx )
1155 te::rst::Band& outBand = *outputRasterPtr->getBand( bandIdx );
1157 for( line = 0 ; line < nLines ; ++line )
1158 for( col = 0 ; col < nCols ; ++col )
1160 inBand.
getValue( col, line, value );
1161 outBand.
setValue( col, line, value );
1169 const std::vector< te::gm::GTParameters::TiePoint >& tiePoints,
1170 const bool useTPSecondCoordPair )
const
1172 if( tiePoints.size() < 3 )
1180 for(
unsigned int tiePointsIdx = 0 ; tiePointsIdx < tiePoints.size() ;
1183 if( useTPSecondCoordPair )
1185 tiePoints[ tiePointsIdx ].second.y ) );
1188 tiePoints[ tiePointsIdx ].first.y ) );
1191 std::auto_ptr< te::gm::Geometry > convexHullPolPtr( points.
convexHull() );
1193 if( dynamic_cast< te::gm::Surface* >( convexHullPolPtr.get() ) )
1195 return dynamic_cast< te::gm::Surface*
>( convexHullPolPtr.get() )->getArea();
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).
std::vector< te::gm::GTParameters::TiePoint > m_tiePoints
The generated tie-pionts (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.
int getSRID() const
Returns the grid spatial reference system identifier.
unsigned int getNumberOfColumns() const
Returns the raster number of columns.
int m_nblocksx
The number of blocks in x.
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.
double m_urx
Upper right corner x-coordinate.
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().
bool execute(AlgorithmOutputParameters &outputParams)
Executes the algorithm using the supplied parameters.
std::vector< MosaicSequenceInfo > m_sequencesInfo
bool blendIntoRaster1()
Execute blending of the given input rasters and write the result into raster1.
Raster Processing functions.
#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.
MultiPoint is a GeometryCollection whose elements are restricted to points.
double m_llx
Lower left corner x-coordinate.
A point with x and y coordinate values.
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...
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.
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.
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.
double m_lly
Lower left corner y-coordinate.
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.
double getTPConvexHullArea(const std::vector< te::gm::GTParameters::TiePoint > &tiePoints, const bool useTPSecondCoordPair) const
Returns the tie points converx hull area.
Abstract parameters base interface.
#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.
double m_ury
Upper right corner y-coordinate.
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.
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.
double getResolutionY() const
Returns the raster vertical (y-axis) resolution.
virtual Geometry * convexHull() const
This method calculates the Convex Hull of a geometry.
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).
Near neighborhood interpolation method.
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 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(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::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.
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...
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.
Surface is an abstract class that represents a 2-dimensional geometric objects.
te::da::DataSource * m_outputDSPtr
The mosaic sequences info.