Klasse PolygonBase<T extends Curve>

java.lang.Object
io.github.sebasbaumh.postgis.Geometry
io.github.sebasbaumh.postgis.PolygonBase<T>
Typparameter:
T - type of the ring geometries
Alle implementierten Schnittstellen:
LineBasedGeometry, Serializable, Iterable<T>
Bekannte direkte Unterklassen:
CurvePolygon, Polygon

@NonNullByDefault public abstract class PolygonBase<T extends Curve> extends Geometry implements Iterable<T>, LineBasedGeometry
Base class for a polygon to allow similar handling of straight and circular polygons.
Autor:
Sebastian Baumhekel
Siehe auch:
  • Konstruktordetails

    • PolygonBase

      protected PolygonBase(int type, Class<U> clazzRing)
      Constructor for subclasses.
      Parameter:
      type - has to be given by all subclasses
      clazzRing - class of the ring
    • PolygonBase

      protected PolygonBase(int type, Class<U> clazzRing, Iterable<V> rings)
      Constructor for subclasses.
      Parameter:
      type - has to be given by all subclasses
      clazzRing - class of the ring
      rings - rings
    • PolygonBase

      protected PolygonBase(int type, U lsOuterRing)
      Constructor for subclasses.
      Parameter:
      type - has to be given by all subclasses
      lsOuterRing - outer ring
  • Methodendetails

    • addRing

      public void addRing(T ring)
      Adds a ring.
      Parameter:
      ring - ring
    • checkConsistency

      public boolean checkConsistency()
      Beschreibung aus Klasse kopiert: 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.
      Setzt außer Kraft:
      checkConsistency in Klasse Geometry
      Gibt zurück:
      true if all checks are passed.
    • clearRings

      public void clearRings()
      Clears all rings.
    • equals

      public boolean equals(@Nullable Object other)
      Beschreibung aus Klasse kopiert: Geometry
      java.lang.Object equals implementation
      Setzt außer Kraft:
      equals in Klasse Geometry
      Parameter:
      other - geometry to compare
      Gibt zurück:
      true if equal, false otherwise
    • getCoordinates

      public Iterable<Point> getCoordinates()
      Beschreibung aus Klasse kopiert: Geometry
      Gets the coordinates of this Geometry.
      Angegeben von:
      getCoordinates in Klasse Geometry
      Gibt zurück:
      coordinates
    • getEndPoint

      @Nullable public Point getEndPoint()
      Beschreibung aus Schnittstelle kopiert: LineBasedGeometry
      Gets the end point.
      Angegeben von:
      getEndPoint in Schnittstelle LineBasedGeometry
      Gibt zurück:
      Point on success, else null
    • getNumberOfCoordinates

      public int getNumberOfCoordinates()
      Beschreibung aus Klasse kopiert: Geometry
      Gets the number of coordinates of this Geometry.
      Angegeben von:
      getNumberOfCoordinates in Klasse Geometry
      Gibt zurück:
      number of coordinates
    • getNumberOfRings

      public int getNumberOfRings()
      Gets the number of rings.
      Gibt zurück:
      number of rings.
    • getOuterRing

      public T getOuterRing()
      Gets the outer ring/boundary of the polygon.
      Gibt zurück:
      outer ring
    • getRings

      public Iterable<T> getRings()
      Gets all inner rings.
      Gibt zurück:
      inner rings
    • getStartPoint

      @Nullable public Point getStartPoint()
      Beschreibung aus Schnittstelle kopiert: LineBasedGeometry
      Gets the start point.
      Angegeben von:
      getStartPoint in Schnittstelle LineBasedGeometry
      Gibt zurück:
      Point on success, else null
    • hashCode

      public int hashCode()
      Setzt außer Kraft:
      hashCode in Klasse Geometry
    • hasMeasure

      public boolean hasMeasure()
      Beschreibung aus Klasse kopiert: Geometry
      Returns whether we have a measure (4th dimension)
      Angegeben von:
      hasMeasure in Klasse Geometry
      Gibt zurück:
      true if the geometry has a measure, false otherwise
    • is3d

      public boolean is3d()
      Beschreibung aus Klasse kopiert: Geometry
      Checks if this Geometry is 3d.
      Angegeben von:
      is3d in Klasse Geometry
      Gibt zurück:
      true on success, else false
    • isClockwise

      public boolean isClockwise()
      Checks if this polygon is oriented in clockwise direction. Is false for the outer polygon and true for its holes.
      Gibt zurück:
      true on success, else false
    • isClosed

      public boolean isClosed()
      Beschreibung aus Schnittstelle kopiert: LineBasedGeometry
      Checks if this line is closed, so the last coordinate is the same as the first coordinate.
      Angegeben von:
      isClosed in Schnittstelle LineBasedGeometry
      Gibt zurück:
      true on success, else false
    • isEmpty

      public boolean isEmpty()
      Beschreibung aus Klasse kopiert: Geometry
      Ist this Geometry empty, so does it contain no coordinates or other geometries?
      Angegeben von:
      isEmpty in Klasse Geometry
      Gibt zurück:
      true on success, else false
    • iterator

      public Iterator<T> iterator()
      Angegeben von:
      iterator in Schnittstelle Iterable<T extends Curve>
    • length

      public double length()
      Beschreibung aus Schnittstelle kopiert: LineBasedGeometry
      Gets the length of this line.
      Angegeben von:
      length in Schnittstelle LineBasedGeometry
      Gibt zurück:
      length
    • setOuterRing

      public void setOuterRing(T ls)
      Sets the outer ring/boundary of the polygon.
      Parameter:
      ls - outer ring
    • toString

      public String toString()
      Setzt außer Kraft:
      toString in Klasse Object