This class defines functions used to load and save gpm's using GAL and GWT formats, both formats use a ' ' as separator. More...
#include <SpatialWeightsExchanger.h>
Public Member Functions | |
void | exportToGAL (te::sa::GeneralizedProximityMatrix *gpm, std::string pathFileName) |
Function used to export a gpm to Spatial Weights File GAL Format. More... | |
void | exportToGWT (te::sa::GeneralizedProximityMatrix *gpm, std::string pathFileName, int distAttrIdx) |
Function used to export a gpm to Spatial Weights File GWT Format. More... | |
te::sa::GeneralizedProximityMatrix * | importFromGAL (std::string pathFileName, te::da::DataSource *ds=0) |
Function used to import a gpm from a Spatial Weights File GAL Format. More... | |
te::sa::GeneralizedProximityMatrix * | importFromGWT (std::string pathFileName, te::da::DataSource *ds=0) |
Function used to import a gpm from a Spatial Weights File GWT Format. More... | |
SpatialWeightsExchanger () | |
Default constructor. More... | |
~SpatialWeightsExchanger () | |
Virtual destructor. More... | |
Static Public Member Functions | |
static void | getSpatialWeightsFileInfo (std::string pathFileName, std::string &dataSetName, std::string &attrName) |
Function used to get information of how a Spatial Weights was generated. More... | |
Protected Member Functions | |
void | associateGeometry (te::sa::GeneralizedProximityMatrix *gpm, te::da::DataSource *ds) |
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 gpm's using GAL and GWT formats, both formats use a ' ' as separator.
Definition at line 74 of file SpatialWeightsExchanger.h.
te::sa::SpatialWeightsExchanger::SpatialWeightsExchanger | ( | ) |
Default constructor.
Definition at line 78 of file SpatialWeightsExchanger.cpp.
te::sa::SpatialWeightsExchanger::~SpatialWeightsExchanger | ( | ) |
Virtual destructor.
Definition at line 82 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 |
Definition at line 582 of file SpatialWeightsExchanger.cpp.
References te::graph::AbstractGraph::addVertexProperty(), te::dt::AbstractData::clone(), te::sa::GeneralizedProximityMatrix::getAttributeName(), te::gm::CurvePolygon::getCentroid(), te::da::DataSource::getDataSet(), te::sa::GeneralizedProximityMatrix::getDataSetName(), te::da::DataSource::getDataSetType(), te::da::GetFirstGeomProperty(), te::da::GetFirstSpatialPropertyPos(), te::sa::GeneralizedProximityMatrix::getGraph(), te::gm::GeometryProperty::getSRID(), te::graph::AbstractGraph::getVertex(), te::gm::MultiPolygonType, te::gm::PointType, te::gm::PolygonType, te::graph::Vertex::setAttributeVecSize(), te::gm::AbstractPoint::setSRID(), te::common::TaskProgress::setTotalSteps(), TE_SA_GEOMETRY_ATTR_NAME, and TE_TR.
void te::sa::SpatialWeightsExchanger::exportToGAL | ( | te::sa::GeneralizedProximityMatrix * | gpm, |
std::string | pathFileName | ||
) |
Function used to export a gpm to Spatial Weights File GAL Format.
gpm | Pointer to a valid graph |
pathFileName | Path and file name (with extension) for file creation. |
Definition at line 86 of file SpatialWeightsExchanger.cpp.
References te::sa::GeneralizedProximityMatrix::getAttributeName(), te::sa::GeneralizedProximityMatrix::getDataSetName(), te::graph::GraphMetadata::getDataSource(), te::graph::AbstractGraph::getEdge(), te::sa::GeneralizedProximityMatrix::getGraph(), te::graph::Vertex::getId(), te::graph::Edge::getIdFrom(), te::graph::Edge::getIdTo(), te::graph::AbstractGraph::getMetadata(), te::graph::Vertex::getSuccessors(), te::common::TaskProgress::isActive(), te::common::TaskProgress::pulse(), te::common::TaskProgress::setMessage(), te::common::TaskProgress::setTotalSteps(), and TE_TR.
void te::sa::SpatialWeightsExchanger::exportToGWT | ( | te::sa::GeneralizedProximityMatrix * | gpm, |
std::string | pathFileName, | ||
int | distAttrIdx | ||
) |
Function used to export a gpm to Spatial Weights File GWT Format.
gpm | Pointer to a valid graph |
pathFileName | Path and file name (with extension) for file creation. |
distAttrIdx | Edge Atrribute index with distance information |
Definition at line 328 of file SpatialWeightsExchanger.cpp.
References te::sa::GeneralizedProximityMatrix::getAttributeName(), te::graph::Edge::getAttributes(), te::sa::GeneralizedProximityMatrix::getDataSetName(), te::graph::GraphMetadata::getDataSource(), te::sa::GeneralizedProximityMatrix::getGraph(), te::graph::Edge::getIdFrom(), te::graph::Edge::getIdTo(), te::graph::AbstractGraph::getMetadata(), te::dt::SimpleData< T, typeCode >::getValue(), te::common::TaskProgress::isActive(), te::common::TaskProgress::pulse(), te::common::TaskProgress::setMessage(), te::common::TaskProgress::setTotalSteps(), and TE_TR.
|
protected |
Function used to generated the edge id.
Definition at line 573 of file SpatialWeightsExchanger.cpp.
|
static |
Function used to get information of how a Spatial Weights was generated.
pathFileName | Path and file name (with extension) with Spatial Weights information. |
dataSetName | Information about the dataset used to generate this file. |
attrName | Information about the attribute used to generate this file. |
Definition at line 546 of file SpatialWeightsExchanger.cpp.
Referenced by te::sa::SpatialStatisticsDialog::onGPMToolButtonClicked(), te::sa::BayesLocalDialog::onGPMToolButtonClicked(), and te::sa::SkaterDialog::onGPMToolButtonClicked().
te::sa::GeneralizedProximityMatrix * te::sa::SpatialWeightsExchanger::importFromGAL | ( | std::string | pathFileName, |
te::da::DataSource * | ds = 0 |
||
) |
Function used to import a gpm from a Spatial Weights File GAL Format.
pathFileName | Path and file name (with extension) with Spatial Weights information. |
ds | Pointer to a datasource in case the gal file has the shapefile information. |
Definition at line 171 of file SpatialWeightsExchanger.cpp.
References te::graph::AbstractGraph::add(), te::sa::GeneralizedProximityMatrix::getGraph(), te::graph::AbstractGraph::getVertex(), te::common::TaskProgress::isActive(), te::graph::AbstractGraphFactory::make(), te::common::TaskProgress::pulse(), te::sa::GeneralizedProximityMatrix::setAttributeName(), te::sa::GeneralizedProximityMatrix::setDataSetName(), te::sa::GeneralizedProximityMatrix::setGraph(), te::common::TaskProgress::setMessage(), te::common::TaskProgress::setTotalSteps(), te::graph::Globals::sm_factoryGraphTypeDirectedGraph, and TE_TR.
Referenced by te::sa::SkaterDialog::loadGPM(), te::sa::SpatialStatisticsDialog::loadGPM(), and te::sa::BayesLocalDialog::loadGPM().
te::sa::GeneralizedProximityMatrix * te::sa::SpatialWeightsExchanger::importFromGWT | ( | std::string | pathFileName, |
te::da::DataSource * | ds = 0 |
||
) |
Function used to import a gpm from a Spatial Weights File GWT Format.
pathFileName | Path and file name (with extension) with Spatial Weights information. |
ds | Pointer to a datasource in case the gwt file has the shapefile information. |
Definition at line 396 of file SpatialWeightsExchanger.cpp.
References te::graph::AbstractGraph::add(), te::graph::AbstractGraph::addEdgeProperty(), te::dt::DOUBLE_TYPE, te::sa::GeneralizedProximityMatrix::getGraph(), te::graph::AbstractGraph::getVertex(), te::common::TaskProgress::isActive(), te::graph::AbstractGraphFactory::make(), te::common::TaskProgress::pulse(), te::sa::GeneralizedProximityMatrix::setAttributeName(), te::sa::GeneralizedProximityMatrix::setDataSetName(), te::sa::GeneralizedProximityMatrix::setGraph(), te::dt::Property::setId(), te::common::TaskProgress::setMessage(), te::dt::Property::setParent(), te::common::TaskProgress::setTotalSteps(), te::graph::Globals::sm_factoryGraphTypeDirectedGraph, TE_SA_WEIGHT_ATTR_NAME, and TE_TR.
Referenced by te::sa::SkaterDialog::loadGPM(), te::sa::SpatialStatisticsDialog::loadGPM(), and te::sa::BayesLocalDialog::loadGPM().
|
private |
Attribute used as a index counter for edge objects.
Definition at line 160 of file SpatialWeightsExchanger.h.