Class Complex

All Implemented Interfaces:
Geometry, Serializable, Cloneable

public class Complex extends GeometryCollection
Complex is the subclass of collection used to describe collection with various type of geometries. This inhomogeneity is not verified by constructors
See Also:
  • Constructor Details

    • Complex

      public Complex()
      Constructs an empty instance of Complex.
    • Complex

      public Complex(Geometry[] geometries)
      Constructs a Complex object containing all the geometries
      Parameters:
      geometries -
  • Method Details

    • addGeometry

      public void addGeometry(Geometry geometry)
    • setGeometries

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

      public void removeGeometry(Geometry geometry)
    • 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.
    • clone

      public Complex clone()
      Clones this geometry.
      Specified by:
      clone in interface Geometry
      Specified by:
      clone in class GeometryCollection
      Returns:
      a deep copy of the current geometry.
    • getGeometryId

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

      public int getGeometryType()
      Description copied from interface: Geometry
      Returns the geometry type for this geometry.
      Returns:
      the geometry type.
      See Also:
    • getCenteredPoint

      public Point getCenteredPoint()
      Description copied from interface: Geometry
      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
      See Also:
    • centroid

      public Point centroid(List<Point> validCentredPoints)