GeometricAlgorithms Class Reference

provides a set of geometric algorithms (Douglas-Peucker algorithm, densification of lines) More...

Static Public Member Functions

def analyseDistance
 For analysing 2d/3d distances between vertices of the base polyline to the other provided polyline (optional a max distance threshold is considered)
def densify
 densify a polyline by inserting new points along the line segments

def thinOut
 Use the Douglas-Peucker algorithm to create a polyline with a subset of vertices of the provided line object.

Detailed Description

provides a set of geometric algorithms (Douglas-Peucker algorithm, densification of lines)

Member Function Documentation

def analyseDistance (   base,
  other,
  callback,
  maxDist = None,
  d3 = True 
)
static

For analysing 2d/3d distances between vertices of the base polyline to the other provided polyline (optional a max distance threshold is considered)

The function computes the shortest 2d/3d distances of all vertices of the base polyline to the 'other' polyline. With the results of each base vertex distance computation the corresponding function of the provided callback object is called. If an maximum distance threshold is provided (maxDist>0), the algorithms only considers distances up to the given threshold (see IAnalyseDistance). The implemented algorithm uses the maxDist threshold during spatial search and therfore, is more efficient than only handling the distance threshold within the callback oject.

Parameters
[in]basethe vertex of the base polyline is used for distance analysis
[in]otherpolyline to which the distances are computed
[in]callbackcallback object for analysing the computed distance results
[in]maxDistoptional maximum distance threshold (-1: no distance threshold is applied)
[in]d3flag if 3d or 2d computation (true: 3d / false: 2d)

def densify (   line,
  maxSpacing 
)
static

densify a polyline by inserting new points along the line segments

insert as few points as possible to reach the criterion:
(distances between neighbours) <= d_maxSpacing
distribute the new points equally along each line segment
preserve original points together with their additional infos

Parameters
[in]linepolyline that should be densified
[in]maxSpacingmaximum spacing between neighboring vertices
Returns
resulting object

def thinOut (   line,
  maxOrthoDist 
)
static

Use the Douglas-Peucker algorithm to create a polyline with a subset of vertices of the provided line object.

Each polyline part is treated as a separate object

Parameters
[in]linepolyline that should be thinned out
[in]maxOrthoDistDiscarded vertices feature an orthogonal distance to the returned polyline <= d_maxOrthoDist
Returns
resulting object