te::gm::Validation Class Reference

#include <Validation.h>

Static Public Member Functions

static bool CheckValidity (const Geometry *geom, te::gm::TopologyValidationError &error)
 It check geometry validity using GEOS. More...
 
static te::gm::GeometryPtr MakeValid (const te::gm::Geometry *geometry)
 Apply several fixes to a geometry to ensure that it will be made valid. More...
 
static te::gm::GeometryPtr MakeValid (const te::gm::Geometry *geometry, std::string &errorMessage)
 
static te::gm::GeometryValidate (te::gm::Geometry *geom)
 Get/create a valid version of the geometry given. If the geometry is a polygon or multi polygon, self intersections / inconsistencies are fixed. Otherwise the geometry is returned. More...
 

Detailed Description

Definition at line 61 of file Validation.h.

Member Function Documentation

◆ CheckValidity()

static bool te::gm::Validation::CheckValidity ( const Geometry geom,
te::gm::TopologyValidationError error 
)
static

It check geometry validity using GEOS.

Parameters
geomGeometry that will be verified.
errorTopologyValidationError struct.
Returns
True if geometry is valid.

◆ MakeValid() [1/2]

static te::gm::GeometryPtr te::gm::Validation::MakeValid ( const te::gm::Geometry geometry)
static

Apply several fixes to a geometry to ensure that it will be made valid.

It applies the following fixes: 1 - Removes all the repeated consecutive coordidates 2 - Add perpendicular points that are within the tolerance to each analysed segment 3 - We snap the coordinates to ensure that any "similar" coordinate is now equal 4 - To avoid the discard of rings in geos polygonize function, we must ensure that we removed all the collapsed segments 5 - Finally we applies a polygonizer to recreate the geometry and ensure that it is now consistent

Parameters
geomGeometry that will be verified.
Returns
True if geometry is valid.

◆ MakeValid() [2/2]

static te::gm::GeometryPtr te::gm::Validation::MakeValid ( const te::gm::Geometry geometry,
std::string &  errorMessage 
)
static

◆ Validate()

static te::gm::Geometry* te::gm::Validation::Validate ( te::gm::Geometry geom)
static

Get/create a valid version of the geometry given. If the geometry is a polygon or multi polygon, self intersections / inconsistencies are fixed. Otherwise the geometry is returned.

Parameters
geom
Returns
a geometry
Note
: https://stackoverflow.com/questions/31473553/is-there-a-way-to-convert-a-self-intersecting-polygon-to-a-multipolygon-in-jts

The documentation for this class was generated from the following file: