Class TLcdGML2Polygon

All Implemented Interfaces:
ILcdDataObject, ILcdBounded, ILcdComplexPolygon, ILcdEditableSurface, ILcdPointList, ILcdShape, ILcdSurface, ILcdCloneable, ILcdDeepCloneable, ILcdFeatured, ILcdSelfDescribedFeatured, Serializable, Cloneable

public class TLcdGML2Polygon extends TLcdGML2AbstractGeometry implements ILcdEditableSurface, ILcdComplexPolygon
A Polygon is defined by an outer boundary and zero or more inner boundaries which are in turn defined by LinearRings.
Since:
10.0
See Also:
  • Field Details

    • OUTER_BOUNDARY_IS_PROPERTY

      public static final TLcdDataProperty OUTER_BOUNDARY_IS_PROPERTY
      Data property that maps to the outerBoundaryIs element. The possible values for this property are instances of TLcdGML2LinearRingMember.
    • INNER_BOUNDARY_IS_PROPERTY

      public static final TLcdDataProperty INNER_BOUNDARY_IS_PROPERTY
      Data property that maps to the innerBoundaryIs element. The possible values for this property are instances of List<TLcdGML2LinearRingMember>.
  • Constructor Details

  • Method Details

    • getPolygon

      public ILcdPolygon getPolygon(int aIndex) throws IndexOutOfBoundsException
      Description copied from interface: ILcdComplexPolygon
      Returns the ILcdPolygon at the given index.
      Specified by:
      getPolygon in interface ILcdComplexPolygon
      Parameters:
      aIndex - a valid index in the list of ILcdPolygon objects.
      Returns:
      the ILcdPolygon at the given index.
      Throws:
      IndexOutOfBoundsException - when the index is not valid.
    • getPolygonCount

      public int getPolygonCount()
      Description copied from interface: ILcdComplexPolygon
      Returns the number of ILcdPolygon objects in the list.
      Specified by:
      getPolygonCount in interface ILcdComplexPolygon
      Returns:
      the number of ILcdPolygon objects in the list.
    • getPointCount

      public int getPointCount()
      Description copied from interface: ILcdPointList
      Returns the number of ILcdPoint objects in the list.
      Specified by:
      getPointCount in interface ILcdPointList
      Returns:
      the number of ILcdPoint objects in the list.
    • getPoint

      public ILcdPoint getPoint(int aIndex) throws IndexOutOfBoundsException
      Description copied from interface: ILcdPointList
      Returns the ILcdPoint at a given index.
      Specified by:
      getPoint in interface ILcdPointList
      Parameters:
      aIndex - a valid index in the list of ILcdPoint objects.
      Returns:
      the ILcdPoint at the given index.
      Throws:
      IndexOutOfBoundsException - if the given index is out of bounds.
    • setExteriorRing

      public void setExteriorRing(ILcdRing aExteriorRing)
      Description copied from interface: ILcdEditableSurface
      Sets the exterior boundary of this surface.

      Note that this implementations may throw a ClassCastException or IllegalArgumentException in case the class of the ring is not compatible with the implementation of the surface. Implementations should specify in their documentation all restrictions that apply in this context.

      Specified by:
      setExteriorRing in interface ILcdEditableSurface
      Parameters:
      aExteriorRing - the exterior boundary of this surface.
    • getExteriorRing

      public ILcdRing getExteriorRing()
      Description copied from interface: ILcdSurface
      Returns the exterior boundary of this surface.
      Specified by:
      getExteriorRing in interface ILcdSurface
      Returns:
      the exterior boundary of this surface.
    • getInteriorRings

      public List<ILcdRing> getInteriorRings()
      Description copied from interface: ILcdEditableSurface
      Returns the holes in this surface, as a list of ILcdRing instances. If there are no holes, an empty list is returned.

      The returned list is editable and can be used to add, remove or replace interior rings.

      Specified by:
      getInteriorRings in interface ILcdEditableSurface
      Specified by:
      getInteriorRings in interface ILcdSurface
      Returns:
      an editable list containing zero or more rings, representing the holes in this surface.
    • contains2D

      public boolean contains2D(double aX, double aY)
      Description copied from interface: ILcdShape
      Checks whether this ILcdShape contains the given point in the 2D space. Only the first two dimensions of the ILcdShape are considered.
      Specified by:
      contains2D in interface ILcdShape
      Overrides:
      contains2D in class TLcdGML2AbstractGeometry
      Parameters:
      aX - the x coordinate of the point.
      aY - the y coordinate of the point.
      Returns:
      the boolean result of the containment test.
    • contains3D

      public boolean contains3D(double aX, double aY, double aZ)
      Description copied from interface: ILcdShape
      Checks whether this ILcdShape contains the given point in the 3D space.
      Specified by:
      contains3D in interface ILcdShape
      Overrides:
      contains3D in class TLcdGML2AbstractGeometry
      Parameters:
      aX - the x coordinate of the point.
      aY - the y coordinate of the point.
      aZ - the z coordinate of the point.
      Returns:
      the boolean result of the containment test.
    • contains2D

      public boolean contains2D(ILcdPoint aPoint)
      Description copied from interface: ILcdShape
      Checks whether this ILcdShape contains the given ILcdPoint in the 2D space. Only the first two dimensions of the ILcdShape and the ILcdPoint are considered.
      Specified by:
      contains2D in interface ILcdShape
      Overrides:
      contains2D in class TLcdGML2AbstractGeometry
      Parameters:
      aPoint - the ILcdPoint to test.
      Returns:
      the boolean result of the containment test.
      See Also:
    • contains3D

      public boolean contains3D(ILcdPoint aPoint)
      Description copied from interface: ILcdShape
      Checks whether this ILcdShape contains the given ILcdPoint in the 3D space.
      Specified by:
      contains3D in interface ILcdShape
      Overrides:
      contains3D in class TLcdGML2AbstractGeometry
      Parameters:
      aPoint - the ILcdPoint to test.
      Returns:
      the boolean result of the containment test.
      See Also:
    • getFocusPoint

      public ILcdPoint getFocusPoint()
      Description copied from interface: ILcdShape
      Returns the focus point of this ILcdShape.
      Specified by:
      getFocusPoint in interface ILcdShape
      Overrides:
      getFocusPoint in class TLcdGML2AbstractGeometry
      Returns:
      the focus point of this ILcdShape.
    • getBounds

      public ILcdBounds getBounds()
      Description copied from interface: ILcdBounded
      Returns the ILcdBounds by which the geometry of this ILcdBounded object is bounded.

      If the geometry does not allow retrieving valid bounds (for example a polyline with 0 points) the return value is unspecified. It is highly recommended to return an undefined bounds. You can create undefined bounds using the default constructors of TLcdLonLatBounds or TLcdXYBounds.

      Specified by:
      getBounds in interface ILcdBounded
      Overrides:
      getBounds in class TLcdGML2AbstractGeometry
      Returns:
      the ILcdBounds by which the geometry of this ILcdBounded object is bounded.
    • clone

      public TLcdGML2Polygon clone()
      Description copied from class: TLcdDataObject
      Returns a deep clone of this object. This method delegates to TLcdDataObject.clone(Map).
      Specified by:
      clone in interface ILcdCloneable
      Overrides:
      clone in class TLcdDataObject
      Returns:
      a deep clone of this object
      See Also:
    • clone

      public TLcdDataObject clone(Map aObjectDictionary)
      Description copied from class: TLcdDataObject
      Returns a deep clone of this object. If the clone is not already present in the dictionary, a new instance if created as follows:
      • First, a new instance is created using Java's clone() mechanism.
      • Then, all properties of this object are cloned and set on the newly created instance. A property is cloned as follows:
        • If the property value is an ILcdDataObject, the value is cloned by first creating a new instance via the value.getDataType().newInstance() method, and then cloning its properties one by one.
        • If the value implements ILcdDeepCloneable or ILcdCloneable then this interface is used to clone the value.
        • Otherwise, the property value is copied by reference.
      Specified by:
      clone in interface ILcdDeepCloneable
      Overrides:
      clone in class TLcdDataObject
      Parameters:
      aObjectDictionary - the Object dictionary that keeps track of the objects for which a clone has already been made, and their corresponding clone Object.
      Returns:
      a deep clone of this object
    • getOuterBoundaryIs

      public TLcdGML2LinearRingMember getOuterBoundaryIs()
      Returns the value of the property that maps to the outerBoundaryIs element.
      Returns:
      the value of the OUTER_BOUNDARY_IS_PROPERTY property.
    • setOuterBoundaryIs

      public void setOuterBoundaryIs(TLcdGML2LinearRingMember aValue)
      Sets the value of the property that maps to the outerBoundaryIs element.
      Parameters:
      aValue - the value to set for the OUTER_BOUNDARY_IS_PROPERTY property.
    • getInnerBoundaryIs

      public List<TLcdGML2LinearRingMember> getInnerBoundaryIs()
      Returns the value of the property that maps to the innerBoundaryIs element.
      Returns:
      the value of the INNER_BOUNDARY_IS_PROPERTY property.