GEOS 3.11.1
|
Computes a point in the interior of an areal geometry. The point will lie in the geometry interior in all except certain pathological cases. More...
#include <InteriorPointArea.h>
Public Member Functions | |
InteriorPointArea (const geom::Geometry *g) | |
bool | getInteriorPoint (geom::Coordinate &ret) const |
Computes a point in the interior of an areal geometry. The point will lie in the geometry interior in all except certain pathological cases.
For each input polygon:
The final interior point is chosen as the one occurring in the widest interior section.
This algorithm is a tradeoff between performance and point quality (where points further from the geometry boundary are considered to be higher quality) Priority is given to performance. This means that the computed interior point may not be suitable for some uses (such as label positioning).
The algorithm handles some kinds of invalid/degenerate geometry, including zero-area and self-intersecting polygons.
Empty geometry is handled by returning a null
point.
geos::algorithm::InteriorPointArea::InteriorPointArea | ( | const geom::Geometry * | g | ) |
Creates a new interior point finder for an areal geometry.
g | an areal geometry |
bool geos::algorithm::InteriorPointArea::getInteriorPoint | ( | geom::Coordinate & | ret | ) | const |
Gets the computed interior point.
null
if the input geometry is empty