Package gov.nasa.worldwind.ogc.kml
Provides classes for parsing KML and KMZ files and streams.
How to Parse a KML or KMZ File or Stream
-
Create a
KMLRoot
via one of its constructors, such asKMLRoot(java.io.File)
, passing the KML or KMZ source to the constructor. AKMLRoot
provides access to the KML contents. The source can be either a file, an input stream or a URL. -
Call
KMLRoot.parse(Object[])
to parse the document. -
The
KMLRoot
class provides accessor methods for thekml
element of the KML file, its root. The content includes the element's single attribute, hint, and the NetworkLinkControl and Feature elements it may contain. Once the root is parsed, use these methods to obtain objects representing these elements, and use the accessor methods of those objects in turn to obtain their contents. - Each KML element defined in the KML specification has a corresponding class provided in this package. Each of those classes contains methods to obtain the element's contents as defined by the specification. The same is true for the other specifications KML uses: Atom, XAL and the GX extensions defined by Google. Use these classes to obtain the contents of individual elements of the KML file.
Extending the Classes
This package's classes are designed for easy behavior modification and replacement, and for straightforward addition
of operations to be performed during parsing. See the description of AbstractXMLEventParser
for further information.
Relative References
Because the KML specification requires relative references within KML files to be resolved relative to the location
of the file, a context is provided to resolve these references. The context is specific to the document type
file, stream, KML or KMZ and is provided by the KMLDoc
interface and its
implementing classes. It's available from the KMLRoot
. See the description of the
KMLDoc
interface for further information.
-
Interface Summary Interface Description KMLConstants Defines constants used by the KML parser classes.KMLUpdateOperation -
Class Summary Class Description KMLAbstractColorStyle Represents the KML ColorStyle element and provides access to its contents.KMLAbstractContainer Represents the KML Container element and provides access to its contents.KMLAbstractEventParser ImplementsAbstractXMLEventParser
for KML elements.KMLAbstractFeature Represents the KML Feature element and provides access to its contents.KMLAbstractGeometry Represents the KML Geometry element.KMLAbstractLatLonBoxType Represents the KML LatLonBox element and provides access to its contents.KMLAbstractObject The abstract base class for most KML classes.KMLAbstractOverlay Represents the KML Overlay element and provides access to its contents.KMLAbstractStyleSelector Represents the KML StyleSelector element.KMLAbstractSubStyle Represents the KML SubStyle element.KMLAbstractTimePrimitive Represents the KML TimePrimitive element.KMLAbstractView Represents the KML AbstractView element.KMLAlias Represents the KML Alias element and provides access to its contents.KMLBalloonStyle Represents the KML BalloonStyle element and provides access to its contents.KMLBoundary Represents the KML Boundary style and provides access to its contents.KMLCamera Represents the KML Camera element and provides access to its contents.KMLChange Represents the KML Change element and provides access to its contents.KMLCoordinatesParser Parses KML coordinates elements.KMLCoordinateTokenizer Tokenizer to read coordinate values from KML coordinate string.KMLCreate Represents the KML Create element and provides access to its contents.KMLData Represents the KML Data element and provides access to its contents.KMLDelete Represents the KML Delete element and provides access to its contents.KMLDocument Represents the KML Document element and provides access to its contents.KMLExtendedData Represents the KML ExtendedData element and provides access to its contents.KMLFolder Represents the KML Folder element and provides access to its contents.KMLGroundOverlay Represents the KML GroundOverlay element and provides access to its contents.KMLIcon Represents the KML Icon element and provides access to its contents.KMLIconStyle Represents the KML IconStyle element and provides access to its contents.KMLImagePyramid Represents the KML ImagePyramid element and provides access to its contents.KMLItemIcon Represents the KML ItemIcon element and provides access to its contents.KMLLabelStyle Represents the KML LabelStyle element and provides access to its contents.KMLLatLonAltBox Represents the KML LatLonAltBox element and provides access to its contents.KMLLatLonBox Represents the KML LatLonBox element and provides access to its contents.KMLLinearRing Represents the KML LinearRing element and provides access to its contents.KMLLineString Represents the KML LineString element and provides access to its contents.KMLLineStyle Represents the KML LineStyle element and provides access to its contents.KMLLink Represents the KML Link element and provides access to its contents.KMLListStyle Represents the KML ListStyle element and provides access to its contents.KMLLocation Represents the KML Location element and provides access to its contents.KMLLod Represents the KML Lod element and provides access to its contents.KMLLookAt Represents the KML LookAt element and provides access to its contents.KMLModel Represents the KML Model element and provides access to its contents.KMLMultiGeometry Represents the KML MultiGeometry element and provides access to its contents.KMLNetworkLink Represents the KML NetworkLink element and provides access to its contents.KMLNetworkLink.RequestTask Attempts to find this network link resource file locally, and if that fails attempts to find it remotely.KMLNetworkLinkControl Represents the KML NetworkLinkControl element and provides access to its contents.KMLOrientation Represents the KML Orientation element and provides access to its contents.KMLPair Represents the KML Pair element and provides access to its contents.KMLParserContext The parser context for KML and KMZ docuements.KMLPhotoOverlay Represents the KML PhotoOverlay element and provides access to its contents.KMLPlacemark Represents the KML Placemark element and provides access to its contents.KMLPoint Represents the KML Point element and provides access to its contents.KMLPolygon Represents the KML Polygon element and provides access to its contents.KMLPolyStyle Represents the KML PolyStyle element and provides access to its contents.KMLRegion Represents the KML Region element and provides access to its contents.KMLRegion.RegionData RegionData
holds a Region's computed data used during a single call toRegion.isActive
, and is unique to a particularGlobe
.KMLResourceMap Represents the KML ResourceMap element and provides access to its contents.KMLRoot Parses a KML or KMZ document and provides access to its contents.KMLScale Represents the KML Scale element and provides access to its contents.KMLSchema Represents the KML Schema element and provides access to its contents.KMLSchemaData Represents the KML SchemaData element and provides access to its contents.KMLScreenOverlay Represents the KML ScreenOverlay element and provides access to its contents.KMLSimpleData Represents the KML SimpleData element and provides access to its contents.KMLSimpleField Represents the KML SimpleField element and provides access to its contents.KMLSnippet Represents the KML Snippet element and provides access to its contents.KMLStyle Represents the KML Style element and provides access to its contents.KMLStyleMap Represents the KML StyleMap element and provides access to its contents.KMLStyleUrl KMLTimeSpan Represents the KML TimeSpan element and provides access to its contents.KMLTimeStamp Represents the KML TimeStamp element and provides access to its contents.KMLUpdate Represents the KML Update element and provides access to its contents.KMLVec2 Represents the KML Vec2 element and provides access to its contents.KMLViewVolume Represents the KML ViewVolume element and provides access to its contents.