GEOS  3.13.0dev
Public Member Functions | Static Public Member Functions | List of all members
geos::algorithm::hull::ConcaveHullOfPolygons Class Reference

#include <ConcaveHullOfPolygons.h>

Public Member Functions

 ConcaveHullOfPolygons (const Geometry *geom)
 
void setMaximumEdgeLength (double edgeLength)
 
void setMaximumEdgeLengthRatio (double edgeLengthRatio)
 
void setHolesAllowed (bool p_isHolesAllowed)
 
void setTight (bool p_isTight)
 
std::unique_ptr< GeometrygetHull ()
 
std::unique_ptr< GeometrygetFill ()
 

Static Public Member Functions

static std::unique_ptr< GeometryconcaveHullByLength (const Geometry *polygons, double maxLength)
 
static std::unique_ptr< GeometryconcaveHullByLength (const Geometry *polygons, double maxLength, bool isTight, bool isHolesAllowed)
 
static std::unique_ptr< GeometryconcaveHullByLengthRatio (const Geometry *polygons, double lengthRatio)
 
static std::unique_ptr< GeometryconcaveHullByLengthRatio (const Geometry *polygons, double lengthRatio, bool isTight, bool isHolesAllowed)
 
static std::unique_ptr< GeometryconcaveFillByLength (const Geometry *polygons, double maxLength)
 
static std::unique_ptr< GeometryconcaveFillByLengthRatio (const Geometry *polygons, double lengthRatio)
 

Detailed Description

Constructs a concave hull of a set of polygons, respecting the polygons as constraints. A concave hull is a possibly non-convex polygon containing all the input polygons. A given set of polygons has a sequence of hulls of increasing concaveness, determined by a numeric target parameter. The computed hull "fills the gap" between the polygons, and does not intersect their interior.

The concave hull is constructed by removing the longest outer edges of the Delaunay Triangulation of the space between the polygons, until the target criterion parameter is reached.

The target criteria are:

The preferred criterion is the Maximum Edge Length Ratio, since it is scale-free and local (so that no assumption needs to be made about the total amount of concaveness present).

Optionally the concave hull can be allowed to contain holes, via setHolesAllowed().

The hull can be specified as being "tight", which means it follows the outer boundaries of the input polygons.

The input polygons must form a valid MultiPolygon (i.e. they must be non-overlapping).

Author
Martin Davis

Constructor & Destructor Documentation

◆ ConcaveHullOfPolygons()

geos::algorithm::hull::ConcaveHullOfPolygons::ConcaveHullOfPolygons ( const Geometry geom)

Creates a new instance for a given geometry.

Parameters
geomthe input geometry

Member Function Documentation

◆ concaveFillByLength()

static std::unique_ptr<Geometry> geos::algorithm::hull::ConcaveHullOfPolygons::concaveFillByLength ( const Geometry polygons,
double  maxLength 
)
static

Computes a concave fill area between a set of polygons, using the target criterion of maximum edge length.

Parameters
polygonsthe input polygons
maxLengththe target maximum edge length
Returns
the concave fill

◆ concaveFillByLengthRatio()

static std::unique_ptr<Geometry> geos::algorithm::hull::ConcaveHullOfPolygons::concaveFillByLengthRatio ( const Geometry polygons,
double  lengthRatio 
)
static

Computes a concave fill area between a set of polygons, using the target criterion of maximum edge length ratio.

Parameters
polygonsthe input polygons
lengthRatiothe target maximum edge length ratio
Returns
the concave fill

◆ concaveHullByLength() [1/2]

static std::unique_ptr<Geometry> geos::algorithm::hull::ConcaveHullOfPolygons::concaveHullByLength ( const Geometry polygons,
double  maxLength 
)
static

Computes a concave hull of set of polygons using the target criterion of maximum edge length.

Parameters
polygonsthe input polygons
maxLengththe target maximum edge length
Returns
the concave hull

◆ concaveHullByLength() [2/2]

