18 std::unique_ptr<te::rst::Raster>
OpenRaster(
const std::string& pathName,
const int& srid)
20 std::cout << std::endl <<
"Open Raster: " << pathName << std::endl;
23 std::map<std::string, std::string> rinfo;
24 rinfo[
"URI"] = pathName;
30 std::unique_ptr<te::rst::Raster>
rst(raster);
35 std::unique_ptr<te::da::DataSource>
OpenDataSource(std::string connInfo, std::string dsType)
45 std::string connInfo(
"file://" + pathName);
51 std::unique_ptr<te::da::DataSet> dataSet = ds->
getDataSet(dataSetName);
55 return dataSet->getExtent(geomPos);
66 int attrSize = graph->getMetadata()->getVertexPropertySize();
69 std::unique_ptr<te::da::DataSet> dataSet = ds->
getDataSet(dataSetName);
71 dataSet->moveBeforeFirst();
73 while(dataSet->moveNext())
77 int idx = dataSet->getInt32(idIdx);
101 graph->addVertexProperty(p);
106 for(
int i = 0; i < graph->getVertexPropertySize(); ++ i)
108 if(graph->getVertexProperty(i)->getName() == attrName)
125 graph->addEdgeProperty(p);
130 for(
int i = 0; i < graph->getEdgePropertySize(); ++ i)
132 if(graph->getEdgeProperty(i)->getName() == attrName)
std::unique_ptr< te::da::DataSource > OpenDataSource(std::string connInfo, std::string dsType)
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...
void setAttributeVecSize(int size)
This function is used to set the number of attributes associated with the vertex elements.
static std::unique_ptr< DataSource > make(const std::string &driver, const te::core::URI &connInfo)
std::unique_ptr< te::rst::Raster > OpenRaster(const std::string &pathName, const int &srid)
Auxiliar functions for load a raster.
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...
An atomic property like an integer or double.
An abstract class for data providers like a DBMS, Web Services or a regular file. ...
static te::dt::Date ds(2010, 01, 01)
An abstract class for data providers like a DBMS, Web Services or a regular file. ...
From the point of view of graph theory, vertices are treated as featureless and indivisible objects...
void setId(unsigned int id)
It sets the property identifier.
Abstract class used to define the main functions of graph struct. All graph implementations must used...
This is the abstract factory for Rasters.
TEDATAACCESSEXPORT std::size_t GetFirstSpatialPropertyPos(const te::da::DataSet *dataset)
It returns the first dataset spatial property or NULL if none is found.
An abstract class for raster data strucutures.
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...
A factory for data sources.
A base class for values that can be retrieved from the data access module.
From the point of view of graph theory, vertices are treated as featureless and indivisible objects...
Grid * getGrid()
It returns the raster grid.
Utility functions for the data access module.
virtual std::unique_ptr< DataSet > getDataSet(const std::string &name, te::common::TraverseType travType=te::common::FORWARDONLY, const te::common::AccessPolicy accessPolicy=te::common::RAccess)
It gets the dataset identified by the given name. This method always returns a disconnected dataset...
A rectified grid is the spatial support for raster data.
std::unique_ptr< te::gm::Envelope > getDataSetExtent(te::da::DataSource *ds, std::string dataSetName)
Auxiliar functions used to get a dataset extent.
An atomic property like an integer or double.
void setSRID(int srid)
Just sets the grid spatial reference system identifier.
void addAttribute(int idx, te::dt::AbstractData *ad)
Add a new attribute to this element.
These routines show how to use the Graph module.
std::unique_ptr< te::da::DataSource > OpenOGRDataSource(const std::string &pathName)
Auxiliar functions for load a org data source.
static Raster * open(const std::map< std::string, std::string > &rinfo, te::common::AccessPolicy p=te::common::RAccess)
It opens a raster with the given parameters and default raster driver.
void setParent(Property *p)
It associate this property to the informed parent.