Class LinearRing

All Implemented Interfaces:
Curve, Geometry, LineTypeGeometry, Serializable, Cloneable

public class LinearRing extends LineString
This class represents a closed LineString. The first and last point are equal.
See Also:
  • Constructor Details

    • LinearRing

      public LinearRing()
    • LinearRing

      public LinearRing(Point[] coords)
    • LinearRing

      public LinearRing(double[] tab)
  • Method Details

    • setCoords

      public void setCoords(Point[] coords)
      Overrides:
      setCoords in class LineString
    • isRing

      public boolean isRing()
      always true
      Specified by:
      isRing in interface Curve
      Overrides:
      isRing in class LineString
      Returns:
    • toString

      public String toString()
      Description copied from interface: Geometry
      Returns information about the current geometry.
      Specified by:
      toString in interface Geometry
      Overrides:
      toString in class LineString
      Returns:
      information about the current geometry.
    • clone

      public LinearRing clone()
      Clones this geometry.
      Specified by:
      clone in interface Curve
      Specified by:
      clone in interface Geometry
      Overrides:
      clone in class LineString
      Returns:
      a deep copy of the current geometry.
    • spatiallyEquals

      public boolean spatiallyEquals(Geometry o, PrecisionModel precisionModel)
      Description copied from class: LineString
      Tests if this geometry is equal to the argument, on a topological point of view.
      Specified by:
      spatiallyEquals in interface Geometry
      Overrides:
      spatiallyEquals in class LineString
      Parameters:
      o - the geometry to be tested.
      precisionModel - the precision model to use while comparing geometries.
      Returns:
      whether both geometries are spatially equals.
    • spatiallyEquals

      public boolean spatiallyEquals(LinearRing ring)
      Tests if this geometry is equal to the argument, on a topological point of view
      it means that they represents the same geometry, even if it is described differently (orientation of the rings, order of the rings)
      it does not remove additional points on lineString (3 points aligned), one must use smoother.removeExtraPoints() before in order to achieve that. here we first try to find a common point, then test equality in both orientation,
    • spatiallyEquals

      public boolean spatiallyEquals(LinearRing ring, PrecisionModel precisionModel)
      Tests if this geometry is equal to the argument, on a topological point of view
      it means that they represents the same geometry, even if it is described differently (orientation of the rings, order of the rings)
      it does not remove additional points on lineString (3 points aligned), one must use smoother.removeExtraPoints() before in order to achieve that. here we first try to find a common point, then test equality in both orientation,
      Parameters:
      ring -
    • getGeometryId

      public short getGeometryId()
      Description copied from class: LineString
      Returns the geometry class id. This method is useful for geometry serialization.
      Specified by:
      getGeometryId in interface Geometry
      Overrides:
      getGeometryId in class LineString
      Returns:
      the geometry id.
    • isValid

      public boolean isValid()
      Tests if the ring is valid. To be valid : Must have 0 or at least 3 coordinates, and first and last coordinate must be equal.
      Returns:
      true if valid