GEOS  3.9.1dev
Public Member Functions | Private Member Functions | Private Attributes | List of all members
geos::algorithm::InteriorPointArea Class Reference

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>

Collaboration diagram for geos::algorithm::InteriorPointArea:
[legend]

Public Member Functions

 InteriorPointArea (const geom::Geometry *g)
 
bool getInteriorPoint (geom::Coordinate &ret) const
 

Private Member Functions

void process (const geom::Geometry *geom)
 
void processPolygon (const geom::Polygon *polygon)
 

Private Attributes

geom::Coordinate interiorPoint
 
double maxWidth
 

Detailed Description

Computes a point in the interior of an areal geometry. The point will lie in the geometry interior in all except certain pathological cases.

Algorithm

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.

KNOWN BUGS

Definition at line 80 of file InteriorPointArea.h.

Constructor & Destructor Documentation

geos::algorithm::InteriorPointArea::InteriorPointArea ( const geom::Geometry g)

Creates a new interior point finder for an areal geometry.

Parameters
gan areal geometry

Member Function Documentation

bool geos::algorithm::InteriorPointArea::getInteriorPoint ( geom::Coordinate ret) const

Gets the computed interior point.

Returns
the coordinate of an interior point or null if the input geometry is empty
void geos::algorithm::InteriorPointArea::process ( const geom::Geometry geom)
private
void geos::algorithm::InteriorPointArea::processPolygon ( const geom::Polygon polygon)
private

Member Data Documentation

geom::Coordinate geos::algorithm::InteriorPointArea::interiorPoint
private

Definition at line 100 of file InteriorPointArea.h.

double geos::algorithm::InteriorPointArea::maxWidth
private

Definition at line 101 of file InteriorPointArea.h.


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