27 #include "../../common/Exception.h"
28 #include "../../common/Translator.h"
29 #include "../../common/progress/TaskProgress.h"
30 #include "../../dataaccess/dataset/DataSet.h"
31 #include "../../dataaccess/datasource/DataSource.h"
32 #include "../../dataaccess/utils/Utils.h"
33 #include "../../geometry/GeometryProperty.h"
34 #include "../../geometry/MultiPolygon.h"
35 #include "../../geometry/Point.h"
36 #include "../../geometry/Polygon.h"
37 #include "../../graph/core/Vertex.h"
38 #include "../../graph/core/AbstractGraph.h"
39 #include "../../graph/graphs/DirectedGraph.h"
70 createVertexObjects();
79 std::auto_ptr<te::da::DataSet> dataSet = m_ds->getDataSet(m_gpm->getDataSetName());
81 std::auto_ptr<te::da::DataSetType> dataSetType = m_ds->getDataSetType(m_gpm->getDataSetName());
95 m_gpm->getGraph()->addVertexProperty(gProp);
104 dataSet->moveBeforeFirst();
106 while(dataSet->moveNext())
108 std::string strId = dataSet->getAsString(m_gpm->getAttributeName());
110 int id = atoi(strId.c_str());
114 v->setAttributeVecSize(1);
116 std::auto_ptr<te::gm::Geometry> g = dataSet->getGeometry(geomPos);
122 v->addAttribute(0, p);
124 m_gpm->getGraph()->add(v);
#define TE_SA_GEOMETRY_ATTR_NAME
void setMessage(const std::string &message)
Set the task message.
Utility functions for the data access module.
An atomic property like an integer or double.
This class defines a an Abstract class for a GPM constructor.
void construct(te::da::DataSource *ds, GeneralizedProximityMatrix *gpm)
This class defines a Generalized Proximity Matrix.
void createVertexObjects()
Function used to create all vertex object based on data set.
virtual void addEdgeProperty(te::dt::Property *p)=0
Add a new property associated to the edge element.
virtual ~GPMConstructorAbstractStrategy()
Virtual destructor.
This class can be used to inform the progress of a task.
TESAEXPORT te::gm::Coord2D GetCentroidCoord(te::gm::Geometry *geom)
Function used to get centroid coord of a geometry.
An utility struct for representing 2D coordinates.
An abstract class for data providers like a DBMS, Web Services or a regular file. ...
#define TE_TR(message)
It marks a string in order to get translated.
bool isActive() const
Verify if the task is active.
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.
TEDATAACCESSEXPORT std::size_t GetFirstSpatialPropertyPos(const te::da::DataSet *dataset)
It returns the first dataset spatial property or NULL if none is found.
int getSRID() const
It returns the spatial reference system identifier associated to this property.
A point with x and y coordinate values.
int getEdgeId()
Function used to generated the edge id.
#define TE_SA_DISTANCE_ATTR_NAME
void pulse()
Calls setCurrentStep() function using getCurrentStep() + 1.
GPMConstructorStrategyType getConstructorType()
This class is designed to declare objects to be thrown as exceptions by TerraLib. ...
GPMConstructorAbstractStrategy()
Default constructor.
void createDistanceAttribute(GeneralizedProximityMatrix *gpm)
Added to the edge a new attribute for distance information.
TEDATAACCESSEXPORT te::gm::GeometryProperty * GetFirstGeomProperty(const DataSetType *dt)
int m_edgeId
Attribute used as a index counter for edge objects.
GPMConstructorStrategyType
Strategies to construc a GPM.
te::graph::AbstractGraph * getGraph()
This class defines the GPM class.
void setParent(Property *p)
It associate this property to the informed parent.