Class KmlGeometry


  • public final class KmlGeometry
    extends java.lang.Object
    A KML geometry contains all the KML specific information associated with a geometry.
    Since:
    100.4.0
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  KmlGeometry.Type
      The list of KML geometry types.
    • Constructor Summary

      Constructors 
      Constructor Description
      KmlGeometry​(Geometry geometry, KmlAltitudeMode kmlAltitudeMode)
      Constructs a KmlGeometry with the given simple Geometry and KmlAltitudeMode.
      KmlGeometry​(Geometry geometry, KmlAltitudeMode kmlAltitudeMode, boolean isExtruded)
      Constructs a KmlGeometry with the given simple Geometry and KmlAltitudeMode.
      KmlGeometry​(Geometry geometry, KmlAltitudeMode kmlAltitudeMode, boolean isExtruded, boolean isTessellated)
      Constructs a KmlGeometry with the given simple Geometry and KmlAltitudeMode.
    • Constructor Detail

      • KmlGeometry

        public KmlGeometry​(Geometry geometry,
                           KmlAltitudeMode kmlAltitudeMode)
        Constructs a KmlGeometry with the given simple Geometry and KmlAltitudeMode.

        By default, it sets both geometry extrusion and tessellation to false.

        Parameters:
        geometry - a Geometry excluding multi-point type, polyline and polygon with multi-parts
        kmlAltitudeMode - a KmlAltitudeMode
        Throws:
        java.lang.IllegalArgumentException - if geometry is null
        java.lang.IllegalArgumentException - if kmlAltitudeMode is null
        Since:
        100.6.0
      • KmlGeometry

        public KmlGeometry​(Geometry geometry,
                           KmlAltitudeMode kmlAltitudeMode,
                           boolean isExtruded)
        Constructs a KmlGeometry with the given simple Geometry and KmlAltitudeMode.

        By default, it sets geometry tessellation to false.

        Parameters:
        geometry - a Geometry excluding multi-point type, polyline and polygon with multi-parts
        kmlAltitudeMode - a KmlAltitudeMode
        isExtruded - specifies whether to connect the geometry to the ground. To extrude a geometry, kmlAltitudeMode value should be KmlAltitudeMode.ABSOLUTE or KmlAltitudeMode.RELATIVE_TO_GROUND
        Throws:
        java.lang.IllegalArgumentException - if geometry is null
        java.lang.IllegalArgumentException - if kmlAltitudeMode is null
        Since:
        100.6.0
      • KmlGeometry

        public KmlGeometry​(Geometry geometry,
                           KmlAltitudeMode kmlAltitudeMode,
                           boolean isExtruded,
                           boolean isTessellated)
        Constructs a KmlGeometry with the given simple Geometry and KmlAltitudeMode.
        Parameters:
        geometry - a Geometry excluding multi-point type, polyline and polygon with multi-parts
        kmlAltitudeMode - a KmlAltitudeMode
        isExtruded - specifies whether to connect the geometry to the ground. To extrude a geometry, kmlAltitudeMode value should be KmlAltitudeMode.ABSOLUTE or KmlAltitudeMode.RELATIVE_TO_GROUND
        isTessellated - specifies whether to drape the geometry over the terrain. To enable tessellation, kmlAltitudeMode value should be KmlAltitudeMode.CLAMP_TO_GROUND. It is only enabled for Polyline geometry type.
        Throws:
        java.lang.IllegalArgumentException - if geometry is null
        java.lang.IllegalArgumentException - if kmlAltitudeMode is null
        Since:
        100.6.0
    • Method Detail

      • getAltitudeMode

        public KmlAltitudeMode getAltitudeMode()
        Gets the KML altitude mode.
        Returns:
        the altitude mode of the KML geometry
        Since:
        100.4.0
        See Also:
        KmlAltitudeMode
      • getGeometry

        public Geometry getGeometry()
        Gets the geometry contained within the KML geometry.
        Returns:
        the geometry in the KML geometry
        Since:
        100.4.0
      • isExtruded

        public boolean isExtruded()
        Gets a value indicating that the KML geometry is extruded.
        Returns:
        true if the KML geometry is extruded, false otherwise
        Since:
        100.4.0
      • isTessellated

        public boolean isTessellated()
        Gets a value indicating that the KML geometry is tessellated. Tessellated geometry can follow the terrain.

        In order for tessellated geometry to follow the terrain, getAltitudeMode() must be set to KmlAltitudeMode.CLAMP_TO_GROUND.

        Returns:
        true if the KML geometry is tessellated, false otherwise
        Since:
        100.4.0
      • getType

        public KmlGeometry.Type getType()
        Gets the KML geometry type.
        Returns:
        the type of the KML geometry
        Since:
        100.4.0