te::rst::BoundaryExtract Class Reference

It implements the Boundary Extract (vectorizer specialization - extract only one pixel value) More...

#include <BoundaryExtract.h>

Inheritance diagram for te::rst::BoundaryExtract:
te::rst::Vectorizer

Public Member Functions

 BoundaryExtract (Raster *r, std::size_t b, unsigned int mp=0, const bool noDataExclusion=true)
 Constructor. More...
 
bool run (std::vector< te::gm::Geometry *> &polygons, double pixelvalue)
 Returns true if current algorithm implementation runs ok, false otherwise. More...
 
 ~BoundaryExtract ()
 Destructor. More...
 

Protected Member Functions

bool detectEdge (long segmentInitialCol, long segmentInitialRow, te::gm::LinearRing &outputLine)
 Detects an edge of a cell in Raster. More...
 

Private Member Functions

void clear ()
 Clear all internally allocated resources. 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...
 
bool startingEdgeTest (const int &x, const int &y)
 Tests if the current point is a edge start. More...
 

Private 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...
 
Rasterm_rasterPtr
 A pointer to the input image. More...
 
double m_resX
 Resolution X. More...
 
double m_resY
 Resolution Y. More...
 

Detailed Description

It implements the Boundary Extract (vectorizer specialization - extract only one pixel value)

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.

See also
Raster, Geometry

Definition at line 65 of file BoundaryExtract.h.

Constructor & Destructor Documentation

◆ BoundaryExtract()

te::rst::BoundaryExtract::BoundaryExtract ( Raster r,
std::size_t  b,
unsigned int  mp = 0,
const bool  noDataExclusion = true 
)

Constructor.

Parameters
rThe input raster.
bThe selected band of the raster to be vectorized.
mpThe maximum allowed number of polygons to be created (default = 0, unlimited).
noDataExclusionIf true, regions with no-data pixels will not generate geometries.

◆ ~BoundaryExtract()

te::rst::BoundaryExtract::~BoundaryExtract ( )

Destructor.

Member Function Documentation

◆ clear()

void te::rst::Vectorizer::clear ( )
protectedinherited

Clear all internally allocated resources.

◆ detectEdge()

bool te::rst::BoundaryExtract::detectEdge ( long  segmentInitialCol,
long  segmentInitialRow,
te::gm::LinearRing outputLine 
)
protected

Detects an edge of a cell in Raster.

Parameters
segmentInitialColabscissa (column) of the upper-left point of the shape
segmentInitialRowordinate (line) of the upper-left point of the shape
line2D Line.
Returns
true if ok, otherwise false

◆ run() [1/2]

bool te::rst::BoundaryExtract::run ( std::vector< te::gm::Geometry *> &  polygons,
double  pixelvalue 
)

Returns true if current algorithm implementation runs ok, false otherwise.

Parameters
polygonsThe vector of polygons (will be cleared) to get the result of the vectorization.
polygonsValuesA pointer to a valid vector where the raster pixel values related to each polygon will be stored, or a NULL pointer.
Note
The caller of this method must take the ownership of the returned geometries and must delete them when necessary.

◆ run() [2/2]

bool te::rst::Vectorizer::run ( std::vector< te::gm::Geometry *> &  polygons,
std::vector< double > *const  polygonsValues = 0 
)
inherited

Returns true if current algorithm implementation runs ok, false otherwise.

Parameters
polygonsThe vector of polygons (will be cleared) to get the result of the vectorization.
polygonsValuesA pointer to a valid vector where the raster pixel values related to each polygon will be stored, or a NULL pointer.
Note
The caller of this method must take the ownership of the returned geometries and must delete them when necessary.

◆ startingEdgeTest()

bool te::rst::Vectorizer::startingEdgeTest ( const int &  x,
const int &  y 
)
protectedinherited

Tests if the current point is a edge start.

Parameters
xX coord.
yY coord.
Returns
true if the current point is a edge start, false if not.

Member Data Documentation

◆ m_directions

te::gm::Coord2D te::rst::Vectorizer::m_directions[8]
protectedinherited

Directions vector.

Definition at line 140 of file Vectorizer.h.

◆ m_maxPolygons

unsigned int te::rst::Vectorizer::m_maxPolygons
protectedinherited

The maximum allowed number of polygons to be created.

Definition at line 146 of file Vectorizer.h.

◆ m_nColumns

unsigned long te::rst::Vectorizer::m_nColumns
protectedinherited

The number of columns.

Definition at line 144 of file Vectorizer.h.

◆ m_nLines

unsigned long te::rst::Vectorizer::m_nLines
protectedinherited

The number of lines.

Definition at line 143 of file Vectorizer.h.

◆ m_noDataValue

double te::rst::Vectorizer::m_noDataValue
protectedinherited

The used dummy value.

Definition at line 138 of file Vectorizer.h.

◆ m_rasterBand

unsigned int te::rst::Vectorizer::m_rasterBand
protectedinherited

The raster band to be used.

Definition at line 145 of file Vectorizer.h.

◆ m_rasterPtr

Raster* te::rst::Vectorizer::m_rasterPtr
protectedinherited

A pointer to the input image.

Definition at line 139 of file Vectorizer.h.

◆ m_resX

double te::rst::Vectorizer::m_resX
protectedinherited

Resolution X.

Definition at line 141 of file Vectorizer.h.

◆ m_resY

double te::rst::Vectorizer::m_resY
protectedinherited

Resolution Y.

Definition at line 142 of file Vectorizer.h.


The documentation for this class was generated from the following file: