te::vp::PolygonSubdivider Class Reference

Algorithm to subdivide polygons based on a cell tilling and merge them back to their original format. More...

#include <PolygonSubdivider.h>

Public Types

using ClusterIndexes = std::vector< std::size_t >
 
using Clusters = std::vector< ClusterIndexes >
 
using GeometryAssociation = std::pair< std::size_t, std::size_t >
 
using GeometryAssociations = std::vector< GeometryAssociation >
 
using SetIndexes = std::set< std::size_t >
 

Static Public Member Functions

static GeometryAssociations calculateGeometryAssociations (const std::vector< te::vp::SegmentInfo * > &vecBorderSegments, te::gm::Dimensionality dimensionality)
 Creates a non-normalized match map containing only the indexes of geometries that have a border relation to each other. This analysis is not recursive. More...
 
static GeometryAssociations calculateGeometryAssociations (const te::gm::GeometryVector &vecFragments, const te::gm::LineString *splitLine)
 Creates a normalized match map containing only the indexes of geometries that have a border relation to each other. This analysis is recursive. More...
 
static Clusters calculateGeometryClusters (const GeometryAssociations &geometryMatchMap)
 Normalizes an match map ensuring that all the list of indexes is complete, that is, the list will containg the indexes of all fragments that have borders with the key index. More...
 
static bool checkForGeometrySubdivision (const te::gm::Envelope &currentTile, const te::gm::Geometry *geometry, std::size_t geometryIndex, std::vector< te::vp::SegmentInfo * > &vecSegmentsInBorder)
 
static te::gm::GeometryVector dissolveFragments (const te::gm::GeometryVector &vecFragments, const Clusters &clusters)
 Dissolves all the geometries from the given fragments vector using the given match map as reference. More...
 
static bool filterSegmentsInBorder (const te::gm::Geometry *geometry, std::size_t geometryIndex, const te::gm::LineString *splitLine, std::vector< te::vp::SegmentInfo * > &vecSegmentsInBorder)
 From the givem geometry, creates a list of all the segments that are exactly in the border of the given split reference line. It also returns the indexes of the geometries that doesnt overlap the given split reference line. More...
 
static std::vector< te::vp::SegmentInfo * > filterSegmentsInBorder (const te::gm::GeometryVector &vecFragments, const te::gm::LineString *splitLine, std::vector< std::size_t > &vecIndexesNotInBorder)
 From the givem geometry vector, creates a list of all the segments that are exactly in the border of the given split reference line. It also returns the indexes of the geometries that doesnt overlap the given split reference line. More...
 
static SetIndexes getUniqueIndexes (const GeometryAssociations &geometryAssociations)
 
static te::gm::GeometryVector merge (const te::gm::GeometryVector &vecFragments, const SubdividerTilling &tilling)
 Dissolves all the geometries from the given fragments vector that have borders with the given split reference line. More...
 
static te::gm::GeometryVector merge (const te::gm::GeometryVector &vecFragments, const te::gm::LineString *splitLine)
 Dissolves all the geometries from the given fragments vector that have borders with the given split reference line. More...
 
static te::gm::GeometryVector subdivide (const te::gm::Geometry *geometry, const SubdividerTilling &tilling, std::size_t maxCoordinates)
 Subdivides the given geometry using the given envelope. This has the same result as an intersection operation, but uses an optimized algorithm which considers an envelope. More...
 
static te::gm::GeometryVector subdivide (const te::gm::Geometry *geometry, const te::gm::Envelope &envelope, std::size_t maxCoordinates)
 Subdivides the given geometry using the given envelope. This has the same result as an intersection operation, but uses an optimized algorithm which considers an envelope. More...
 
static te::gm::GeometryVector subdivide (const te::gm::Geometry *geometry, std::size_t maxCoordinates)
 Subdivides the given geometry using the given envelope. This has the same result as an intersection operation, but uses an optimized algorithm which considers an envelope. More...
 
static te::gm::GeometryVector subdivide (const te::gm::GeometryVector &vecInputGeometries, const SubdividerTilling &tilling, std::size_t maxCoordinates)
 Subdivides the given vecInputGeometries using the given envelope. This has the same result as an intersection operation, but uses an optimized algorithm which considers an envelope. More...
 
static te::gm::GeometryVector subdivide (const te::gm::GeometryVector &vecInputGeometries, const te::gm::Envelope &envelope, std::size_t maxCoordinates)
 
