Class UniqueCoordinateArrayFilter

  • All Implemented Interfaces:
    CoordinateFilter

    public class UniqueCoordinateArrayFilter
    extends java.lang.Object
    implements CoordinateFilter
    A CoordinateFilter that builds a set of Coordinates. The set of coordinates contains no duplicate points. It preserves the order of the input points.
    Version:
    1.7
    • Field Detail

      • treeSet

        java.util.TreeSet treeSet
      • list

        java.util.ArrayList list
    • Constructor Detail

      • UniqueCoordinateArrayFilter

        public UniqueCoordinateArrayFilter()
    • Method Detail

      • filterCoordinates

        public static Coordinate[] filterCoordinates​(Coordinate[] coords)
        Convenience method which allows running the filter over an array of Coordinates.
        Parameters:
        coords - an array of coordinates
        Returns:
        an array of the unique coordinates
      • getCoordinates

        public Coordinate[] getCoordinates()
        Returns the gathered Coordinates.
        Returns:
        the Coordinates collected by this CoordinateArrayFilter
      • filter

        public void filter​(Coordinate coord)
        Description copied from interface: CoordinateFilter
        Performs an operation with the coord. There is no guarantee that the coordinate is the actual object stored in the target geometry.
        Specified by:
        filter in interface CoordinateFilter
        Parameters:
        coord - a Coordinate to which the filter is applied.