GEOS 3.11.1
|
#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< Geometry > | getHull () |
std::unique_ptr< Geometry > | getFill () |
Static Public Member Functions | |
static std::unique_ptr< Geometry > | concaveHullByLength (const Geometry *polygons, double maxLength) |
static std::unique_ptr< Geometry > | concaveHullByLength (const Geometry *polygons, double maxLength, bool isTight, bool isHolesAllowed) |
static std::unique_ptr< Geometry > | concaveHullByLengthRatio (const Geometry *polygons, double lengthRatio) |
static std::unique_ptr< Geometry > | concaveHullByLengthRatio (const Geometry *polygons, double lengthRatio, bool isTight, bool isHolesAllowed) |
static std::unique_ptr< Geometry > | concaveFillByLength (const Geometry *polygons, double maxLength) |
static std::unique_ptr< Geometry > | concaveFillByLengthRatio (const Geometry *polygons, double lengthRatio) |
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).
geos::algorithm::hull::ConcaveHullOfPolygons::ConcaveHullOfPolygons | ( | const Geometry * | geom | ) |
Creates a new instance for a given geometry.
geom | the input geometry |
|
static |
Computes a concave fill area between a set of polygons, using the target criterion of maximum edge length.
polygons | the input polygons |
maxLength | the target maximum edge length |
|
static |
Computes a concave fill area between a set of polygons, using the target criterion of maximum edge length ratio.
polygons | the input polygons |
lengthRatio | the target maximum edge length ratio |
|
static |
Computes a concave hull of set of polygons using the target criterion of maximum edge length.
polygons | the input polygons |
maxLength | the target maximum edge length |
|
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.
polygons | the input polygons |
maxLength | the target maximum edge length |
isTight | true if the hull should be tight to the outside of the polygons |
isHolesAllowed | true if holes are allowed in the hull polygon |
|
static |
Computes a concave hull of set of polygons using the target criterion of maximum edge length ratio.
polygons | the input polygons |
lengthRatio | the target maximum edge length ratio |
|
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.
polygons | the input polygons |
lengthRatio | the target maximum edge length ratio |
isTight | true if the hull should be tight to the outside of the polygons |
isHolesAllowed | true if holes are allowed in the hull polygon |
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.
std::unique_ptr< Geometry > geos::algorithm::hull::ConcaveHullOfPolygons::getHull | ( | ) |
Gets the computed concave hull.
void geos::algorithm::hull::ConcaveHullOfPolygons::setHolesAllowed | ( | bool | p_isHolesAllowed | ) |
Sets whether holes are allowed in the concave hull polygon.
p_isHolesAllowed | true if holes are allowed in the result |
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 edge length ratio provides a scale-free parameter which is intended to produce similar concave results for a variety of inputs.
edgeLength | a non-negative length |
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.
edgeLengthRatio | a length factor value between 0 and 1 |
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.
p_isTight | true if the boundary is kept tight |