GEOS 3.6.2
geos::algorithm::InteriorPointArea Class Reference

Computes a point in the interior of an areal geometry. More...

#include <InteriorPointArea.h>

Public Member Functions

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

Detailed Description

Computes a point in the interior of an areal geometry.

Algorithm

  • Find a Y value which is close to the centre of the geometry's vertical extent but is different to any of it's Y ordinates.
  • Create a horizontal bisector line using the Y value and the geometry's horizontal extent
  • Find the intersection between the geometry and the horizontal bisector line. The intersection is a collection of lines and points.
  • Pick the midpoint of the largest intersection geometry

Note: If a fixed precision model is used, in some cases this method may return a point which does not lie in the interior.

Constructor & Destructor Documentation

◆ InteriorPointArea()

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

Creates a new interior point finder for an areal geometry.

Parameters
gan areal geometry

References InteriorPointArea().

Referenced by InteriorPointArea().

Member Function Documentation

◆ getInteriorPoint()

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

Gets the computed interior point.

Returns
the coordinate of an interior point

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