28 #include "../../common/Translator.h"
29 #include "../../common/progress/TaskProgress.h"
30 #include "../../datatype/SimpleProperty.h"
31 #include "../../datatype/SimpleData.h"
32 #include "../../datatype/Enums.h"
33 #include "../../geometry/Coord2D.h"
34 #include "../../geometry/Point.h"
35 #include "../../raster/Grid.h"
36 #include "../../raster/Raster.h"
37 #include "../core/AbstractGraph.h"
38 #include "../core/Edge.h"
39 #include "../core/GraphMetadata.h"
40 #include "../core/Vertex.h"
41 #include "../core/VertexProperty.h"
42 #include "../graphs/Graph.h"
43 #include "../iterator/SequenceIterator.h"
44 #include "../Exception.h"
80 task.
setMessage(
"Add Raster Attribute Operation");
82 int spatialPropertyId = -1;
88 spatialPropertyId = i;
105 raster->
getValue((
int)coord.
x, (
int)coord.
y, pixelValue, band);
virtual te::graph::Vertex * getFirstVertex()
It returns a pointer to the first vertex element of a graph.
virtual void update(Vertex *v)=0
Update the vertex element.
void setMessage(const std::string &message)
Set the task message.
An atomic property like an integer or double.
This class can be used to inform the progress of a task.
An utility struct for representing 2D coordinates.
std::vector< te::dt::AbstractData * > & getAttributes()
It returns the vector of attributes associated with this element.
virtual te::dt::Property * getVertexProperty(int idx)=0
Get a vertex property given a index.
void geoToGrid(const double &x, const double &y, double &col, double &row) const
Get the grid point associated to a spatial location.
From the point of view of graph theory, vertices are treated as featureless and indivisible objects...
void setTotalSteps(int value)
Set the task total stepes.
void setId(unsigned int id)
It sets the property identifier.
virtual te::graph::GraphMetadata * getMetadata()=0
Function used to access the graph metadata.
AddRasterAttribute(te::graph::AbstractGraph *graph, std::string spatialAttributeName, std::string attributeName, te::rst::Raster *raster, int band)
Default constructor.
virtual ~AddRasterAttribute()
Virtual destructor.
const double & getY() const
It returns the Point y-coordinate value.
A point with x and y coordinate values.
An abstract class for raster data strucutures.
virtual void addVertexProperty(te::dt::Property *p)=0
Add a new property associated to the vertex element.
Abstract class used to define the main functions of graph struct. All graph implementations must used...
This class defines a function used to add to a graph the raster pixel value as attribute.
void pulse()
Calls setCurrentStep() function using getCurrentStep() + 1.
Grid * getGrid()
It returns the raster grid.
virtual te::graph::Vertex * getNextVertex()
It returns a pointer to the next vertex element of a graph.
virtual void getValue(unsigned int c, unsigned int r, double &value, std::size_t b=0) const
Returns the attribute value of a band of a cell.
virtual int getVertexPropertySize()=0
Used to verify the number of properties associated to vertex elements.
virtual size_t getVertexInteratorCount()
It returns the number of elements of this iterator.
void addAttribute(int idx, te::dt::AbstractData *ad)
Add a new attribute to this element.
A template for atomic data types (integers, floats, strings and others).
virtual void flush()=0
Function used to clear the memory cache, all elements was released from memory, if any element was ch...
const double & getX() const
It returns the Point x-coordinate value.
virtual bool isVertexIteratorAfterEnd()
Used to check the iterator position.
const std::string & getName() const
It returns the property name.
void setParent(Property *p)
It associate this property to the informed parent.