Class CompoundCurve

  • All Implemented Interfaces:
    LineBasedGeometry, java.io.Serializable, java.lang.Iterable<LineString>

    @NonNullByDefault
    public class CompoundCurve
    extends Curve
    implements java.lang.Iterable<LineString>
    A compound curve is a single, continuous curve that has both curved (circular) segments and linear segments. That means that in addition to having well-formed components, the end point of every component (except the last) must be coincident with the start point of the following component. Just note: here it is treated as a special MultiCurve where the end points of all contained lines match.
    Author:
    Sebastian Baumhekel
    See Also:
    Serialized Form
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static int TYPE
      The OGIS geometry type number for single, continuous curves that have both curved (circular) segments and linear segments.
    • Constructor Summary

      Constructors 
      Constructor Description
      CompoundCurve()
      Constructs an instance.
      CompoundCurve​(java.lang.Iterable<? extends LineString> geoms)
      Constructs an instance.
    • Field Detail

      • TYPE

        public static final int TYPE
        The OGIS geometry type number for single, continuous curves that have both curved (circular) segments and linear segments.
        See Also:
        Constant Field Values
    • Constructor Detail

      • CompoundCurve

        public CompoundCurve()
        Constructs an instance.
      • CompoundCurve

        public CompoundCurve​(java.lang.Iterable<? extends LineString> geoms)
        Constructs an instance.
        Parameters:
        geoms - geometries
    • Method Detail

      • add

        public void add​(LineString geom)
        Adds a geometry.
        Parameters:
        geom - geometry
      • addAll

        public final void addAll​(java.lang.Iterable<? extends LineString> geoms)
        Adds all given geometries.
        Parameters:
        geoms - geometries
      • checkConsistency

        public boolean checkConsistency()
        Description copied from class: Geometry
        Do some internal consistency checks on the geometry. Currently, all Geometries must have a valid dimension (2 or 3) and a valid type. Composed geometries must have all equal SRID, dimensionality and measures, as well as that they do not contain NULL or inconsistent subgeometries. BinaryParser and WKTParser should only generate consistent geometries. BinaryWriter may produce invalid results on inconsistent geometries.
        Overrides:
        checkConsistency in class Geometry
        Returns:
        true if all checks are passed.
      • close

        public void close()
        Closes this Curve if the last coordinate is not already the same as the first coordinate.
        Specified by:
        close in class Curve
      • equals

        public boolean equals​(@Nullable
                              java.lang.Object other)
        Description copied from class: Geometry
        java.lang.Object equals implementation
        Overrides:
        equals in class Geometry
        Parameters:
        other - geometry to compare
        Returns:
        true if equal, false otherwise
      • getCoordinates

        public java.lang.Iterable<Point> getCoordinates()
        Description copied from class: Geometry
        Gets the coordinates of this Geometry.
        Specified by:
        getCoordinates in class Geometry
        Returns:
        coordinates
      • getGeometries

        public java.util.Collection<LineString> getGeometries()
        Gets all geometries.
        Returns:
        geometries
      • getNumberOfCoordinates

        public int getNumberOfCoordinates()
        Description copied from class: Geometry
        Gets the number of coordinates of this Geometry.
        Specified by:
        getNumberOfCoordinates in class Geometry
        Returns:
        number of coordinates
      • hasMeasure

        public boolean hasMeasure()
        Description copied from class: Geometry
        Returns whether we have a measure (4th dimension)
        Specified by:
        hasMeasure in class Geometry
        Returns:
        true if the geometry has a measure, false otherwise
      • is3d

        public boolean is3d()
        Description copied from class: Geometry
        Checks if this Geometry is 3d.
        Specified by:
        is3d in class Geometry
        Returns:
        true on success, else false
      • isEmpty

        public boolean isEmpty()
        Checks, if there are no sub-geometries.
        Specified by:
        isEmpty in class Geometry
        Returns:
        true on success, else false
      • iterator

        public java.util.Iterator<LineString> iterator()
        Specified by:
        iterator in interface java.lang.Iterable<LineString>
      • reverse

        public void reverse()
        Description copied from class: Curve
        Reverses this linestring.
        Specified by:
        reverse in class Curve
      • setSrid

        public void setSrid​(int srid)
        Description copied from class: Geometry
        Recursively sets the srid on this geometry and all contained subgeometries
        Overrides:
        setSrid in class Geometry
        Parameters:
        srid - the SRID for this geometry
      • size

        public int size()
        Gets the number of contained geometries.
        Returns:
        number of contained geometries