com.vividsolutions.jts.linearref

Class LengthLocationMap


public class LengthLocationMap
extends java.lang.Object

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.

Constructor Summary

LengthLocationMap(Geometry linearGeom)

Method Summary

static double
getLength(Geometry linearGeom, LinearLocation loc)
Computes the length for a given LinearLocation on a linear Geometry.
double
getLength(LinearLocation loc)
static LinearLocation
getLocation(Geometry linearGeom, double length)
Computes the LinearLocation for a given length along a linear Geometry.
LinearLocation
getLocation(double length)
Compute the LinearLocation corresponding to a length.

Constructor Details

LengthLocationMap

public LengthLocationMap(Geometry linearGeom)

Method Details

getLength

public static double getLength(Geometry linearGeom,
                               LinearLocation loc)
Computes the length for a given LinearLocation on a linear Geometry.
Parameters:
loc - the LinearLocation index of the location
Returns:
the length for the LinearLocation

getLength

public double getLength(LinearLocation loc)

getLocation

public static LinearLocation getLocation(Geometry linearGeom,
                                         double length)
Computes the LinearLocation for a given length along a linear Geometry.
Parameters:
length - the length index of the location
Returns:
the LinearLocation for the length

getLocation

public LinearLocation getLocation(double length)
Compute the LinearLocation corresponding to a length. Negative lengths are measured in reverse from end of the linear geometry. Out-of-range values are clamped.
Parameters:
length - the length index
Returns:
the corresponding LinearLocation