de.micromata.opengis.kml.v_2_2_0
Class Polygon

java.lang.Object
  extended by de.micromata.opengis.kml.v_2_2_0.AbstractObject
      extended by de.micromata.opengis.kml.v_2_2_0.Geometry
          extended by de.micromata.opengis.kml.v_2_2_0.Polygon
All Implemented Interfaces:
java.lang.Cloneable

public class Polygon
extends Geometry
implements java.lang.Cloneable

A Polygon is defined by an outer boundary and 0 or more inner boundaries. The boundaries, in turn, are defined by LinearRings. When a Polygon is extruded, its boundaries are connected to the ground to form additional polygons, which gives the appearance of a building or a box. Extruded Polygons use for their color, color mode, and fill.

Note: In Google Earth, a Polygon with an of clampToGround follows the great circle; however, a LinearRing (by itself) with an of clampToGround follows lines of constant latitude.

The for polygons must be specified in counterclockwise order. Polygons follow the "right-hand rule," which states that if you place the fingers of your right hand in the direction in which the coordinates are specified, your thumb points in the general direction of the geometric normal for the polygon. (In 3D graphics, the geometric normal is used for lighting and points away from the front face of the polygon.) Since Google Earth fills only the front face of polygons, you will achieve the desired effect only when the coordinates are specified in the proper order. Otherwise, the polygon will be gray.

Syntax:
<Polygon id="ID">
   <!-- specific to Polygon -->
   <extrude>0</extrude>                       <!-- boolean -->
   <tessellate>0</tessellate>                 <!-- boolean -->
   <altitudeMode>clampToGround</altitudeMode> 
         <!-- kml:altitudeModeEnum: clampToGround, relativeToGround, or absolute -->
         <!-- or, substitute gx:altitudeMode: clampToSeaFloor, relativeToSeaFloor -->
   <outerBoundaryIs>
     <LinearRing>
       <coordinates>...</coordinates>         <!-- lon,lat[,alt] -->
     </LinearRing>
   </outerBoundaryIs>
   <innerBoundaryIs>
     <LinearRing>
       <coordinates>...</coordinates>         <!-- lon,lat[,alt] -->
     </LinearRing>
   </innerBoundaryIs>
 </Polygon>
Extends:


Field Summary
protected  AltitudeMode altitudeMode
          AltitudeMode
protected  java.lang.Boolean extrude
          
protected  java.util.List<Boundary> innerBoundaryIs
          
protected  Boundary outerBoundaryIs
           (required)
protected  java.util.List<AbstractObject> polygonObjectExtension
          
protected  java.util.List<java.lang.Object> polygonSimpleExtension
           
protected  java.lang.Boolean tessellate
          
 
Fields inherited from class de.micromata.opengis.kml.v_2_2_0.Geometry
geometryObjectExtension, geometrySimpleExtension
 
Fields inherited from class de.micromata.opengis.kml.v_2_2_0.AbstractObject
id, objectSimpleExtension, targetId
 
