Package org.meteoinfo.jts.linearref
Class LengthLocationMap
- java.lang.Object
-
- org.meteoinfo.jts.linearref.LengthLocationMap
-
public class LengthLocationMap extends java.lang.ObjectComputes theLinearLocationfor a given length along a linearGeometry. Negative lengths are measured in reverse from end of the linear geometry. Out-of-range values are clamped.
-
-
Constructor Summary
Constructors Constructor Description LengthLocationMap(Geometry linearGeom)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static doublegetLength(Geometry linearGeom, LinearLocation loc)Computes the length for a givenLinearLocationon a linearGeometry.doublegetLength(LinearLocation loc)LinearLocationgetLocation(double length)Compute theLinearLocationcorresponding to a length.LinearLocationgetLocation(double length, boolean resolveLower)Compute theLinearLocationcorresponding to a length.static LinearLocationgetLocation(Geometry linearGeom, double length)Computes theLinearLocationfor a given length along a linearGeometry.static LinearLocationgetLocation(Geometry linearGeom, double length, boolean resolveLower)Computes theLinearLocationfor a given length along a linearGeometry, with control over how the location is resolved at component endpoints.
-
-
-
Constructor Detail
-
LengthLocationMap
public LengthLocationMap(Geometry linearGeom)
-
-
Method Detail
-
getLocation
public static LinearLocation getLocation(Geometry linearGeom, double length)
Computes theLinearLocationfor a given length along a linearGeometry.- Parameters:
linearGeom- the linear geometry to uselength- the length index of the location- Returns:
- the
LinearLocationfor the length
-
getLocation
public static LinearLocation getLocation(Geometry linearGeom, double length, boolean resolveLower)
Computes theLinearLocationfor 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
LinearLocationfor the length
-
getLength
public static double getLength(Geometry linearGeom, LinearLocation loc)
Computes the length for a givenLinearLocationon a linearGeometry.- Parameters:
linearGeom- the linear geometry to useloc- theLinearLocationindex of the location- Returns:
- the length for the
LinearLocation
-
getLocation
public LinearLocation getLocation(double length)
Compute theLinearLocationcorresponding 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
public LinearLocation getLocation(double length, boolean resolveLower)
Compute theLinearLocationcorresponding 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
-
getLength
public double getLength(LinearLocation loc)
-
-