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"
101 const std::vector<te::gm::Polygon*>& inputPolygons,
te::rst::Raster& outputRaster,
102 const unsigned int outputRasterBand,
const bool enableProgressInterface)
throw(te::rp::Exception)
108 unsigned int pattern;
112 if(inputPolygons.size() > 0)
115 for (
unsigned i = 0; i < inputPolygons.size(); i++)
125 pattern = rand() % 5 + 1;
127 for(r = (
unsigned) startGridCoord.
y; r < endGridCoord.
y; r++)
128 for(c = (
unsigned) startGridCoord.
x; c < endGridCoord.
x; c++)
134 outputRaster.setValue(c, r, pattern, outputRasterBand);
142 const unsigned int nrows = outputRaster.getNumberOfRows();
143 const unsigned int ncols = outputRaster.getNumberOfColumns();
145 for(r = 0; r < nrows; r++)
147 for(c = 0; c < ncols; c++)
150 pattern = rand() % 5 + 1;
152 outputRaster.setValue(c, r, pattern, outputRasterBand);
Polygon is a subclass of CurvePolygon whose rings are defined by linear rings.
Raster strategy parameters base class.
Dummy strategy (just for testing purposes).
Raster Processing functions.
virtual bool intersects(const Geometry *const rhs) const
It returns true if the geometry object spatially intersects rhs geometry.
ClassifierDummyStrategy::Parameters m_parameters
Internal execution parameters.
void reset()
Clear all internal allocated resources and reset the parameters instance to its initial state...
bool execute(const te::rst::Raster &inputRaster, const std::vector< unsigned int > &inputRasterBands, const std::vector< te::gm::Polygon * > &inputPolygons, te::rst::Raster &outputRaster, const unsigned int outputRasterBand, const bool enableProgressInterface)
Executes the classification strategy.
#define TR_RP(message)
It marks a string in order to get translated. This is a special mark used in the Raster Processing mo...
An utility struct for representing 2D coordinates.
ClassifierDummyStrategy()
Coord2D getUpperRight() const
It returns the upper right coordinate of the envelope.
#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...
unsigned int m_dummyParameter
A dummy parameter.
Abstract parameters base interface.
ClassifierDummyStrategyFactory()
A point with x and y coordinate values.
Raster classifier strategy factory base class.
te::rp::ClassifierStrategy * build()
Concrete factories (derived from this one) must implement this method in order to create objects...
bool initialize(StrategyParameters const *const strategyParams)
Initialize the classification strategy.
AbstractParameters * clone() const
Create a clone copy of this instance.
const Parameters & operator=(const Parameters ¶ms)
Dummy strategy (just for testing purposes).
~ClassifierDummyStrategy()
An abstract class for raster data strucutures.
const Envelope * getMBR() const
It returns the minimum bounding rectangle for the geometry in an internal representation.
Raster classifier strategy base class.
bool m_isInitialized
True if this instance is initialized.
Raster dummy Classifier strategy factory.
Coord2D getLowerLeft() const
It returns the lower left coordinate of the envelope.
~ClassifierDummyStrategyFactory()