GraphExamples.h File Reference

These routines show how to use the Graph module. More...

#include <terralib/dataaccess/datasource/DataSource.h>
#include <terralib/geometry/Envelope.h>
#include <terralib/graph/core/AbstractGraph.h>
#include <terralib/raster/Raster.h>
#include "../Config.h"
#include <map>
#include <memory>
#include <string>

Go to the source code of this file.

Functions

int AddGraphEdgeAttribute (boost::shared_ptr< te::graph::AbstractGraph > graph, std::string attrName, int dataType)
 Auxiliar functions used to create a edge attribute in a graph, return the property idx. More...
 
int AddGraphVertexAttribute (boost::shared_ptr< te::graph::AbstractGraph > graph, std::string attrName, int dataType)
 Auxiliar functions used to create a vertex attribute in a graph, return the property idx. More...
 
int AssociateGraphVertexAttribute (te::da::DataSource *ds, std::string dataSetName, int idIdx, int attrIdx, boost::shared_ptr< te::graph::AbstractGraph > graph, int dataType, std::string attrName)
 Auxiliar functions used to create a vertex attribute in a graph and get the value from a dataset, return the property idx. More...
 
void CreateLDDGraph (bool draw)
 Creates a LDD GRAPH. More...
 
void CreateMSTGraph (bool draw)
 Creates a MST GRAPH. More...
 
std::unique_ptr< te::gm::EnvelopegetDataSetExtent (te::da::DataSource *ds, std::string dataSetName)
 Auxiliar functions used to get a dataset extent. More...
 
void LoadModules ()
 It loads the data source drivers. More...
 
std::unique_ptr< te::da::DataSourceOpenOGRDataSource (const std::string &pathName)
 Auxiliar functions for load a org data source. More...
 
std::unique_ptr< te::rst::RasterOpenRaster (const std::string &pathName, const int &srid)
 Auxiliar functions for load a raster. More...
 

Detailed Description

These routines show how to use the Graph module.

Definition in file GraphExamples.h.

Function Documentation

int AddGraphEdgeAttribute ( boost::shared_ptr< te::graph::AbstractGraph graph,
std::string  attrName,
int  dataType 
)

Auxiliar functions used to create a edge attribute in a graph, return the property idx.

Definition at line 118 of file examples/graph/Functions.cpp.

References p, te::dt::Property::setId(), and te::dt::Property::setParent().

int AddGraphVertexAttribute ( boost::shared_ptr< te::graph::AbstractGraph graph,
std::string  attrName,
int  dataType 
)

Auxiliar functions used to create a vertex attribute in a graph, return the property idx.

Definition at line 94 of file examples/graph/Functions.cpp.

References p, te::dt::Property::setId(), and te::dt::Property::setParent().

Referenced by AssociateGraphVertexAttribute().

int AssociateGraphVertexAttribute ( te::da::DataSource ds,
std::string  dataSetName,
int  idIdx,
int  attrIdx,
boost::shared_ptr< te::graph::AbstractGraph graph,
int  dataType,
std::string  attrName 
)

Auxiliar functions used to create a vertex attribute in a graph and get the value from a dataset, return the property idx.

Definition at line 58 of file examples/graph/Functions.cpp.

References te::graph::Vertex::addAttribute(), AddGraphVertexAttribute(), te::da::DataSource::getDataSet(), and te::graph::Vertex::setAttributeVecSize().

std::unique_ptr<te::gm::Envelope> getDataSetExtent ( te::da::DataSource ds,
std::string  dataSetName 
)

Auxiliar functions used to get a dataset extent.

Definition at line 49 of file examples/graph/Functions.cpp.

References te::da::DataSource::getDataSet(), and te::da::GetFirstSpatialPropertyPos().

void LoadModules ( )

It loads the data source drivers.

It loads the data source drivers.

Load terralib modules.

It loads the data source drivers.

Definition at line 38 of file attic/unittest/dataaccess/LoadModules.h.

std::unique_ptr<te::da::DataSource> OpenOGRDataSource ( const std::string &  pathName)

Auxiliar functions for load a org data source.

Definition at line 43 of file examples/graph/Functions.cpp.

References OpenDataSource().

Referenced by CreateMSTGraph().

std::unique_ptr<te::rst::Raster> OpenRaster ( const std::string &  pathName,
const int srid 
)

Auxiliar functions for load a raster.

Definition at line 18 of file examples/graph/Functions.cpp.

References te::rst::Raster::getGrid(), te::rst::RasterFactory::open(), mixture::rst, and te::rst::Grid::setSRID().

Referenced by CreateLDDGraph().