24 #include "../common/progress/TaskProgress.h" 25 #include "../common/STLUtils.h" 26 #include "../core/logger/Logger.h" 27 #include "../core/translator/Translator.h" 36 std::vector<Geometry *>& fixedGeometryVector,
39 std::unique_ptr<te::gm::Geometry> newGeometry(dynamic_cast<te::gm::Geometry*>(geometry.
clone()));
64 std::vector<te::gm::Curve*> curveVec = polygon->
getRings();
65 for(
auto c : curveVec)
69 std::unique_ptr<te::gm::Point> startPoint = c->getStartPoint();
87 std::vector<te::gm::Geometry*> geometryVec = mPolygon->
getGeometries();
88 for (
auto g : geometryVec)
106 std::vector<te::gm::Geometry*>& fixedGeometryVector,
109 std::unique_ptr<te::gm::Geometry> geomBuffer(geometry.
buffer(0.0));
115 topologyError.
m_message =
TE_TR(
"It was generated a geometry with an unexpected type.");
119 std::vector<te::gm::Geometry*> vecSingleGeoms;
122 for(
auto g : vecSingleGeoms)
135 for (std::size_t i = 0; i < vecSingleGeoms.size(); ++i)
141 fixedGeometryVector.push_back(pol);
146 for (std::size_t i = 0; i < vecSingleGeoms.size(); ++i)
static bool fixSelfIntersection(const te::gm::Geometry &geometry, std::vector< te::gm::Geometry * > &fixedGeometryVector, TopologyValidationError topologyError)
This function fixes geometries with self-intersection.
MultiPolygon is a MultiSurface whose elements are Polygons.
std::vector< Curve * > & getRings()
It returns the polygon rings.
GeomType
Each enumerated type is compatible with a Well-known Binary (WKB) type code.
virtual Geometry * buffer(const double &distance) const _NOEXCEPT_OP(false)
This method calculates the buffer of a geometry.
GeomType getGeomTypeId() const _NOEXCEPT_OP(true)
It returns the geometry subclass type identifier.
#define TE_TR(message)
It marks a string in order to get translated.
TEGEOMEXPORT void Multi2Single(const te::gm::Geometry *g, std::vector< te::gm::Geometry * > &geoms)
It will get a GeometryCollection and distribute in a vector.
te::gm::Coord2D getCentroid() const _NOEXCEPT_OP(false)
It will get the centroid of the input geometries.
int getSRID() const _NOEXCEPT_OP(true)
It returns the Spatial Reference System ID associated to this geometric object.
LineString is a curve with linear interpolation between points.
Functions to fix geometry topology.
void setNumCoordinates(std::size_t size)
It reserves room for the number of coordinates in this LineString.
static bool closeGeometryRing(const te::gm::Geometry &geometry, TopologyValidationError topologyError)
This function closes an opened geometry ring.
MultiPolygon is a MultiSurface whose elements are Polygons.
std::size_t getNPoints() const
It returns the number of points (vertexes) in the linestring.
virtual AbstractData * clone() const =0
It returns a clone of this object.
Geometry is the root class of the geometries hierarchy, it follows OGC and ISO standards.
Curve is an abstract class that represents 1-dimensional geometric objects stored as a sequence of co...
Polygon is a subclass of CurvePolygon whose rings are defined by linear rings.
Polygon is a subclass of CurvePolygon whose rings are defined by linear rings.
void add(Geometry *g)
It adds the geometry into the collection.
static bool fixTopology(const te::gm::Geometry &geometry, std::vector< te::gm::Geometry * > &fixedGeometryVector, TopologyValidationError topologyError)
This method gets a topologically inconsistent geometry and calls specific functions to fix this geome...
const std::vector< Geometry * > & getGeometries() const
It returns a reference to the internal list of geometries.
TEGEOMEXPORT bool CheckValidity(const Geometry *geom, te::gm::TopologyValidationError &error)
It check geometry validity using GEOS.
LineString is a curve with linear interpolation between points.
void setPointN(std::size_t i, const Point &p)
It sets the value of the specified point to this new one.
This struct contains informations about GEOS TopologyValidationError.
void FreeContents(boost::unordered_map< K, V * > &m)
This function can be applied to a map of pointers. It will delete each pointer in the map...