This class defines the GPM strategy to build a graph,. More...
#include <GPMGraphBuilder.h>
Public Member Functions | |
GPMGraphBuilder () | |
Default constructor. More... | |
virtual | ~GPMGraphBuilder () |
Virtual destructor. 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 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... | |
Methods | |
bool | setGraphInfo (const std::map< std::string, std::string > &dsInfo, const std::string &graphType, const std::map< std::string, std::string > &gInfo) |
Function used to create a empty graph. More... | |
bool | buildAdjacency (std::auto_ptr< te::da::DataSource > ds, std::string dataSetName, std::string columnId, bool calcDist) |
Function used to generated a graph using the GPM Adjacency Strategy. More... | |
bool | buildDistance (std::auto_ptr< te::da::DataSource > ds, std::string dataSetName, std::string columnId, double dist) |
Function used to generated a graph using the GPM Distance Strategy. More... | |
void | createVertexObjects (te::da::DataSet *dataSet, std::string columnId, int srid) |
Function used to create all vertex object based on data set. More... | |
void | createAdjacencyEdges (te::da::DataSet *dataSet, std::string columnId, bool calcDist) |
Function used to create all edges object based on data set, using the adjacency strategy. More... | |
void | createDistanceEdges (te::da::DataSet *dataSet, std::string columnId, double distance) |
Function used to create all edges object based on data set, using the distance strategy. More... | |
int | getEdgeId () |
Function used to generated the edge id. More... | |
This class defines the GPM strategy to build a graph,.
This is builder uses diferent strategies to build a graph based on a generalized proximity matrix.
Definition at line 68 of file GPMGraphBuilder.h.
te::graph::GPMGraphBuilder::GPMGraphBuilder | ( | ) |
|
virtual |
Virtual destructor.
Definition at line 60 of file GPMGraphBuilder.cpp.
bool te::graph::GPMGraphBuilder::buildAdjacency | ( | std::auto_ptr< te::da::DataSource > | ds, |
std::string | dataSetName, | ||
std::string | columnId, | ||
bool | calcDist | ||
) |
Function used to generated a graph using the GPM Adjacency Strategy.
ds | File name wiht vectorial data |
dataSetName | Data Set name that contains the geometry information |
columnId | Column id from vectorial data used as link column |
calcDist | Flag used to indicate if has to create the distance attribute |
Definition at line 74 of file GPMGraphBuilder.cpp.
References te::da::GetFirstGeomProperty(), and te::gm::GeometryProperty::getSRID().
bool te::graph::GPMGraphBuilder::buildDistance | ( | std::auto_ptr< te::da::DataSource > | ds, |
std::string | dataSetName, | ||
std::string | columnId, | ||
double | dist | ||
) |
Function used to generated a graph using the GPM Distance Strategy.
ds | File name wiht vectorial data |
dataSetName | Data Set name that contains the geometry information |
columnId | Column id from vectorial data used as link column |
dist | Value with distance information. |
Definition at line 89 of file GPMGraphBuilder.cpp.
References te::da::GetFirstGeomProperty(), and te::gm::GeometryProperty::getSRID().
|
protected |
Function used to create all edges object based on data set, using the adjacency strategy.
dataSet | Valid pointer to a dataset |
columnId | Column name from vectorial data used as link column |
calcDist | Flag used to indicate if has to create the distance attribute |
Definition at line 160 of file GPMGraphBuilder.cpp.
References te::graph::Edge::addAttribute(), te::gm::Geometry::distance(), te::dt::DOUBLE_TYPE, te::common::FreeContents(), te::graph::Vertex::getAttributes(), te::da::GetFirstSpatialPropertyPos(), te::da::DataSet::getGeometry(), te::da::DataSet::getInt32(), te::gm::Geometry::getMBR(), te::sam::rtree::Index< DATATYPE, MAXNODES, MINNODES >::insert(), te::da::DataSet::moveBeforeFirst(), te::da::DataSet::moveNext(), te::common::TaskProgress::pulse(), te::sam::rtree::Index< DATATYPE, MAXNODES, MINNODES >::search(), te::graph::Edge::setAttributeVecSize(), te::dt::Property::setId(), te::common::TaskProgress::setMessage(), te::dt::Property::setParent(), te::common::TaskProgress::setTotalSteps(), and te::da::DataSet::size().
|
protected |
Function used to create all edges object based on data set, using the distance strategy.
dataSet | Valid pointer to a dataset |
columnId | Column name from vectorial data used as link column |
distance | Value with distance information. |
Definition at line 251 of file GPMGraphBuilder.cpp.
References te::graph::Edge::addAttribute(), te::gm::Geometry::distance(), te::dt::DOUBLE_TYPE, te::common::FreeContents(), te::graph::Vertex::getAttributes(), te::da::GetFirstSpatialPropertyPos(), te::da::DataSet::getGeometry(), te::da::DataSet::getInt32(), te::gm::Geometry::getMBR(), te::sam::rtree::Index< DATATYPE, MAXNODES, MINNODES >::insert(), te::gm::Envelope::m_llx, te::da::DataSet::moveBeforeFirst(), te::da::DataSet::moveNext(), te::common::TaskProgress::pulse(), te::sam::rtree::Index< DATATYPE, MAXNODES, MINNODES >::search(), te::graph::Edge::setAttributeVecSize(), te::dt::Property::setId(), te::common::TaskProgress::setMessage(), te::dt::Property::setParent(), te::common::TaskProgress::setTotalSteps(), and te::da::DataSet::size().
|
protected |
Function used to create all vertex object based on data set.
dataSet | Valid pointer to a dataset |
columnId | Column name from vectorial data used as link column |
srid | Vectorial projection id |
Definition at line 104 of file GPMGraphBuilder.cpp.
References te::graph::Vertex::addAttribute(), te::dt::AbstractData::clone(), te::gm::CurvePolygon::getCentroid(), te::da::GetFirstSpatialPropertyPos(), te::da::DataSet::getGeometry(), te::da::DataSet::getInt32(), te::da::DataSet::moveBeforeFirst(), te::da::DataSet::moveNext(), te::gm::MultiPolygonType, te::gm::PointType, te::gm::PolygonType, te::graph::Vertex::setAttributeVecSize(), te::gm::GeometryProperty::setGeometryType(), te::dt::Property::setId(), te::gm::GeometryProperty::setSRID(), and te::gm::AbstractPoint::setSRID().
|
protected |
Function used to generated the edge id.
Definition at line 343 of file GPMGraphBuilder.cpp.
|
inherited |
Get error message.
Definition at line 43 of file AbstractGraphBuilder.cpp.
|
inherited |
Get generated graph.
Definition at line 48 of file AbstractGraphBuilder.cpp.
bool te::graph::GPMGraphBuilder::setGraphInfo | ( | const std::map< std::string, std::string > & | dsInfo, |
const std::string & | graphType, | ||
const std::map< std::string, std::string > & | gInfo | ||
) |
Function used to create a empty graph.
dsInfo | Container with data source information |
graphType | Attribute used to define the output graph type |
gInfo | Container with graph generation parameters |
Definition at line 64 of file GPMGraphBuilder.cpp.
References te::graph::AbstractGraphFactory::make().
|
private |
Attribute used as a index counter for edge objects.
Definition at line 167 of file GPMGraphBuilder.h.
Referenced by GPMGraphBuilder().
|
protectedinherited |
Error message.
Definition at line 84 of file AbstractGraphBuilder.h.
Referenced by te::graph::AbstractGraphBuilder::AbstractGraphBuilder().
|
protectedinherited |
Graph object.
Definition at line 82 of file AbstractGraphBuilder.h.
Referenced by te::graph::AbstractGraphBuilder::AbstractGraphBuilder().