Represents a location along a LineString or MultiLineString.
More...
#include <LinearLocation.h>
Represents a location along a LineString or MultiLineString.
The referenced geometry is not maintained within this location, but must be provided for operations which require it. Various methods are provided to manipulate the location value and query the geometry it references.
Definition at line 44 of file LinearLocation.h.
geos::linearref::LinearLocation::LinearLocation |
( |
size_t |
segmentIndex = 0 , |
|
|
double |
segmentFraction = 0.0 |
|
) |
| |
Creates a location referring to the start of a linear geometry.
geos::linearref::LinearLocation::LinearLocation |
( |
size_t |
componentIndex, |
|
|
size_t |
segmentIndex, |
|
|
double |
segmentFraction |
|
) |
| |
void geos::linearref::LinearLocation::clamp |
( |
const geom::Geometry * |
linear | ) |
|
int geos::linearref::LinearLocation::compareLocationValues |
( |
size_t |
componentIndex1, |
|
|
size_t |
segmentIndex1, |
|
|
double |
segmentFraction1 |
|
) |
| const |
Compares this object with the specified index values for order.
- Parameters
-
componentIndex1 | a component index |
segmentIndex1 | a segment index |
segmentFraction1 | a segment fraction |
- Returns
- a negative integer, zero, or a positive integer as this LinearLocation is less than, equal to, or greater than the specified locationValues
static int geos::linearref::LinearLocation::compareLocationValues |
( |
size_t |
componentIndex0, |
|
|
size_t |
segmentIndex0, |
|
|
double |
segmentFraction0, |
|
|
size_t |
componentIndex1, |
|
|
size_t |
segmentIndex1, |
|
|
double |
segmentFraction1 |
|
) |
| |
|
static |
Compares two sets of location values for order.
- Parameters
-
componentIndex0 | a component index |
segmentIndex0 | a segment index |
segmentFraction0 | a segment fraction |
componentIndex1 | another component index |
segmentIndex1 | another segment index |
segmentFraction1 | another segment fraction |
- Returns
- a negative integer, zero, or a positive integer as the first set of location values is less than, equal to, or greater than the second set of locationValues
int geos::linearref::LinearLocation::compareTo |
( |
const LinearLocation & |
other | ) |
const |
Compares this object with the specified object for order.
- Parameters
-
- Returns
- a negative integer, zero, or a positive integer as this LinearLocation is less than, equal to, or greater than the specified LinearLocation
size_t geos::linearref::LinearLocation::getComponentIndex |
( |
| ) |
const |
Gets the component index for this location.
- Returns
- the component index
double geos::linearref::LinearLocation::getSegmentFraction |
( |
| ) |
const |
size_t geos::linearref::LinearLocation::getSegmentIndex |
( |
| ) |
const |
Gets the segment index for this location.
- Returns
- the segment index
double geos::linearref::LinearLocation::getSegmentLength |
( |
const geom::Geometry * |
linearGeom | ) |
const |
Gets the length of the segment in the given Geometry containing this location.
- Parameters
-
linearGeom | a linear geometry |
- Returns
- the length of the segment
bool geos::linearref::LinearLocation::isEndpoint |
( |
const geom::Geometry & |
linearGeom | ) |
const |
Tests whether this location is an endpoint of the linear component it refers to.
- Parameters
-
linearGeom | the linear geometry referenced by this location |
- Returns
- true if the location is a component endpoint
bool geos::linearref::LinearLocation::isOnSameSegment |
( |
const LinearLocation & |
loc | ) |
const |
Tests whether two locations are on the same segment in the parent Geometry.
- Parameters
-
loc | a location on the same geometry |
- Returns
- true if the locations are on the same segment of the parent geometry
bool geos::linearref::LinearLocation::isValid |
( |
const geom::Geometry * |
linearGeom | ) |
const |
bool geos::linearref::LinearLocation::isVertex |
( |
| ) |
const |
Tests whether this location refers to a vertex.
- Returns
- true if the location is a vertex
void geos::linearref::LinearLocation::normalize |
( |
| ) |
|
|
private |
Ensures the individual values are locally valid.
Does not ensure that the indexes are valid for a particular linear geometry.
- See also
- clamp
Computes the Coordinate of a point a given fraction along the line segment (p0, p1)
.
If the fraction is greater than 1.0 the last point of the segment is returned. If the fraction is less than or equal to 0.0 the first point of the segment is returned. The Z ordinate is interpolated from the Z-ordinates of the given points, if they are specified.
- Parameters
-
p0 | the first point of the line segment |
p1 | the last point of the line segment |
frac | the length to the desired point |
- Returns
- the Coordinate of the desired point
void geos::linearref::LinearLocation::setToEnd |
( |
const geom::Geometry * |
linear | ) |
|
Sets the value of this location to refer the end of a linear geometry.
- Parameters
-
linear | the linear geometry to set |
void geos::linearref::LinearLocation::snapToVertex |
( |
const geom::Geometry * |
linearGeom, |
|
|
double |
minDistance |
|
) |
| |
Snaps the value of this location to the nearest vertex on the given linear Geometry, if the vertex is closer than minDistance
.
- Parameters
-
linearGeom | a linear geometry |
minDistance | the minimum allowable distance to a vertex |
std::ostream& operator<< |
( |
std::ostream & |
out, |
|
|
const LinearLocation & |
obj |
|
) |
| |
|
friend |
size_t geos::linearref::LinearLocation::componentIndex |
|
private |
double geos::linearref::LinearLocation::segmentFraction |
|
private |
size_t geos::linearref::LinearLocation::segmentIndex |
|
private |
The documentation for this class was generated from the following file: