Package org.locationtech.jts.linearref
Class LengthLocationMap
java.lang.Object
org.locationtech.jts.linearref.LengthLocationMap
Computes the
LinearLocation
for a given length
along a linear Geometry
.
Negative lengths are measured in reverse from end of the linear geometry.
Out-of-range values are clamped.-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic double
getLength
(Geometry linearGeom, LinearLocation loc) Computes the length for a givenLinearLocation
on a linearGeometry
.double
getLength
(LinearLocation loc) getLocation
(double length) Compute theLinearLocation
corresponding to a length.getLocation
(double length, boolean resolveLower) Compute theLinearLocation
corresponding to a length.static LinearLocation
getLocation
(Geometry linearGeom, double length) Computes theLinearLocation
for a given length along a linearGeometry
.static LinearLocation
getLocation
(Geometry linearGeom, double length, boolean resolveLower) Computes theLinearLocation
for a given length along a linearGeometry
, with control over how the location is resolved at component endpoints.private LinearLocation
getLocationForward
(double length) private LinearLocation
-
Field Details
-
linearGeom
-
-
Constructor Details
-
LengthLocationMap
-
-
Method Details
-
getLocation
Computes theLinearLocation
for a given length along a linearGeometry
.- Parameters:
linearGeom
- the linear geometry to uselength
- the length index of the location- Returns:
- the
LinearLocation
for the length
-
getLocation
Computes theLinearLocation
for a given length along a linearGeometry
, with control over how the location is resolved at component endpoints.- Parameters:
linearGeom
- the linear geometry to uselength
- the length index of the locationresolveLower
- if true lengths are resolved to the lowest possible index- Returns:
- the
LinearLocation
for the length
-
getLength
Computes the length for a givenLinearLocation
on a linearGeometry
.- Parameters:
linearGeom
- the linear geometry to useloc
- theLinearLocation
index of the location- Returns:
- the length for the
LinearLocation
-
getLocation
Compute theLinearLocation
corresponding to a length. Negative lengths are measured in reverse from end of the linear geometry. Out-of-range values are clamped. Ambiguous indexes are resolved to the lowest possible location value.- Parameters:
length
- the length index- Returns:
- the corresponding LinearLocation
-
getLocation
Compute theLinearLocation
corresponding to a length. Negative lengths are measured in reverse from end of the linear geometry. Out-of-range values are clamped. Ambiguous indexes are resolved to the lowest or highest possible location value, depending on the value of resolveLower- Parameters:
length
- the length index- Returns:
- the corresponding LinearLocation
-
getLocationForward
-
resolveHigher
-
getLength
-