GEOS 3.14.0dev
|
Represents the location of a point on a Geometry. More...
#include <GeometryLocation.h>
Public Member Functions | |
GeometryLocation (const geom::Geometry *component, std::size_t segIndex, const geom::CoordinateXY &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). | |
GeometryLocation (const geom::Geometry *component, const geom::CoordinateXY &pt) | |
Constructs a GeometryLocation specifying a point inside an area geometry. | |
const geom::Geometry * | getGeometryComponent () |
std::size_t | getSegmentIndex () |
geom::CoordinateXY & | getCoordinate () |
bool | isInsideArea () |
Tests whether this location represents a point inside an area geometry. | |
std::string | toString () |
Static Public Attributes | |
static const int | INSIDE_AREA = -1 |
A Special value of segmentIndex used for locations inside area geometries. | |
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.
geos::operation::distance::GeometryLocation::GeometryLocation | ( | const geom::Geometry * | component, |
std::size_t | segIndex, | ||
const geom::CoordinateXY & | 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).
component | the component of the geometry containing the point |
segIndex | the segment index of the location, or INSIDE_AREA |
pt | the coordinate of the location |
geos::operation::distance::GeometryLocation::GeometryLocation | ( | const geom::Geometry * | component, |
const geom::CoordinateXY & | pt | ||
) |
Constructs a GeometryLocation specifying a point inside an area geometry.
component | the component of the geometry containing the point |
pt | the coordinate of the location |
geom::CoordinateXY & 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.
std::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;
|
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.