public class KMLExportUtil
extends java.lang.Object
Constructor and Description |
---|
KMLExportUtil() |
Modifier and Type | Method and Description |
---|---|
static void |
exportAttributesAsKML(javax.xml.stream.XMLStreamWriter xmlWriter,
java.lang.String styleType,
ShapeAttributes attributes)
Export ShapeAttributes as KML Pair element in a StyleMap.
|
static void |
exportBoundaryAsLinearRing(javax.xml.stream.XMLStreamWriter xmlWriter,
java.lang.Iterable<? extends LatLon> boundary,
java.lang.Double altitude)
Export the boundary of a polygon as a KML LinearRing.
|
static void |
exportDimension(javax.xml.stream.XMLStreamWriter xmlWriter,
Size dimension,
java.lang.String tagName)
Export a
Size as a KML element. |
static void |
exportOffset(javax.xml.stream.XMLStreamWriter xmlWriter,
Offset offset,
java.lang.String tagName)
Export an
Offset as a KML element. |
static java.lang.String |
kmlAltitudeMode(int altitudeMode)
Convert a WorldWind altitude mode to a KML altitude mode.
|
static java.lang.String |
kmlBoolean(boolean value)
Convert a boolean to binary string "1" or "0".
|
static java.lang.String |
stripHexPrefix(java.lang.String hexString)
Strip the "0X" prefix from a hex string.
|
public static void exportAttributesAsKML(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String styleType, ShapeAttributes attributes) throws javax.xml.stream.XMLStreamException, java.io.IOException
xmlWriter
- Writer to receive the Style element.styleType
- The type of style: normal or highlight. Value should match either KMLConstants.NORMAL
or KMLConstants.HIGHLIGHT
attributes
- Attributes to export. The method takes no action if this parameter is null.javax.xml.stream.XMLStreamException
- if exception occurs writing XML.java.io.IOException
- if exception occurs exporting data.public static void exportBoundaryAsLinearRing(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.Iterable<? extends LatLon> boundary, java.lang.Double altitude) throws javax.xml.stream.XMLStreamException
xmlWriter
- Writer to receive generated XML.boundary
- Boundary to export.altitude
- Altitude of the points in the ring.javax.xml.stream.XMLStreamException
- if exception occurs writing XML.public static void exportDimension(javax.xml.stream.XMLStreamWriter xmlWriter, Size dimension, java.lang.String tagName) throws javax.xml.stream.XMLStreamException
Size
as a KML element.xmlWriter
- Writer to receive the Style element.dimension
- The dimension to export. If dimension
is null, nothing is written to the stream.tagName
- The name of the KML tag to create.javax.xml.stream.XMLStreamException
- if exception occurs writing XML.public static void exportOffset(javax.xml.stream.XMLStreamWriter xmlWriter, Offset offset, java.lang.String tagName) throws javax.xml.stream.XMLStreamException
Offset
as a KML element.xmlWriter
- Writer to receive the Style element.offset
- The offset to export. If offset
is null, nothing is written to the stream.tagName
- The name of the KML tag to create.javax.xml.stream.XMLStreamException
- if exception occurs writing XML.public static java.lang.String kmlAltitudeMode(int altitudeMode)
altitudeMode
- Altitude mode to convert.altitudeMode
.java.lang.IllegalArgumentException
- If altitudeMode
is not a valid WorldWind altitude mode.public static java.lang.String kmlBoolean(boolean value)
value
- Value to convert.value
is true, otherwise "0".public static java.lang.String stripHexPrefix(java.lang.String hexString)
hexString
- String to manipulate.hexString
after the 0X. For example: "0X00FF00" => "00FF00". If the string does
not begin with 0X, hexString
is returned. The comparison is not case sensitive.