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::auto_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());
211 double distance = std::numeric_limits<double>::max();
213 std::auto_ptr<te::gm::Point> point(
new te::gm::Point(coord.
x, coord.
y));
215 point->setSRID(geom->
getSRID());
221 distance = p->
distance(point.get());
227 distance = p->
distance(point.get());
235 distance = p->
distance(point.get());
int getSRID() const
It returns the Spatial Reference System ID associated to this geometric object.
MultiPolygon is a MultiSurface whose elements are Polygons.
void setAttributeVecSize(int size)
This function is used to set the number of attributes associated with the vertex elements.
GeomType
Each enumerated type is compatible with a Well-known Binary (WKB) type code.
Utility functions for the data access module.
An atomic property like an integer or double.
This class defines a Generalized Proximity Matrix.
virtual void addEdgeProperty(te::dt::Property *p)=0
Add a new property associated to the edge element.
TESAEXPORT te::gm::Coord2D GetCentroidCoord(te::gm::Geometry *geom)
Function used to get centroid coord of a geometry.
virtual std::string toString() const =0
It returns the data value in a string notation.
An utility struct for representing 2D coordinates.
An abstract class for data providers like a DBMS, Web Services or a regular file. ...
TESAEXPORT int AddGraphVertexAttribute(te::graph::AbstractGraph *graph, std::string attrName, int dataType, int srid=TE_UNKNOWN_SRS, int subType=te::gm::UnknownGeometryType)
Function used to create the vertex attribute metadata in the graph of the gpm.
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.
const double & getY() const
It returns the Point y-coordinate value.
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::auto_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 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.
GeomType getGeomTypeId() const
It returns the geometry subclass type identifier.
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.
Polygon is a subclass of CurvePolygon whose rings are defined by linear rings.
virtual te::dt::Property * getEdgeProperty(int idx)=0
Get a edge property given a index.
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.
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=te::gm::UnknownGeometryType)
Function used to set a an attribute valeu from a dataset to the vertex objects from a gpm...
virtual te::graph::Vertex * getVertex(int id)=0
It returns the vertex element if it's exist.
virtual double distance(const Geometry *const rhs) const
It returns the shortest distance between any two points in the two geometry objects.
const double & getX() const
It returns the Point x-coordinate value.
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.
virtual std::auto_ptr< te::dt::AbstractData > getValue(std::size_t i) const
Method for retrieving any other type of data value stored in the data source.
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.