static te::gm::GeometryVector subdivide (const te::gm::GeometryVector &vecInputGeometries, std::size_t maxCoordinates, std::vector< std::size_t > &vecParentIndexes)
 Subdivides the given vecInputGeometries using the given envelope. This has the same result as an intersection operation, but uses an optimized algorithm which considers an envelope. More...
 

Detailed Description

Algorithm to subdivide polygons based on a cell tilling and merge them back to their original format.

Definition at line 61 of file PolygonSubdivider.h.

Member Typedef Documentation

◆ ClusterIndexes

using te::vp::PolygonSubdivider::ClusterIndexes = std::vector<std::size_t>

Definition at line 68 of file PolygonSubdivider.h.

◆ Clusters

Definition at line 69 of file PolygonSubdivider.h.

◆ GeometryAssociation

using te::vp::PolygonSubdivider::GeometryAssociation = std::pair<std::size_t, std::size_t>

Definition at line 66 of file PolygonSubdivider.h.

◆ GeometryAssociations

◆ SetIndexes

using te::vp::PolygonSubdivider::SetIndexes = std::set<std::size_t>

Definition at line 65 of file PolygonSubdivider.h.

Member Function Documentation

◆ calculateGeometryAssociations() [1/2]

static GeometryAssociations te::vp::PolygonSubdivider::calculateGeometryAssociations ( const std::vector< te::vp::SegmentInfo * > &  vecBorderSegments,
te::gm::Dimensionality  dimensionality 
)
static

Creates a non-normalized match map containing only the indexes of geometries that have a border relation to each other. This analysis is not recursive.

Parameters
vecBorderSegmentsThe vector containing the border segments to be analysed
Returns
The non-normalized match map containing only the indexes of geometries that have a border relation to each other

◆ calculateGeometryAssociations() [2/2]

static GeometryAssociations te::vp::PolygonSubdivider::calculateGeometryAssociations ( const te::gm::GeometryVector vecFragments,
const te::gm::LineString splitLine 
)
static

Creates a normalized match map containing only the indexes of geometries that have a border relation to each other. This analysis is recursive.

Parameters
vecFragmentsThe vector containing the geometry fragments to be analysed
splitLineThe referente split line where the geomtry fragments must be analysed
Returns
The normalized match map containing only the indexes of geometries that have a border relation to each other

◆ calculateGeometryClusters()

static Clusters te::vp::PolygonSubdivider::calculateGeometryClusters ( const GeometryAssociations geometryMatchMap)
static

Normalizes an match map ensuring that all the list of indexes is complete, that is, the list will containg the indexes of all fragments that have borders with the key index.

Parameters
geometryMatchMapThe match map to be normalized

◆ checkForGeometrySubdivision()

static bool te::vp::PolygonSubdivider::checkForGeometrySubdivision ( const te::gm::Envelope currentTile,
const te::gm::Geometry geometry,
std::size_t  geometryIndex,
std::vector< te::vp::SegmentInfo * > &  vecSegmentsInBorder 
)
static

◆ dissolveFragments()

static te::gm::GeometryVector te::vp::PolygonSubdivider::dissolveFragments ( const te::gm::GeometryVector vecFragments,
const Clusters clusters 
)
static

Dissolves all the geometries from the given fragments vector using the given match map as reference.

Parameters
vecFragmentsA vector containing all the candidate fragments to be dissolved
geometryMatchMapThe match map to be be used as reference
Returns
The geometry vector containing the dissolved geometries

◆ filterSegmentsInBorder() [1/2]

static bool te::vp::PolygonSubdivider::filterSegmentsInBorder ( const te::gm::Geometry geometry,
std::size_t  geometryIndex,
const te::gm::LineString splitLine,
std::vector< te::vp::SegmentInfo * > &  vecSegmentsInBorder 
)
static

From the givem geometry, creates a list of all the segments that are exactly in the border of the given split reference line. It also returns the indexes of the geometries that doesnt overlap the given split reference line.

Parameters
geometryThe geometry to be analysed
geometryIndexThe index of the geometry
splitLineThe referente split line where the geomtry fragments must be analysed
vecSegmentsInBorder(Return parameter) A vector containing all the segments in the border of the given split reference line. f the vector is empty, the given geometry does not share borders with the given split line
Returns
TRUE if at least one segment is in the border.

◆ filterSegmentsInBorder() [2/2]

static std::vector<te::vp::SegmentInfo*> te::vp::PolygonSubdivider::filterSegmentsInBorder ( const te::gm::GeometryVector vecFragments,
const te::gm::LineString splitLine,
std::vector< std::size_t > &  vecIndexesNotInBorder 
)
static

