Class MultiLineString

All Implemented Interfaces:
Geometry, LineTypeGeometry, Serializable, Cloneable

public class MultiLineString extends MultiCurve
This class represents a collection of LineString
A single LineString is allowed even if it's not the correct class.
See Also:
  • Constructor Details

    • MultiLineString

      public MultiLineString()
    • MultiLineString

      public MultiLineString(LineString[] curves)
  • Method Details

    • clone

      public MultiLineString clone()
      Description copied from class: GeometryCollection
      Clones this geometry.
      Specified by:
      clone in interface Geometry
      Specified by:
      clone in class GeometryCollection
      Returns:
      a deep copy of the current geometry.
    • serialize

      public Point[] serialize()
      Returns this geometry as an array of Point.
      Specified by:
      serialize in interface Geometry
      Overrides:
      serialize in class GeometryCollection
      Returns:
      this geometry as an array of Point.
    • isClosed

      public boolean isClosed()
      Specified by:
      isClosed in interface LineTypeGeometry
      Specified by:
      isClosed in class MultiCurve
    • length

      public double length()
      Returns the geometry length. If the geometry is a surface, then the geometry perimeter shall be returned.
      Specified by:
      length in interface Geometry
      Specified by:
      length in class MultiCurve
      Returns:
      the geometry length.
    • setGeometries

      public void setGeometries(Geometry[] geometries)
      Specified by:
      setGeometries in class GeometryCollection
    • getCurves

      public LineString[] getCurves()
      Returns:
    • setCurves

      public void setCurves(LineString[] curves)
      Parameters:
      curves -
    • lineIterator

      public LineGeometryIterator lineIterator()
    • 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 Object
      Returns:
      information about the current geometry.
    • getGeometryId

      public short getGeometryId()
      Returns the geometry class id. This method is useful for geometry serialization.
      Returns:
      the geometry id.
    • getGeometryType

      public int getGeometryType()
      Returns the geometry type for this geometry.
      Returns:
      the geometry type.
      See Also:
    • getCenteredPoint

      public Point getCenteredPoint()
      This method returns a point that is typically centered on the geometry. If the geometry is a point, the point is returned. If it is a line, a point on the curve interpolated at 50% is returned. If the geometry is a surface, the centroid is returned if it is inside the polygon, if not, a point inside the polygon (but likely not exactly in the center) will be returned. If the geometry is a collection, the method is called on the first part of the collection.
      Returns:
      a point likely at the center of the geometry