Class KMLUtils

java.lang.Object
org.deltava.util.XMLUtils
org.deltava.util.KMLUtils

public class KMLUtils extends XMLUtils
A utility class for performing Google Earth KML operations.
Since:
1.0
Version:
4.2
Author:
Luke
  • Method Details

    • createKMLRoot

      public static Document createKMLRoot()
      Creates a KML root element with the proper namespace and schema definitions.
      Returns:
      a KML kml element
    • copyNamespace

      public static void copyNamespace(Document doc)
      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

      public static void setVisibility(Element e, boolean isVisible)
      Sets the visibility for a particular XML element.
      Parameters:
      e - the KML element
      isVisible - TRUE if the element is visible, otherwise FALSE
    • createIcon

      public static Element createIcon(int palette, int iconCode)
      Generates a KML icon element.
      Parameters:
      palette - the Google Earth pallete
      iconCode - the icon code
      Returns:
      a KML Icon element
    • createLookAt

      public static Element createLookAt(GeospaceLocation loc, int altitude, int heading, int tilt)
      Generates a KML LookAt element, relative to an existing element.
      Parameters:
      loc - the location coordinates of the element
      altitude - the altitude of the viewpoint
      heading - the direction of the eyepoint
      tilt - the view tilt angle
      Returns:
      a KML LookAt element