It implements the vectorizer, based on TerraLib 4 algorithm. More...
#include <Vectorizer.h>
Public Member Functions | |
Vectorizer & | operator= (const Vectorizer &rhs) |
Assignment operator. More... | |
bool | run (std::vector< te::gm::Geometry * > &polygons, std::vector< double > *const polygonsValues=0) |
Returns true if current algorithm implementation runs ok, false otherwise. More... | |
Vectorizer (Raster *r, std::size_t b, unsigned int mp=0, const bool noDataExclusion=true) | |
Constructor. More... | |
Vectorizer (const Vectorizer &rhs) | |
Copy constructor. More... | |
~Vectorizer () | |
Destructor. More... | |
Protected Member Functions | |
void | clear () |
Clear all internally allocated resources. More... | |
bool | detectEdge (long segmentInitialCol, long segmentInitialRow, te::gm::LinearRing &outputLine) |
Detects an edge of a cell in Raster. More... | |
bool | startingEdgeTest (const int &x, const int &y) |
Tests if the current point is a edge start. More... | |
Protected Attributes | |
te::gm::Coord2D | m_directions [8] |
Directions vector. More... | |
unsigned int | m_maxPolygons |
The maximum allowed number of polygons to be created. More... | |
unsigned long | m_nColumns |
The number of columns. More... | |
unsigned long | m_nLines |
The number of lines. More... | |
double | m_noDataValue |
The used dummy value. More... | |
unsigned int | m_rasterBand |
The raster band to be used. More... | |
Raster * | m_rasterPtr |
A pointer to the input image. More... | |
double | m_resX |
Resolution X. More... | |
double | m_resY |
Resolution Y. More... | |
It implements the vectorizer, based on TerraLib 4 algorithm.
This algorithm implements a vectorizer, which is an algorithm to convert an image with pixel-labels into a set of polygons. All connected pixels in the image with the same label will define an individual polygon. This algorithm is based on the implementation of the previous version of this library, the TerraLib 4.
Definition at line 64 of file Vectorizer.h.
te::rst::Vectorizer::Vectorizer | ( | Raster * | r, |
std::size_t | b, | ||
unsigned int | mp = 0 , |
||
const bool | noDataExclusion = true |
||
) |
Constructor.
r | The input raster. |
b | The selected band of the raster to be vectorized. |
mp | The maximum allowed number of polygons to be created (default = 0, unlimited). |
noDataExclusion | If true, regions with no-data pixels will not generate geometries. |
te::rst::Vectorizer::Vectorizer | ( | const Vectorizer & | rhs | ) |
Copy constructor.
rhs | The right-hand-side copy that would be used to copy from. |
te::rst::Vectorizer::~Vectorizer | ( | ) |
Destructor.
|
protected |
Clear all internally allocated resources.
|
protected |
Detects an edge of a cell in Raster.
segmentInitialCol | abscissa (column) of the upper-left point of the shape |
segmentInitialRow | ordinate (line) of the upper-left point of the shape |
line | 2D Line. |
Vectorizer& te::rst::Vectorizer::operator= | ( | const Vectorizer & | rhs | ) |
Assignment operator.
rhs | The right-hand-side copy that would be used to copy from. |
bool te::rst::Vectorizer::run | ( | std::vector< te::gm::Geometry * > & | polygons, |
std::vector< double > *const | polygonsValues = 0 |
||
) |
Returns true if current algorithm implementation runs ok, false otherwise.
polygons | The vector of polygons (will be cleared) to get the result of the vectorization. |
polygonsValues | A pointer to a valid vector where the raster pixel values related to each polygon will be stored, or a NULL pointer. |
|
protected |
Tests if the current point is a edge start.
x | X coord. |
y | Y coord. |
|
protected |
Directions vector.
Definition at line 140 of file Vectorizer.h.
|
protected |
The maximum allowed number of polygons to be created.
Definition at line 146 of file Vectorizer.h.
|
protected |
The number of columns.
Definition at line 144 of file Vectorizer.h.
|
protected |
The number of lines.
Definition at line 143 of file Vectorizer.h.
|
protected |
The used dummy value.
Definition at line 138 of file Vectorizer.h.
|
protected |
The raster band to be used.
Definition at line 145 of file Vectorizer.h.
|
protected |
A pointer to the input image.
Definition at line 139 of file Vectorizer.h.
|
protected |
Resolution X.
Definition at line 141 of file Vectorizer.h.
|
protected |
Resolution Y.
Definition at line 142 of file Vectorizer.h.