Package org.locationtech.jts.linearref
Class ExtractLineByLocation
- java.lang.Object
-
- org.locationtech.jts.linearref.ExtractLineByLocation
-
class ExtractLineByLocation extends java.lang.ObjectExtracts the subline of a linearGeometrybetween twoLinearLocations on the line.
-
-
Constructor Summary
Constructors Constructor Description ExtractLineByLocation(Geometry line)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private LineStringcomputeLine(LinearLocation start, LinearLocation end)Assumes input is valid (e.g.private GeometrycomputeLinear(LinearLocation start, LinearLocation end)Assumes input is valid (e.g.static Geometryextract(Geometry line, LinearLocation start, LinearLocation end)Computes the subline of aLineStringbetween twoLinearLocations on the line.Geometryextract(LinearLocation start, LinearLocation end)Extracts a subline of the input.private Geometryreverse(Geometry linear)
-
-
-
Field Detail
-
line
private Geometry line
-
-
Constructor Detail
-
ExtractLineByLocation
public ExtractLineByLocation(Geometry line)
-
-
Method Detail
-
extract
public static Geometry extract(Geometry line, LinearLocation start, LinearLocation end)
Computes the subline of aLineStringbetween twoLinearLocations on the line. If the start location is after the end location, the computed linear geometry has reverse orientation to the input line.- Parameters:
line- the line to use as the baselinestart- the start locationend- the end location- Returns:
- the extracted subline
-
extract
public Geometry extract(LinearLocation start, LinearLocation end)
Extracts a subline of the input. Ifend < startthe linear geometry computed will be reversed.- Parameters:
start- the start locationend- the end location- Returns:
- a linear geometry
-
computeLine
private LineString computeLine(LinearLocation start, LinearLocation end)
Assumes input is valid (e.g. start <= end)- Parameters:
start-end-- Returns:
- a linear geometry
-
computeLinear
private Geometry computeLinear(LinearLocation start, LinearLocation end)
Assumes input is valid (e.g. start <= end)- Parameters:
start-end-- Returns:
- a linear geometry
-
-