Constructor Summary
Polygon()
           
 
Method Summary
 Polygon addToGeometryObjectExtension(AbstractObject geometryObjectExtension)
          add a value to the geometryObjectExtension property collection
 Polygon addToGeometrySimpleExtension(java.lang.Object geometrySimpleExtension)
          add a value to the geometrySimpleExtension property collection
 Polygon addToInnerBoundaryIs(Boundary innerBoundaryIs)
          add a value to the innerBoundaryIs property collection
 Polygon addToObjectSimpleExtension(java.lang.Object objectSimpleExtension)
          add a value to the objectSimpleExtension property collection
 Polygon addToPolygonObjectExtension(AbstractObject polygonObjectExtension)
          add a value to the polygonObjectExtension property collection
 Polygon addToPolygonSimpleExtension(java.lang.Object polygonSimpleExtension)
          add a value to the polygonSimpleExtension property collection
 Polygon clone()
           
 Boundary createAndAddInnerBoundaryIs()
          Creates a new instance of Boundary and adds it to innerBoundaryIs.
 Boundary createAndSetOuterBoundaryIs()
          Creates a new instance of Boundary and set it to outerBoundaryIs.
 boolean equals(java.lang.Object obj)
           
 AltitudeMode getAltitudeMode()
           
 java.util.List<Boundary> getInnerBoundaryIs()
           
 Boundary getOuterBoundaryIs()
           
 java.util.List<AbstractObject> getPolygonObjectExtension()
           
 java.util.List<java.lang.Object> getPolygonSimpleExtension()
           
 int hashCode()
           
 java.lang.Boolean isExtrude()
           
 java.lang.Boolean isTessellate()
           
 void setAltitudeMode(AltitudeMode value)
           
 void setExtrude(java.lang.Boolean value)
           
 void setGeometryObjectExtension(java.util.List<AbstractObject> geometryObjectExtension)
           
 void setGeometrySimpleExtension(java.util.List<java.lang.Object> geometrySimpleExtension)
           
 void setInnerBoundaryIs(java.util.List<Boundary> innerBoundaryIs)
           
 void setObjectSimpleExtension(java.util.List<java.lang.Object> objectSimpleExtension)
           
 void setOuterBoundaryIs(Boundary value)
           
 void setPolygonObjectExtension(java.util.List<AbstractObject> polygonObjectExtension)
           
 void setPolygonSimpleExtension(java.util.List<java.lang.Object> polygonSimpleExtension)
           
 void setTessellate(java.lang.Boolean value)
           
 Polygon withAltitudeMode(AltitudeMode altitudeMode)
          fluent setter
 Polygon withExtrude(java.lang.Boolean extrude)
          fluent setter
 Polygon withGeometryObjectExtension(java.util.List<AbstractObject> geometryObjectExtension)
          fluent setter
 Polygon withGeometrySimpleExtension(java.util.List<java.lang.Object> geometrySimpleExtension)
          fluent setter
 Polygon withId(java.lang.String id)
          fluent setter
 Polygon withInnerBoundaryIs(java.util.List<Boundary> innerBoundaryIs)
          fluent setter
 Polygon withObjectSimpleExtension(java.util.List<java.lang.Object> objectSimpleExtension)
          fluent setter
 Polygon withOuterBoundaryIs(Boundary outerBoundaryIs)
          fluent setter
 Polygon withPolygonObjectExtension(java.util.List<AbstractObject> polygonObjectExtension)
          fluent setter
 Polygon withPolygonSimpleExtension(java.util.List<java.lang.Object> polygonSimpleExtension)
          fluent setter
 Polygon withTargetId(java.lang.String targetId)
          fluent setter
 Polygon withTessellate(java.lang.Boolean tessellate)
          fluent setter
 
Methods inherited from class de.micromata.opengis.kml.v_2_2_0.Geometry
getGeometryObjectExtension, getGeometrySimpleExtension
 
Methods inherited from class de.micromata.opengis.kml.v_2_2_0.AbstractObject
getId, getObjectSimpleExtension, getTargetId, setId, setTargetId
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

extrude

protected java.lang.Boolean extrude

Boolean value. Specifies whether to connect the LineString to the ground. To extrude a LineString, the altitude mode must be either relativeToGround, relativeToSeaFloor, or absolute. The vertices in the LineString are extruded toward the center of the Earth's sphere.

Boolean value. Specifies whether to connect the LinearRing to the ground. To extrude this geometry, the altitude mode must be either relativeToGround, relativeToSeaFloor, or absolute. Only the vertices of the LinearRing are extruded, not the center of the geometry. The vertices are extruded toward the center of the Earth's sphere.

