Class KMLUtils
java.lang.Object
org.deltava.util.XMLUtils
org.deltava.util.KMLUtils
A utility class for performing Google Earth KML operations.
- Since:
- 1.0
- Version:
- 4.2
- Author:
- Luke
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
copyNamespace
(Document doc) Updates the namespace of all elements in a KML document to match the parent namespace.static Element
createIcon
(int palette, int iconCode) Generates a KML icon element.static Document
Creates a KML root element with the proper namespace and schema definitions.static Element
createLookAt
(GeospaceLocation loc, int altitude, int heading, int tilt) Generates a KML LookAt element, relative to an existing element.static void
setVisibility
(Element e, boolean isVisible) Sets the visibility for a particular XML element.Methods inherited from class org.deltava.util.XMLUtils
addIfPresent, createElement, createElement, createElement, createIfPresent, format, getChildText, hasElement, setChildText, stripInvalidUnicode
-
Method Details
-
createKMLRoot
Creates a KML root element with the proper namespace and schema definitions.- Returns:
- a KML kml element
-
copyNamespace
Updates the namespace of all elements in a KML document to match the parent namespace. This is a bit of a hack since we should probably set the namespace correctly when we create the document.- Parameters:
doc
- the KML document
-
setVisibility
Sets the visibility for a particular XML element.- Parameters:
e
- the KML elementisVisible
- TRUE if the element is visible, otherwise FALSE
-
createIcon
Generates a KML icon element.- Parameters:
palette
- the Google Earth palleteiconCode
- the icon code- Returns:
- a KML Icon element
-
createLookAt
Generates a KML LookAt element, relative to an existing element.- Parameters:
loc
- the location coordinates of the elementaltitude
- the altitude of the viewpointheading
- the direction of the eyepointtilt
- the view tilt angle- Returns:
- a KML LookAt element
-