Class FacetSequence
- java.lang.Object
-
- org.locationtech.jts.operation.distance.FacetSequence
-
public class FacetSequence extends java.lang.Object
Represents a sequence of facets (points or line segments) of aGeometry
specified by a subsequence of aCoordinateSequence
.- Author:
- Martin Davis
-
-
Constructor Summary
Constructors Constructor Description FacetSequence(CoordinateSequence pts, int start)
Creates a new sequence for a single point from aCoordinateSequence
.FacetSequence(CoordinateSequence pts, int start, int end)
Creates a new sequence of facets based on aCoordinateSequence
.FacetSequence(Geometry geom, CoordinateSequence pts, int start, int end)
Creates a new sequence of facets based on aCoordinateSequence
contained in the givenGeometry
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description double
distance(FacetSequence facetSeq)
Computes the distance between this and another FacetSequence.Coordinate
getCoordinate(int index)
Envelope
getEnvelope()
boolean
isPoint()
GeometryLocation[]
nearestLocations(FacetSequence facetSeq)
Computes the locations of the nearest points between this sequence and another sequence.int
size()
java.lang.String
toString()
-
-
-
Constructor Detail
-
FacetSequence
public FacetSequence(Geometry geom, CoordinateSequence pts, int start, int end)
Creates a new sequence of facets based on aCoordinateSequence
contained in the givenGeometry
.- Parameters:
geom
- the geometry containing the facetspts
- the sequence containing the facet pointsstart
- the index of the start pointend
- the index of the end point + 1
-
FacetSequence
public FacetSequence(CoordinateSequence pts, int start, int end)
Creates a new sequence of facets based on aCoordinateSequence
.- Parameters:
pts
- the sequence containing the facet pointsstart
- the index of the start pointend
- the index of the end point + 1
-
FacetSequence
public FacetSequence(CoordinateSequence pts, int start)
Creates a new sequence for a single point from aCoordinateSequence
.- Parameters:
pts
- the sequence containing the facet pointstart
- the index of the point
-
-
Method Detail
-
getEnvelope
public Envelope getEnvelope()
-
size
public int size()
-
getCoordinate
public Coordinate getCoordinate(int index)
-
isPoint
public boolean isPoint()
-
distance
public double distance(FacetSequence facetSeq)
Computes the distance between this and another FacetSequence.- Parameters:
facetSeq
- the sequence to compute the distance to- Returns:
- the minimum distance between the sequences
-
nearestLocations
public GeometryLocation[] nearestLocations(FacetSequence facetSeq)
Computes the locations of the nearest points between this sequence and another sequence. The locations are presented in the same order as the input sequences.- Returns:
- a pair of
GeometryLocation
s for the nearest points
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-