This class defines functions used to load and save graphs using GAL and GWT formats, both formats use a ' ' as separator. More...
#include <SpatialWeightsExchanger.h>
Public Member Functions | |
void | exportToGAL (te::graph::AbstractGraph *g, std::string pathFileName, std::string dataSetName="", std::string propertyName="") |
Function used to export a graph to Spatial Weights File GAL Format. More... | |
void | exportToGWT (te::graph::AbstractGraph *g, std::string pathFileName, int distAttrIdx, std::string dataSetName="", std::string propertyName="") |
Function used to export a graph to Spatial Weights File GWT Format. More... | |
te::graph::AbstractGraph * | importFromGAL (std::string pathFileName, std::map< std::string, std::string > dsInfo, std::string graphType, std::map< std::string, std::string > gInfo, te::da::DataSource *ds=0) |
Function used to import a graph from a Spatial Weights File GAL Format. More... | |
te::graph::AbstractGraph * | importFromGWT (std::string pathFileName, std::map< std::string, std::string > dsInfo, std::string graphType, std::map< std::string, std::string > gInfo, te::da::DataSource *ds=0) |
Function used to import a graph from a Spatial Weights File GWT Format. More... | |
SpatialWeightsExchanger () | |
Default constructor. More... | |
~SpatialWeightsExchanger () | |
Virtual destructor. More... | |
Protected Member Functions | |
void | associateGeometry (te::graph::AbstractGraph *g, te::da::DataSource *ds, std::string dataSetName, std::string propertyName) |
Function used to associate the geometry coord attribute to vertex objects. More... | |
int | getEdgeId () |
Function used to generated the edge id. More... | |
Private Attributes | |
int | m_edgeId |
Attribute used as a index counter for edge objects. More... | |
This class defines functions used to load and save graphs using GAL and GWT formats, both formats use a ' ' as separator.
Definition at line 74 of file SpatialWeightsExchanger.h.
te::graph::SpatialWeightsExchanger::SpatialWeightsExchanger | ( | ) |
Default constructor.
Definition at line 73 of file SpatialWeightsExchanger.cpp.
te::graph::SpatialWeightsExchanger::~SpatialWeightsExchanger | ( | ) |
Virtual destructor.
Definition at line 77 of file SpatialWeightsExchanger.cpp.
|
protected |
Function used to associate the geometry coord attribute to vertex objects.
g | Pointer to a valid graph |
ds | Pointer to a valid data source |
dataSetName | Data Set name that contains the geometry information |
propertyName | The attribute name used as vertex id and dataset id column |
Definition at line 442 of file SpatialWeightsExchanger.cpp.
References te::graph::Vertex::addAttribute(), te::graph::AbstractGraph::addVertexProperty(), te::dt::AbstractData::clone(), te::gm::CurvePolygon::getCentroid(), te::da::DataSource::getDataSet(), te::da::DataSource::getDataSetType(), te::da::GetFirstGeomProperty(), te::da::GetFirstSpatialPropertyPos(), te::gm::GeometryProperty::getSRID(), te::graph::AbstractGraph::getVertex(), te::gm::MultiPolygonType, te::gm::PointType, te::gm::PolygonType, te::graph::Vertex::setAttributeVecSize(), te::graph::Vertex::setDirty(), and te::gm::AbstractPoint::setSRID().
void te::graph::SpatialWeightsExchanger::exportToGAL | ( | te::graph::AbstractGraph * | g, |
std::string | pathFileName, | ||
std::string | dataSetName = "" , |
||
std::string | propertyName = "" |
||
) |
Function used to export a graph to Spatial Weights File GAL Format.
g | Pointer to a valid graph |
pathFileName | Path and file name (with extension) for file creation. |
dataSetName | Data Set name that contains the geometry information |
propertyName | The attribute name used as vertex id and dataset id column |
Definition at line 81 of file SpatialWeightsExchanger.cpp.
References te::graph::GraphMetadata::getDataSource(), te::graph::AbstractGraph::getEdge(), te::graph::Vertex::getId(), te::graph::Edge::getIdFrom(), te::graph::Edge::getIdTo(), te::graph::AbstractGraph::getMetadata(), and te::graph::Vertex::getNeighborhood().
void te::graph::SpatialWeightsExchanger::exportToGWT | ( | te::graph::AbstractGraph * | g, |
std::string | pathFileName, | ||
int | distAttrIdx, | ||
std::string | dataSetName = "" , |
||
std::string | propertyName = "" |
||
) |
Function used to export a graph to Spatial Weights File GWT Format.
g | Pointer to a valid graph |
pathFileName | Path and file name (with extension) for file creation. |
dataSetName | Data Set name that contains the geometry information |
propertyName | The attribute name used as vertex id and dataset id column |
Definition at line 269 of file SpatialWeightsExchanger.cpp.
References te::graph::Edge::getAttributes(), te::graph::GraphMetadata::getDataSource(), te::graph::Edge::getIdFrom(), te::graph::Edge::getIdTo(), te::graph::AbstractGraph::getMetadata(), and te::dt::SimpleData< T, typeCode >::getValue().
|
protected |
Function used to generated the edge id.
Definition at line 433 of file SpatialWeightsExchanger.cpp.
te::graph::AbstractGraph * te::graph::SpatialWeightsExchanger::importFromGAL | ( | std::string | pathFileName, |
std::map< std::string, std::string > | dsInfo, | ||
std::string | graphType, | ||
std::map< std::string, std::string > | gInfo, | ||
te::da::DataSource * | ds = 0 |
||
) |
Function used to import a graph from a Spatial Weights File GAL Format.
pathFileName | Path and file name (with extension) with Spatial Weights information. |
dsInfo | Container with data source information |
graphType | Attribute used to define the output graph type |
gInfo | Container with graph generation parameters |
ds | Pointer to a datasource in case the gal file has the shapefile information. |
Definition at line 149 of file SpatialWeightsExchanger.cpp.
References te::graph::AbstractGraph::add(), te::graph::AbstractGraph::getVertex(), and te::graph::AbstractGraphFactory::make().
te::graph::AbstractGraph * te::graph::SpatialWeightsExchanger::importFromGWT | ( | std::string | pathFileName, |
std::map< std::string, std::string > | dsInfo, | ||
std::string | graphType, | ||
std::map< std::string, std::string > | gInfo, | ||
te::da::DataSource * | ds = 0 |
||
) |
Function used to import a graph from a Spatial Weights File GWT Format.
pathFileName | Path and file name (with extension) with Spatial Weights information. |
dsInfo | Container with data source information |
graphType | Attribute used to define the output graph type |
gInfo | Container with graph generation parameters |
ds | Pointer to a datasource in case the gwt file has the shapefile information. |
Definition at line 320 of file SpatialWeightsExchanger.cpp.
References te::graph::AbstractGraph::add(), te::graph::AbstractGraph::addEdgeProperty(), te::dt::DOUBLE_TYPE, te::graph::AbstractGraph::getVertex(), te::graph::AbstractGraphFactory::make(), te::dt::Property::setId(), and te::dt::Property::setParent().
|
private |
Attribute used as a index counter for edge objects.
Definition at line 161 of file SpatialWeightsExchanger.h.