GEOS  3.9.1dev
Public Member Functions | Static Public Attributes | Private Attributes | List of all members
geos::operation::distance::GeometryLocation Class Reference

Represents the location of a point on a Geometry. More...

#include <GeometryLocation.h>

Collaboration diagram for geos::operation::distance::GeometryLocation:
[legend]

Public Member Functions

 GeometryLocation (const geom::Geometry *component, size_t segIndex, const geom::Coordinate &pt)
 Constructs a GeometryLocation specifying a point on a geometry, as well as the segment that the point is on (or INSIDE_AREA if the point is not on a segment). More...
 
 GeometryLocation (const geom::Geometry *component, const geom::Coordinate &pt)
 Constructs a GeometryLocation specifying a point inside an area geometry. More...
 
const geom::GeometrygetGeometryComponent ()
 
size_t getSegmentIndex ()
 
geom::CoordinategetCoordinate ()
 
bool isInsideArea ()
 Tests whether this location represents a point inside an area geometry. More...
 
std::string toString ()
 

Static Public Attributes

static const int INSIDE_AREA = -1
 A Special value of segmentIndex used for locations inside area geometries. More...
 

Private Attributes

const geom::Geometrycomponent
 
size_t segIndex
 
bool inside_area
 
geom::Coordinate pt
 

Detailed Description

Represents the location of a point on a Geometry.

Maintains both the actual point location (which may not be exact, if the point is not a vertex) as well as information about the component and segment index where the point occurs. Locations inside area Geometrys will not have an associated segment index, so in this case the segment index will have the sentinel value of INSIDE_AREA.

Definition at line 50 of file GeometryLocation.h.

Constructor & Destructor Documentation

geos::operation::distance::GeometryLocation::GeometryLocation ( const geom::Geometry component,
size_t  segIndex,
const geom::Coordinate pt 
)

Constructs a GeometryLocation specifying a point on a geometry, as well as the segment that the point is on (or INSIDE_AREA if the point is not on a segment).

Parameters
componentthe component of the geometry containing the point
segIndexthe segment index of the location, or INSIDE_AREA
ptthe coordinate of the location
geos::operation::distance::GeometryLocation::GeometryLocation ( const geom::Geometry component,
const geom::Coordinate pt 
)

Constructs a GeometryLocation specifying a point inside an area geometry.

Parameters
componentthe component of the geometry containing the point
ptthe coordinate of the location

Member Function Documentation

geom::Coordinate& geos::operation::distance::GeometryLocation::getCoordinate ( )

Returns the geom::Coordinate of this location.

const geom::Geometry* geos::operation::distance::GeometryLocation::getGeometryComponent ( )

Returns the geometry component on (or in) which this location occurs.

size_t geos::operation::distance::GeometryLocation::getSegmentIndex ( )

Returns the segment index for this location.

If the location is inside an area, the index will have the value INSIDE_AREA;

Returns
the segment index for the location, or INSIDE_AREA
bool geos::operation::distance::GeometryLocation::isInsideArea ( )

Tests whether this location represents a point inside an area geometry.

std::string geos::operation::distance::GeometryLocation::toString ( )

Member Data Documentation

const geom::Geometry* geos::operation::distance::GeometryLocation::component
private

Definition at line 52 of file GeometryLocation.h.

bool geos::operation::distance::GeometryLocation::inside_area
private

Definition at line 54 of file GeometryLocation.h.

const int geos::operation::distance::GeometryLocation::INSIDE_AREA = -1
static

A Special value of segmentIndex used for locations inside area geometries.

These locations are not located on a segment, and thus do not have an associated segment index.

Definition at line 64 of file GeometryLocation.h.

geom::Coordinate geos::operation::distance::GeometryLocation::pt
private

Definition at line 55 of file GeometryLocation.h.

size_t geos::operation::distance::GeometryLocation::segIndex
private

Definition at line 53 of file GeometryLocation.h.


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