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"
84 task.
setMessage(
"Add Raster Attribute Operation");
86 int spatialPropertyId = -1;
92 spatialPropertyId = i;
109 raster->
getValue((
int)coord.
x, (
int)coord.
y, pixelValue, band);
Abstract class used to define the main functions of graph struct. All graph implementations must used...
void setParent(Property *p)
It associate this property to the informed parent.
virtual te::dt::Property * getVertexProperty(int idx)
Get a vertex property given a index.
An atomic property like an integer or double.
virtual int getVertexPropertySize()
Used to verify the number of properties associated to vertex elements.
virtual void flush()=0
Function used to clear the memory cache, all elements was released from memory, if any element was ch...
void setIterator(te::graph::AbstractIterator *i)
Used to associate a iterator to graph.
void setTotalSteps(int value)
Set the task total stepes.
Grid * getGrid()
It returns the raster grid.
From the point of view of graph theory, vertices are treated as featureless and indivisible objects...
virtual te::graph::GraphMetadata * getMetadata()=0
Function used to access the graph metadata.
A template for atomic data types (integers, floats, strings and others).
const std::string & getName() const
It returns the property name.
void setId(unsigned int id)
It sets the property identifier.
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 te::graph::Vertex * getNextVertex()
It returns a pointer to the next vertex element of a graph.
An utility struct for representing 2D coordinates.
const double & getX() const
It returns the Point x-coordinate value.
void addAttribute(int idx, te::dt::AbstractData *ad)
Add a new attribute to this element.
virtual int getVertexPropertySize()=0
Used to verify the number of properties associated to vertex elements.
AddRasterAttribute(te::graph::AbstractGraph *graph, std::string spatialAttributeName, std::string attributeName, te::rst::Raster *raster, int band)
Default constructor.
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.
This class defines a commun interface to represents a graph iterator class. The main diferency to ano...
A point with x and y coordinate values.
std::vector< te::dt::AbstractData * > & getAttributes()
It returns the vector of attributes associated with this element.
virtual bool isVertexIteratorAfterEnd()
Used to check the iterator position.
virtual size_t getVertexInteratorCount()
It returns the number of elements of this iterator.
virtual ~AddRasterAttribute()
Virtual destructor.
void setMessage(const std::string &message)
Set the task message.
An abstract class for raster data strucutures.
This class can be used to inform the progress of a task.
const double & getY() const
It returns the Point y-coordinate value.
virtual void addVertexProperty(te::dt::Property *p)=0
Add a new property associated to the vertex element.
virtual void update(Vertex *v)=0
Update the vertex element.
void geoToGrid(const double &x, const double &y, double &col, double &row) const
Get the grid point associated to a spatial location.
te::graph::AbstractIterator * getIterator()
Used to get a iterator associated to graph.
virtual te::graph::Vertex * getFirstVertex()
It returns a pointer to the first vertex element of a graph.
virtual te::dt::Property * getVertexProperty(int idx)=0
Get a vertex property given a index.