This class defines the Flow strategy to build a graph. More...
#include <FlowGraphBuilder.h>
Public Member Functions | |
| FlowGraphBuilder () | |
| Default constructor. More... | |
| virtual | ~FlowGraphBuilder () |
| Virtual destructor. More... | |
Methods | |
Methods used by this builder | |
| bool | build (const std::string &shapeFileName, const std::string &linkColumn, const int &srid, const std::string &csvFileName, const int &fromIdx, const int &toIdx, const int &weightIdx, const std::string &dsInfo, const std::string &graphType, const std::map< std::string, std::string > &gInfo) |
| Function used to build the output graph based on input parameters. More... | |
Abstract Methods | |
Method common to each graph builder | |
| std::string | getErrorMessage () |
| Get error message. More... | |
| boost::shared_ptr< AbstractGraph > | getGraph () |
| Get generated graph. More... | |
Protected Member Functions | |
| bool | createEdgeObjects (const std::string &csvFileName, const int &fromIdx, const int &toIdx, const int &weightIdx) |
| Function used to create all edges object based on flow table data. More... | |
| bool | createVertexObjects (const std::string &shapeFileName, const std::string &linkColumn, const int &srid) |
| Function used to create all vertex object based on vectorial data. More... | |
| std::unique_ptr< te::da::DataSet > | getDataSet (te::da::DataSource *ds) |
| Function used to get the data set with the vectorial data. More... | |
| std::unique_ptr< te::da::DataSource > | getDataSource (const std::string fileName) |
| Function used to get the data source with the vectorial data. More... | |
| int | getEdgeId () |
| Function used to generated the edge id. More... | |
| boost::ptr_vector< te::dt::Property > | getProperties (te::da::DataSource *ds) |
| Function used to get the data source properties. More... | |
Protected Attributes | |
| std::string | m_errorMessage |
| Error message. More... | |
| boost::shared_ptr< AbstractGraph > | m_graph |
| Graph object. More... | |
Private Attributes | |
| int | m_edgeId |
| Attribute used as a index counter for edge objects. More... | |
This class defines the Flow strategy to build a graph.
This function needs a vectorial data and table with flow information, this table must have the origin and destination info about each flow.
Definition at line 76 of file FlowGraphBuilder.h.
| te::graph::FlowGraphBuilder::FlowGraphBuilder | ( | ) |
Default constructor.
Definition at line 60 of file FlowGraphBuilder.cpp.
References m_edgeId, and ~FlowGraphBuilder().
|
virtualdefault |
Virtual destructor.
Referenced by FlowGraphBuilder().
| bool te::graph::FlowGraphBuilder::build | ( | const std::string & | shapeFileName, |
| const std::string & | linkColumn, | ||
| const int & | srid, | ||
| const std::string & | csvFileName, | ||
| const int & | fromIdx, | ||
| const int & | toIdx, | ||
| const int & | weightIdx, | ||
| const std::string & | dsInfo, | ||
| const std::string & | graphType, | ||
| const std::map< std::string, std::string > & | gInfo | ||
| ) |
Function used to build the output graph based on input parameters.
| shapeFileName | File name wiht vectorial data |
| linkColumn | Column name from vectorial data used as link column |
| srid | Vectorial projection id |
| csvFileName | CSV File name with flow data |
| fromIdx | Index for column table with origin information. |
| toIdx | Index for column table with destiny information. |
| weightIdx | Index for column table with weight information. |
| dsInfo | The necessary information to access the data source. |
| graphType | Attribute used to define the output graph type |
| gInfo | Container with graph generation parameters |
Definition at line 67 of file FlowGraphBuilder.cpp.
References createEdgeObjects(), createVertexObjects(), te::graph::AbstractGraphBuilder::m_graph, and te::graph::AbstractGraphFactory::make().
|
protected |
Function used to create all edges object based on flow table data.
| csvFileName | CSV File name with flow data |
| fromIdx | Index for column table with origin information. |
| toIdx | Index for column table with destiny information. |
| weightIdx | Index for column table with weight information. |
Definition at line 261 of file FlowGraphBuilder.cpp.
References getEdgeId(), te::dt::INT32_TYPE, line, te::graph::AbstractGraphBuilder::m_graph, p, te::dt::Property::setId(), and te::dt::Property::setParent().
Referenced by build().
|
protected |
Function used to create all vertex object based on vectorial data.
| shapeFileName | File name wiht vectorial data |
| linkColumn | Column name from vectorial data used as link column |
| srid | Vectorial projection id |
Definition at line 126 of file FlowGraphBuilder.cpp.
References te::graph::Vertex::addAttribute(), te::dt::Property::clone(), te::common::Convert2UCase(), ds, te::dt::GEOMETRY_TYPE, te::gm::CurvePolygon::getCentroid(), getDataSet(), getDataSource(), te::gm::Geometry::getGeomTypeId(), getProperties(), te::graph::AbstractGraphBuilder::m_graph, te::gm::MultiPolygonType, p, te::gm::PointType, te::gm::PolygonType, te::graph::Vertex::setAttributeVecSize(), te::gm::GeometryProperty::setGeometryType(), te::dt::Property::setId(), te::dt::Property::setParent(), te::gm::GeometryProperty::setSRID(), te::gm::Point::setSRID(), and te::gm::Geometry::setSRID().
Referenced by build().
|
protected |
Function used to get the data set with the vectorial data.
Definition at line 106 of file FlowGraphBuilder.cpp.
References te::da::DataSource::getDataSet(), and te::da::DataSource::getDataSetNames().
Referenced by createVertexObjects().
|
protected |
Function used to get the data source with the vectorial data.
Definition at line 97 of file FlowGraphBuilder.cpp.
References ds, and te::da::DataSourceFactory::make().
Referenced by createVertexObjects().
|
protected |
Function used to generated the edge id.
Definition at line 88 of file FlowGraphBuilder.cpp.
References m_edgeId.
Referenced by createEdgeObjects().
|
inherited |
Get error message.
Definition at line 41 of file AbstractGraphBuilder.cpp.
References te::graph::AbstractGraphBuilder::m_errorMessage.
Referenced by CreateLDDGraph().
|
inherited |
Get generated graph.
Definition at line 46 of file AbstractGraphBuilder.cpp.
References te::graph::AbstractGraphBuilder::m_graph.
Referenced by CreateLDDGraph().
|
protected |
Function used to get the data source properties.
Definition at line 117 of file FlowGraphBuilder.cpp.
References te::da::DataSource::getDataSetNames(), and te::da::DataSource::getProperties().
Referenced by createVertexObjects().
|
private |
Attribute used as a index counter for edge objects.
Definition at line 176 of file FlowGraphBuilder.h.
Referenced by FlowGraphBuilder(), and getEdgeId().
|
protectedinherited |
Error message.
Definition at line 84 of file AbstractGraphBuilder.h.
Referenced by te::graph::AbstractGraphBuilder::AbstractGraphBuilder(), and te::graph::AbstractGraphBuilder::getErrorMessage().
|
protectedinherited |
Graph object.
Definition at line 82 of file AbstractGraphBuilder.h.
Referenced by te::graph::AbstractGraphBuilder::AbstractGraphBuilder(), te::graph::QueryGraphBuilder::build(), te::graph::RAGGraphBuilder::build(), te::graph::LDDGraphBuilder::build(), build(), te::graph::RAGGraphBuilder::createEdgeObjects(), createEdgeObjects(), te::graph::RAGGraphBuilder::createVertexObjects(), createVertexObjects(), and te::graph::AbstractGraphBuilder::getGraph().