27 #include "../../dataaccess/dataset/DataSet.h" 28 #include "../../dataaccess/dataset/DataSetType.h" 29 #include "../../dataaccess/datasource/DataSource.h" 30 #include "../../dataaccess/datasource/DataSourceFactory.h" 31 #include "../../dataaccess/datasource/DataSourceInfoManager.h" 32 #include "../../dataaccess/datasource/DataSourceManager.h" 33 #include "../../dataaccess/utils/Utils.h" 34 #include "../../datatype/AbstractData.h" 35 #include "../../datatype/SimpleProperty.h" 36 #include "../../geometry/GeometryProperty.h" 37 #include "../../geometry/MultiPolygon.h" 38 #include "../../geometry/Point.h" 39 #include "../../geometry/Polygon.h" 40 #include "../../graph/core/AbstractGraph.h" 41 #include "../../graph/core/GraphMetadata.h" 42 #include "../../graph/core/Vertex.h" 43 #include "../../maptools/AbstractLayer.h" 44 #include "../../maptools/DataSetLayer.h" 45 #include "../../raster/Grid.h" 46 #include "../../raster/RasterProperty.h" 47 #include "../../se/Utils.h" 55 #include <boost/uuid/random_generator.hpp> 56 #include <boost/uuid/uuid_io.hpp> 62 std::unique_ptr<te::da::DataSet> dataSet = ds->
getDataSet(dataSetName);
87 std::string strIdx = dataSet->
getAsString(attrLink);
89 int idx = atoi(strIdx.c_str());
99 v->addAttribute(attrGraphIdx, ad);
204 std::string strValue = ad->
toString();
206 return atof(strValue.c_str());
224 return (static_cast<te::gm::Polygon*>(geom))->getArea();
228 return (static_cast<te::gm::MultiPolygon*>(geom))->getArea();
void setAttributeVecSize(int size)
This function is used to set the number of attributes associated with the vertex elements.
void setSRID(int srid) _NOEXCEPT_OP(true)
It sets the Spatial Reference System ID of the Point.
An atomic property like an integer or double.
virtual double distance(const Geometry *const rhs) const _NOEXCEPT_OP(false)
It returns the shortest distance between any two points in the two geometry objects.
This class defines a Generalized Proximity Matrix.
GeomType getGeomTypeId() const _NOEXCEPT_OP(true)
It returns the geometry subclass type identifier.
virtual void addEdgeProperty(te::dt::Property *p)=0
Add a new property associated to the edge element.
An utility struct for representing 2D coordinates.
static te::dt::Date ds(2010, 01, 01)
An abstract class for data providers like a DBMS, Web Services or a regular file. ...
virtual te::dt::Property * getVertexProperty(int idx)=0
Get a vertex property given a index.
It models a property definition.
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.
virtual te::graph::GraphMetadata * getMetadata()=0
Function used to access the graph metadata.
virtual bool moveNext()=0
It moves the internal pointer to the next item of the collection.
TESAEXPORT double GetArea(te::gm::Geometry *geom)
Function used to get area of a geometry.
virtual std::string toString() const =0
It returns the data value in a string notation.
int getSRID() const _NOEXCEPT_OP(true)
It returns the Spatial Reference System ID associated to this geometric object.
A point with x and y coordinate values.
virtual void addVertexProperty(te::dt::Property *p)=0
Add a new property associated to the vertex element.
Abstract class used to define the main functions of graph struct. All graph implementations must used...
virtual std::string getAsString(std::size_t i, int precision=0) const
Method for retrieving a data value as a string plain representation.
A base class for values that can be retrieved from the data access module.
TESAEXPORT int AddGraphVertexAttribute(te::graph::AbstractGraph *graph, std::string attrName, int dataType, int srid=TE_UNKNOWN_SRS, int subType=static_cast< int >(te::gm::UnknownGeometryType))
Function used to create the vertex attribute metadata in the graph of the gpm.
Utility functions for the data access module.
TESAEXPORT int AssociateGPMVertexAttribute(te::sa::GeneralizedProximityMatrix *gpm, te::da::DataSource *ds, std::string dataSetName, std::string attrLink, std::string attr, int dataType, int srid=TE_UNKNOWN_SRS, int subType=static_cast< int >(te::gm::UnknownGeometryType))
Function used to set a an attribute valeu from a dataset to the vertex objects from a gpm...
Geometry is the root class of the geometries hierarchy, it follows OGC and ISO standards.
virtual int getEdgePropertySize()=0
Used to verify the number of properties associated to edge elements.
virtual int getVertexPropertySize()=0
Used to verify the number of properties associated to vertex elements.
A dataset is the unit of information manipulated by the data access module of TerraLib.
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...
virtual te::dt::Property * getEdgeProperty(int idx)=0
Get a edge property given a index.
virtual std::unique_ptr< te::dt::AbstractData > getValue(std::size_t i) const
Method for retrieving any other type of data value stored in the data source.
TESAEXPORT bool GetGraphVertexAttrIndex(te::graph::AbstractGraph *graph, std::string attrName, int &index)
Function used to get the vertex attribute index in the graph of the gpm.
virtual bool moveBeforeFirst()=0
It moves the internal pointer to a position before the first item in the collection.
TESAEXPORT double CalculateDistance(te::gm::Geometry *geom, te::gm::Coord2D &coord)
Function used to calculate the distance from a coord to the center of a geometry. ...
TESAEXPORT int AddGraphEdgeAttribute(te::graph::AbstractGraph *graph, std::string attrName, int dataType)
Function used to create the edge attribute metadata in the graph of the gpm.
TESAEXPORT double GetDataValue(te::dt::AbstractData *ad)
Function used to get the numeric value from a gpm property.
virtual te::graph::Vertex * getVertex(int id)=0
It returns the vertex element if it's exist.
TESAEXPORT bool GetGraphEdgeAttrIndex(te::graph::AbstractGraph *graph, std::string attrName, int &index)
Function used to get the edge attribute index in the graph of the gpm.
te::graph::AbstractGraph * getGraph()
const std::string & getName() const
It returns the property name.
This class defines the GPM class.
void setParent(Property *p)
It associate this property to the informed parent.