27 #include "../geometry/Coord2D.h" 28 #include "../geometry/Envelope.h" 29 #include "../geometry/Point.h" 30 #include "../geometry/Polygon.h" 31 #include "../raster/Grid.h" 103 std::vector< int >
dt;
106 std::vector< double > noDataValues;
107 noDataValues.push_back( 0 );
110 "Output raster creation error" );
114 const double outNoDataValue =
m_outputRasterPtr->getBand( 0 )->getProperty()->m_noDataValue;
117 unsigned int col = 0;
120 for(
unsigned int row = 0 ; row < nRows ; ++row )
122 for( col = 0 ; col <
nCols ; ++
col )
124 outBand.
setValue( col, row, outNoDataValue );
133 unsigned int pattern;
135 unsigned int outputRasterPaletteSize = 0;
154 pattern = rand() % 5 + 1;
156 for(r = (
unsigned) startGridCoord.
y; r < endGridCoord.
y; r++)
157 for(c = (
unsigned) startGridCoord.
x; c < endGridCoord.
x; c++)
168 outputRasterPaletteSize = std::max( outputRasterPaletteSize, pattern );
176 for(r = 0; r < nrows; r++)
178 for(c = 0; c < ncols; c++)
181 pattern = rand() % 5 + 1;
185 outputRasterPaletteSize = std::max( outputRasterPaletteSize, pattern );
192 ++outputRasterPaletteSize;
195 "Output raster palette creation error" );
bool initialize(ClassifierStrategyParameters const *const strategyParams)
Initialize the classification strategy.
Base exception class for plugin module.
bool createOutputRaster(const std::vector< int > &bandsDataTypes, const std::vector< double > &noDataValues)
Create the output raster using the EXPANSIBLE driver.
An utility struct for representing 2D coordinates.
#define TE_TR(message)
It marks a string in order to get translated.
virtual bool intersects(const Geometry *const rhs) const _NOEXCEPT_OP(false)
It returns true if the geometry object spatially intersects rhs geometry.
AbstractParameters * clone() const
Create a clone copy of this instance.
Raster classifier strategy factory base class.
ClassifierDummyStrategyFactory()
unsigned int unsigned int nCols
const Parameters & operator=(const Parameters ¶ms)
A point with x and y coordinate values.
const Envelope * getMBR() const _NOEXCEPT_OP(true)
It returns the minimum bounding rectangle for the geometry in an internal representation.
static te::dt::TimeDuration dt(20, 30, 50, 11)
bool execute()
Executes the classification strategy.
A raster band description.
bool m_isInitialized
True if this instance is initialized.
virtual void setValue(unsigned int c, unsigned int r, const double value)=0
Sets the cell attribute value.
te::rp::ClassifierStrategy * build()
Concrete factories (derived from this one) must implement this method in order to create objects...
std::unique_ptr< te::rst::Raster > m_outputRasterPtr
A pointer to the output raster.
Abstract parameters base interface.
void reset()
Clear all internal allocated resources and reset the parameters instance to its initial state...
Polygon is a subclass of CurvePolygon whose rings are defined by linear rings.
Classifier Strategy Parameters.
Raster classifier strategy base class.
unsigned int m_dummyParameter
A dummy parameter.
ClassifierDummyStrategy::Parameters m_parameters
Internal execution parameters.
Raster dummy Classifier strategy factory.
Coord2D getUpperRight() const
It returns the upper right coordinate of the envelope.
Raster Processing functions.
~ClassifierDummyStrategy()
~ClassifierDummyStrategyFactory()
Coord2D getLowerLeft() const
It returns the lower left coordinate of the envelope.
std::vector< te::gm::Polygon * > const * m_inputPolygonsPtr
Input polygons.
#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...
bool setOutputRasterPalette(const unsigned int size)
Create and set the output raster palette folowing the current internal settings.
Dummy strategy (just for testing purposes).
ClassifierDummyStrategy()
Dummy strategy (just for testing purposes).