27 #include "../../common/Exception.h" 28 #include "../../core/translator/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" 103 dataSet->moveBeforeFirst();
105 while(dataSet->moveNext())
109 int id = atoi(strId.c_str());
113 v->setAttributeVecSize(1);
115 std::unique_ptr<te::gm::Geometry> g = dataSet->getGeometry(geomPos);
121 v->addAttribute(0, p);
void setMessage(const std::string &message)
Set the task message.
An atomic property like an integer or double.
This class defines a an Abstract class for a GPM constructor.
#define TE_SA_GEOMETRY_ATTR_NAME
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.
An utility struct for representing 2D coordinates.
static te::dt::Date ds(2010, 01, 01)
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.
te::da::DataSource * m_ds
Data Source pointer.
virtual void add(Vertex *v)=0
Add a new vertex element to a graph.
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.
virtual void addVertexProperty(te::dt::Property *p)=0
Add a new property associated to the vertex element.
GeneralizedProximityMatrix * m_gpm
GPM Pointer.
void pulse()
Calls setCurrentStep() function using getCurrentStep() + 1.
GPMConstructorStrategyType getConstructorType()
Utility functions for the data access module.
virtual std::unique_ptr< te::da::DataSetType > getDataSetType(const std::string &name)
It gets information about the given dataset.
This class is designed to declare objects to be thrown as exceptions by TerraLib. ...
GPMConstructorStrategyType m_type
Constructor Type.
GPMConstructorAbstractStrategy()
Default constructor.
virtual std::unique_ptr< DataSet > getDataSet(const std::string &name, te::common::TraverseType travType=te::common::FORWARDONLY, const te::common::AccessPolicy accessPolicy=te::common::RAccess)
It gets the dataset identified by the given name. This method always returns a disconnected dataset...
std::string getDataSetName()
#define TE_SA_DISTANCE_ATTR_NAME
std::string getAttributeName()
virtual void constructStrategy()=0
Build the edges using specific strategy.
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.