From the givem geometry vector, creates a list of all the segments that are exactly in the border of the given split reference line. It also returns the indexes of the geometries that doesnt overlap the given split reference line.

Parameters
vecFragmentsThe vector containing the geometry fragments to be analysed
splitLineThe referente split line where the geomtry fragments must be analysed
vecIndexesNotInBorder(Return parameter) A return value containing the indexes of the geometries that doesnt overlap the given split reference line
Returns
A vector containing all the segments in the border of the given split reference line

◆ getUniqueIndexes()

static SetIndexes te::vp::PolygonSubdivider::getUniqueIndexes ( const GeometryAssociations geometryAssociations)
static

◆ merge() [1/2]

static te::gm::GeometryVector te::vp::PolygonSubdivider::merge ( const te::gm::GeometryVector vecFragments,
const SubdividerTilling tilling 
)
static

Dissolves all the geometries from the given fragments vector that have borders with the given split reference line.

Parameters
vecFragmentsA vector containing all the candidate fragments to be dissolved
splitLineThe split reference line
Returns
The geometry vector containing the dissolved geometries

◆ merge() [2/2]

static te::gm::GeometryVector te::vp::PolygonSubdivider::merge ( const te::gm::GeometryVector vecFragments,
const te::gm::LineString splitLine 
)
static

Dissolves all the geometries from the given fragments vector that have borders with the given split reference line.

Parameters
vecFragmentsA vector containing all the candidate fragments to be dissolved
splitLineThe split reference line
Returns
The geometry vector containing the dissolved geometries

◆ subdivide() [1/6]

static te::gm::GeometryVector te::vp::PolygonSubdivider::subdivide ( const te::gm::Geometry geometry,
const SubdividerTilling tilling,
std::size_t  maxCoordinates 
)
static

Subdivides the given geometry using the given envelope. This has the same result as an intersection operation, but uses an optimized algorithm which considers an envelope.

Parameters
geometryThe input geometry to be clipped
envelopeThe envelope to be used as clipping area
Returns
A geometry vector containing the clipping result

◆ subdivide() [2/6]

static te::gm::GeometryVector te::vp::PolygonSubdivider::subdivide ( const te::gm::Geometry geometry,
const te::gm::Envelope envelope,
std::size_t  maxCoordinates 
)
static

Subdivides the given geometry using the given envelope. This has the same result as an intersection operation, but uses an optimized algorithm which considers an envelope.

Parameters
geometryThe input geometry to be clipped
envelopeThe envelope to be used as clipping area
Returns
A geometry vector containing the clipping result

◆ subdivide() [3/6]

static te::gm::GeometryVector te::vp::PolygonSubdivider::subdivide ( const te::gm::Geometry geometry,
std::size_t  maxCoordinates 
)
static

Subdivides the given geometry using the given envelope. This has the same result as an intersection operation, but uses an optimized algorithm which considers an envelope.

Parameters
geometryThe input geometry to be clipped
envelopeThe envelope to be used as clipping area
Returns
A geometry vector containing the clipping result

◆ subdivide() [4/6]

static te::gm::GeometryVector te::vp::PolygonSubdivider::subdivide ( const te::gm::GeometryVector vecInputGeometries,
const SubdividerTilling tilling,
std::size_t  maxCoordinates 
)
static

Subdivides the given vecInputGeometries using the given envelope. This has the same result as an intersection operation, but uses an optimized algorithm which considers an envelope.

Parameters
vecInputGeometriesThe input geometries to be clipped
envelopeThe envelope to be used as clipping area
Returns
A geometry vector containing the clipping result

◆ subdivide() [5/6]

static te::gm::GeometryVector te::vp::PolygonSubdivider::subdivide ( const te::gm::GeometryVector vecInputGeometries,
const te::gm::Envelope envelope,
std::size_t  maxCoordinates 
)
static

◆ subdivide() [6/6]

static te::gm::GeometryVector te::vp::PolygonSubdivider::subdivide ( const te::gm::GeometryVector vecInputGeometries,
std::size_t  maxCoordinates,
std::vector< std::size_t > &  vecParentIndexes 
)
static

Subdivides the given vecInputGeometries using the given envelope. This has the same result as an intersection operation, but uses an optimized algorithm which considers an envelope.

Parameters
vecInputGeometriesThe input geometries to be clipped
envelopeThe envelope to be used as clipping area
Returns
A geometry vector containing the clipping result

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