static std::unique_ptr<Geometry> geos::algorithm::hull::ConcaveHullOfPolygons::concaveHullByLength ( const Geometry polygons,
double  maxLength,
bool  isTight,
bool  isHolesAllowed 
)
static

Computes a concave hull of set of polygons using the target criterion of maximum edge length, and allowing control over whether the hull boundary is tight and can contain holes.

Parameters
polygonsthe input polygons
maxLengththe target maximum edge length
isTighttrue if the hull should be tight to the outside of the polygons
isHolesAllowedtrue if holes are allowed in the hull polygon
Returns
the concave hull

◆ concaveHullByLengthRatio() [1/2]

static std::unique_ptr<Geometry> geos::algorithm::hull::ConcaveHullOfPolygons::concaveHullByLengthRatio ( const Geometry polygons,
double  lengthRatio 
)
static

Computes a concave hull of set of polygons using the target criterion of maximum edge length ratio.

Parameters
polygonsthe input polygons
lengthRatiothe target maximum edge length ratio
Returns
the concave hull

◆ concaveHullByLengthRatio() [2/2]

static std::unique_ptr<Geometry> geos::algorithm::hull::ConcaveHullOfPolygons::concaveHullByLengthRatio ( const Geometry polygons,
double  lengthRatio,
bool  isTight,
bool  isHolesAllowed 
)
static

Computes a concave hull of set of polygons using the target criterion of maximum edge length ratio, and allowing control over whether the hull boundary is tight and can contain holes.

Parameters
polygonsthe input polygons
lengthRatiothe target maximum edge length ratio
isTighttrue if the hull should be tight to the outside of the polygons
isHolesAllowedtrue if holes are allowed in the hull polygon
Returns
the concave hull

◆ getFill()

std::unique_ptr<Geometry> geos::algorithm::hull::ConcaveHullOfPolygons::getFill ( )

Gets the concave fill, which is the area between the input polygons, subject to the concaveness control parameter.

Returns
the concave fill

◆ getHull()

std::unique_ptr<Geometry> geos::algorithm::hull::ConcaveHullOfPolygons::getHull ( )

Gets the computed concave hull.

Returns
the concave hull

◆ setHolesAllowed()

void geos::algorithm::hull::ConcaveHullOfPolygons::setHolesAllowed ( bool  p_isHolesAllowed)

Sets whether holes are allowed in the concave hull polygon.

Parameters
p_isHolesAllowedtrue if holes are allowed in the result

◆ setMaximumEdgeLength()

void geos::algorithm::hull::ConcaveHullOfPolygons::setMaximumEdgeLength ( double  edgeLength)

Sets the target maximum edge length for the concave hull. The length value must be zero or greater.

  • The value 0.0 produces the input polygons.
  • Larger values produce less concave results. Above a certain large value the result is the convex hull of the input.

The edge length ratio provides a scale-free parameter which is intended to produce similar concave results for a variety of inputs.

Parameters
edgeLengtha non-negative length

◆ setMaximumEdgeLengthRatio()

void geos::algorithm::hull::ConcaveHullOfPolygons::setMaximumEdgeLengthRatio ( double  edgeLengthRatio)

Sets the target maximum edge length ratio for the concave hull. The edge length ratio is a fraction of the difference between the longest and shortest edge lengths in the Delaunay Triangulation of the area between the input polygons. (Roughly speaking, it is a fraction of the difference between the shortest and longest distances between the input polygons.) It is a value in the range 0 to 1.

  • The value 0.0 produces the original input polygons.
  • The value 1.0 produces the convex hull.
Parameters
edgeLengthRatioa length factor value between 0 and 1

◆ setTight()

void geos::algorithm::hull::ConcaveHullOfPolygons::setTight ( bool  p_isTight)

Sets whether the boundary of the hull polygon is kept tight to the outer edges of the input polygons.

Parameters
p_isTighttrue if the boundary is kept tight

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