Boolean value. Specifies whether to connect the Polygon to the ground. To extrude a Polygon, the altitude mode must be either relativeToGround, relativeToSeaFloor, or absolute. Only the vertices are extruded, not the geometry itself (for example, a rectangle turns into a box with five faces. The vertices of the Polygon are extruded toward the center of the Earth's sphere.

Boolean value. Specifies whether to connect the point to the ground with a line. To extrude a Point, the value for must be either relativeToGround, relativeToSeaFloor, or absolute. The point is extruded toward the center of the Earth's sphere.


tessellate

protected java.lang.Boolean tessellate

Boolean value. Specifies whether to allow the LineString to follow the terrain. To enable tessellation, the altitude mode must be clampToGround or clampToSeaFloor. Very large LineStrings should enable tessellation so that they follow the curvature of the earth (otherwise, they may go underground and be hidden).

Boolean value. Specifies whether to allow the LinearRing to follow the terrain. To enable tessellation, the value for must be clampToGround or clampToSeaFloor. Very large LinearRings should enable tessellation so that they follow the curvature of the earth (otherwise, they may go underground and be hidden).

Boolean value. Specifies whether to allow the Polygon to follow the terrain. To enable tessellation, the Polygon must have an altitude mode of clampToGround or clampToSeaFloor. Very large Polygons should enable tessellation so that they follow the curvature of the earth (otherwise, they may go underground and be hidden).


altitudeMode

protected AltitudeMode altitudeMode
AltitudeMode

clampToGround, relativeToGround, absolute

See Also: See and


outerBoundaryIs

protected Boundary outerBoundaryIs
(required)

Contains a element.


innerBoundaryIs

protected java.util.List<Boundary> innerBoundaryIs

Contains a element. A Polygon can contain multiple elements, which create multiple cut-outs inside the Polygon.


polygonSimpleExtension

protected java.util.List<java.lang.Object> polygonSimpleExtension

polygonObjectExtension

protected java.util.List<AbstractObject> polygonObjectExtension

This is an abstract base class and cannot be used directly in a KML file. It provides the id attribute, which allows unique identification of a KML element, and the targetId attribute, which is used to reference objects that have already been loaded into Google Earth. The id attribute must be assigned if the mechanism is to be used.

Syntax:
<!-- abstract element; do not create -->
 <!-- Object id="ID" targetId="NCName" -->
 <!-- /Object> -->

Constructor Detail

Polygon

public Polygon()
Method Detail

isExtrude

public java.lang.Boolean isExtrude()
Returns:
possible object is Boolean

setExtrude

public void setExtrude(java.lang.Boolean value)
Parameters:
value - allowed object is Boolean
See Also:
extrude

isTessellate

public java.lang.Boolean isTessellate()
Returns:
possible object is Boolean

setTessellate

public void setTessellate(java.lang.Boolean value)
Parameters:
value - allowed object is Boolean
See Also:
tessellate

getAltitudeMode

public AltitudeMode getAltitudeMode()
Returns:
possible object is <Object <AltitudeMode <de.micromata.opengis.kml.v_2_2_0.gx.AltitudeMode
See Also:
altitudeMode

setAltitudeMode

public void setAltitudeMode(AltitudeMode value)
Parameters:
value - allowed object is <Object <AltitudeMode <de.micromata.opengis.kml.v_2_2_0.gx.AltitudeMode
See Also:
altitudeMode

getOuterBoundaryIs

public Boundary getOuterBoundaryIs()
Returns:
possible object is Boundary
See Also:
outerBoundaryIs

setOuterBoundaryIs

public void setOuterBoundaryIs(Boundary value)
Parameters:
value - allowed object is Boundary
See Also:
outerBoundaryIs

getInnerBoundaryIs

public java.util.List<Boundary> getInnerBoundaryIs()
See Also:
innerBoundaryIs

getPolygonSimpleExtension

public java.util.List<java.lang.Object> getPolygonSimpleExtension()
See Also:
polygonSimpleExtension

getPolygonObjectExtension

public java.util.List<AbstractObject> getPolygonObjectExtension()
See Also:
polygonObjectExtension

hashCode

public int hashCode()
Overrides:
hashCode in class Geometry

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class Geometry

createAndSetOuterBoundaryIs

public Boundary createAndSetOuterBoundaryIs()
Creates a new instance of Boundary and set it to outerBoundaryIs. This method is a short version for: Boundary boundary = new Boundary(); this.setOuterBoundaryIs(boundary);


createAndAddInnerBoundaryIs

public Boundary createAndAddInnerBoundaryIs()
Creates a new instance of Boundary and adds it to innerBoundaryIs. This method is a short version for: Boundary boundary = new Boundary(); this.getInnerBoundaryIs().add(boundary);


setInnerBoundaryIs

public void setInnerBoundaryIs(java.util.List<Boundary> innerBoundaryIs)
Parameters:
innerBoundaryIs -
See Also:
innerBoundaryIs

addToInnerBoundaryIs

public Polygon addToInnerBoundaryIs(Boundary innerBoundaryIs)
add a value to the innerBoundaryIs property collection

Parameters:
innerBoundaryIs - Objects of the following type are allowed in the list: Boundary
Returns:
true (as general contract of Collection.add).

setPolygonSimpleExtension

public void setPolygonSimpleExtension(java.util.List<java.lang.Object> polygonSimpleExtension)
Parameters:
polygonSimpleExtension -
See Also:
polygonSimpleExtension

addToPolygonSimpleExtension

public Polygon addToPolygonSimpleExtension(java.lang.Object polygonSimpleExtension)
add a value to the polygonSimpleExtension property collection

Parameters:
polygonSimpleExtension - Objects of the following type are allowed in the list: Object
Returns:
true (as general contract of Collection.add).

setPolygonObjectExtension

public void setPolygonObjectExtension(java.util.List<AbstractObject> polygonObjectExtension)
Parameters:
polygonObjectExtension -
See Also:
polygonObjectExtension

addToPolygonObjectExtension

public Polygon addToPolygonObjectExtension(AbstractObject polygonObjectExtension)
add a value to the polygonObjectExtension property collection

Parameters:
polygonObjectExtension - Objects of the following type are allowed in the list: AbstractObject
Returns:
true (as general contract of Collection.add).

setObjectSimpleExtension

public void setObjectSimpleExtension(java.util.List<java.lang.Object> objectSimpleExtension)
Overrides:
setObjectSimpleExtension in class Geometry
See Also:
objectSimpleExtension

addToObjectSimpleExtension

public Polygon addToObjectSimpleExtension(java.lang.Object objectSimpleExtension)
Description copied from class: AbstractObject
add a value to the objectSimpleExtension property collection

Overrides:
addToObjectSimpleExtension in class Geometry
Parameters:
objectSimpleExtension - Objects of the following type are allowed in the list: Object
Returns:
true (as general contract of Collection.add).

setGeometrySimpleExtension

public void setGeometrySimpleExtension(java.util.List<java.lang.Object> geometrySimpleExtension)
Overrides:
setGeometrySimpleExtension in class Geometry
See Also:
geometrySimpleExtension

addToGeometrySimpleExtension

public Polygon addToGeometrySimpleExtension(java.lang.Object geometrySimpleExtension)
Description copied from class: Geometry
add a value to the geometrySimpleExtension property collection

Overrides:
addToGeometrySimpleExtension in class Geometry
Parameters:
geometrySimpleExtension - Objects of the following type are allowed in the list: Object
Returns:
true (as general contract of Collection.add).

setGeometryObjectExtension

public void setGeometryObjectExtension(java.util.List<AbstractObject> geometryObjectExtension)
Overrides:
setGeometryObjectExtension in class Geometry
See Also:
geometryObjectExtension

addToGeometryObjectExtension

public Polygon addToGeometryObjectExtension(AbstractObject geometryObjectExtension)
Description copied from class: Geometry
add a value to the geometryObjectExtension property collection

Overrides:
addToGeometryObjectExtension in class Geometry
Parameters:
geometryObjectExtension - Objects of the following type are allowed in the list: AbstractObject
Returns:
true (as general contract of Collection.add).

withExtrude

public Polygon withExtrude(java.lang.Boolean extrude)
fluent setter

Parameters:
extrude - required parameter
See Also:
setExtrude(Boolean)

withTessellate

public Polygon withTessellate(java.lang.Boolean tessellate)
fluent setter

Parameters:
tessellate - required parameter
See Also:
setTessellate(Boolean)

withAltitudeMode

public Polygon withAltitudeMode(AltitudeMode altitudeMode)
fluent setter

Parameters:
altitudeMode - required parameter
See Also:
#setAltitudeMode(Object)

withOuterBoundaryIs

public Polygon withOuterBoundaryIs(Boundary outerBoundaryIs)
fluent setter

Parameters:
outerBoundaryIs - required parameter
See Also:
setOuterBoundaryIs(Boundary)

withInnerBoundaryIs

public Polygon withInnerBoundaryIs(java.util.List<Boundary> innerBoundaryIs)
fluent setter

Parameters:
innerBoundaryIs - required parameter
See Also:
#setInnerBoundaryIs(List)

withPolygonSimpleExtension

public Polygon withPolygonSimpleExtension(java.util.List<java.lang.Object> polygonSimpleExtension)
fluent setter

Parameters:
polygonSimpleExtension - required parameter
See Also:
#setPolygonSimpleExtension(List)

withPolygonObjectExtension

public Polygon withPolygonObjectExtension(java.util.List<AbstractObject> polygonObjectExtension)
fluent setter

Parameters:
polygonObjectExtension - required parameter
See Also:
#setPolygonObjectExtension(List)

withObjectSimpleExtension

public Polygon withObjectSimpleExtension(java.util.List<java.lang.Object> objectSimpleExtension)
Description copied from class: AbstractObject
fluent setter

Overrides:
withObjectSimpleExtension in class Geometry
Parameters:
objectSimpleExtension - required parameter
See Also:
#setObjectSimpleExtension(List)

withId

public Polygon withId(java.lang.String id)
Description copied from class: AbstractObject
fluent setter

Overrides:
withId in class Geometry
Parameters:
id - required parameter
See Also:
AbstractObject.setId(String)

withTargetId

public Polygon withTargetId(java.lang.String targetId)
Description copied from class: AbstractObject
fluent setter

Overrides:
withTargetId in class Geometry
Parameters:
targetId - required parameter
See Also:
AbstractObject.setTargetId(String)

withGeometrySimpleExtension

public Polygon withGeometrySimpleExtension(java.util.List<java.lang.Object> geometrySimpleExtension)
Description copied from class: Geometry
fluent setter

Overrides:
withGeometrySimpleExtension in class Geometry
Parameters:
geometrySimpleExtension - required parameter
See Also:
#setGeometrySimpleExtension(List)

withGeometryObjectExtension

public Polygon withGeometryObjectExtension(java.util.List<AbstractObject> geometryObjectExtension)
Description copied from class: Geometry
fluent setter

Overrides:
withGeometryObjectExtension in class Geometry
Parameters:
geometryObjectExtension - required parameter
See Also:
#setGeometryObjectExtension(List)

clone

public Polygon clone()
Overrides:
clone in class Geometry