Class FacetSequence


  • public class FacetSequence
    extends java.lang.Object
    Represents a sequence of facets (points or line segments) of a Geometry specified by a subsequence of a CoordinateSequence.
    Author:
    Martin Davis
    • Constructor Detail

      • FacetSequence

        public FacetSequence​(Geometry geom,
                             CoordinateSequence pts,
                             int start,
                             int end)
        Creates a new sequence of facets based on a CoordinateSequence contained in the given Geometry.
        Parameters:
        geom - the geometry containing the facets
        pts - the sequence containing the facet points
        start - the index of the start point
        end - the index of the end point + 1
      • FacetSequence

        public FacetSequence​(CoordinateSequence pts,
                             int start,
                             int end)
        Creates a new sequence of facets based on a CoordinateSequence.
        Parameters:
        pts - the sequence containing the facet points
        start - the index of the start point
        end - the index of the end point + 1
      • FacetSequence

        public FacetSequence​(CoordinateSequence pts,
                             int start)
        Creates a new sequence for a single point from a CoordinateSequence.
        Parameters:
        pts - the sequence containing the facet point
        start - 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 GeometryLocations for the nearest points
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object