Class CoordinateArraySequence

  • All Implemented Interfaces:
    Serializable, Cloneable, CoordinateSequence

    public class CoordinateArraySequence
    extends Object
    implements CoordinateSequence, Serializable
    A CoordinateSequence backed by an array of Coordinates. This is the implementation that Geometrys use by default. Coordinates returned by #toArray and #getCoordinate are live -- modifications to them are actually changing the CoordinateSequence's underlying data. A dimension may be specified for the coordinates in the sequence, which may be 2 or 3. The actual coordinates will always have 3 ordinates, but the dimension is useful as metadata in some situations.
    Version:
    1.7
    See Also:
    Serialized Form
    • Constructor Detail

      • CoordinateArraySequence

        public CoordinateArraySequence​(Coordinate[] coordinates)
        Constructs a sequence based on the given array of Coordinates (the array is not copied). The coordinate dimension defaults to 3.
        Parameters:
        coordinates - the coordinate array that will be referenced.
      • CoordinateArraySequence

        public CoordinateArraySequence​(Coordinate[] coordinates,
                                       int dimension)
        Constructs a sequence based on the given array of Coordinates (the array is not copied).
        Parameters:
        coordinates - the coordinate array that will be referenced.
        dimension - the dimension of the coordinates
      • CoordinateArraySequence

        public CoordinateArraySequence​(Coordinate[] coordinates,
                                       int dimension,
                                       int measures)
        Constructs a sequence based on the given array of Coordinates (the array is not copied).
        Parameters:
        coordinates - the coordinate array that will be referenced.
        dimension - the dimension of the coordinates
      • CoordinateArraySequence

        public CoordinateArraySequence​(int size)
        Constructs a sequence of a given size, populated with new Coordinates.
        Parameters:
        size - the size of the sequence to create
      • CoordinateArraySequence

        public CoordinateArraySequence​(int size,
                                       int dimension)
        Constructs a sequence of a given size, populated with new Coordinates.
        Parameters:
        size - the size of the sequence to create
        dimension - the dimension of the coordinates
      • CoordinateArraySequence

        public CoordinateArraySequence​(int size,
                                       int dimension,
                                       int measures)
        Constructs a sequence of a given size, populated with new Coordinates.
        Parameters:
        size - the size of the sequence to create
        dimension - the dimension of the coordinates
      • CoordinateArraySequence

        public CoordinateArraySequence​(CoordinateSequence coordSeq)
        Creates a new sequence based on a deep copy of the given CoordinateSequence. The coordinate dimension is set to equal the dimension of the input.
        Parameters:
        coordSeq - the coordinate sequence that will be copied.