27 #include "../dataaccess/datasource/DataSourceInfo.h"
28 #include "../dataaccess/datasource/DataSourceManager.h"
29 #include "../dataaccess/utils/Utils.h"
30 #include "../geometry/Geometry.h"
31 #include "../geometry/GeometryCollection.h"
32 #include "../geometry/GeometryProperty.h"
33 #include "../geometry/MultiPoint.h"
34 #include "../geometry/MultiLineString.h"
35 #include "../geometry/MultiPolygon.h"
36 #include "../geometry/Point.h"
37 #include "../memory/DataSet.h"
41 #include <QtGui/QTreeView>
48 #include <boost/algorithm/string.hpp>
54 std::auto_ptr<te::gm::Geometry> seedGeometry = items[0]->getGeometry(geomIdx);
57 resultGeometry = seedGeometry.release();
61 std::auto_ptr<te::gm::Geometry> teGeom = items[1]->getGeometry(geomIdx);
64 resultGeometry = seedGeometry->
Union(teGeom.release());
66 resultGeometry = seedGeometry.release();
72 for(std::size_t i = 1; i < items.size(); ++i)
74 std::auto_ptr<te::gm::Geometry> currentGeom = items[i]->getGeometry(geomIdx);
76 if(currentGeom->isValid())
77 teGeomColl->
add(currentGeom.release());
80 resultGeometry = seedGeometry->
Union(teGeomColl);
90 for(std::size_t i = 0; i < geomVec.size(); ++i)
108 return resultGeometry;
114 for(std::size_t i = 0; i < geomVec.size(); ++i)
118 gcOut->
add(geomVec[i]);
126 std::size_t found = fullName.rfind(
".");
128 if(found >= std::string::npos)
131 return fullName.substr(found + 1);
int getSRID() const
It returns the Spatial Reference System ID associated to this geometric object.
te::gm::GeomType GeomOpResultType(te::gm::GeomType firstGeom, te::gm::GeomType secondGeom)
te::gm::Geometry * GetGeometryUnion(const std::vector< te::mem::DataSetItem * > &items, size_t geomIdx, te::gm::GeomType outGeoType)
It returns the union of a geometry vector.
const std::vector< Geometry * > & getGeometries() const
It returns a reference to the internal list of geometries.
void add(Geometry *g)
It adds the geometry into the collection.
Utility functions for the data access module.
Geometry is the root class of the geometries hierarchy, it follows OGC and ISO standards.
GeomType
Each enumerated type is compatible with a Well-known Binary (WKB) type code.
virtual Geometry * Union(const Geometry *const rhs) const
It returns a geometric object that represents the point set union with another geometry.
GeomType getGeomTypeId() const
It returns the geometry subclass type identifier.
std::string GetSimpleTableName(std::string fullName)
It is a collection of other geometric objects.
void SplitGeometryCollection(te::gm::GeometryCollection *geomIn, te::gm::GeometryCollection *gcOut)
void setGeometryN(std::size_t i, Geometry *g)
It sets the n-th geometry in this geometry collection.