Package org.opengis.cite.kml22.util
Class KMLUtils
java.lang.Object
org.opengis.cite.kml22.util.KMLUtils
Provides various utility methods for reading or manipulating KML and KMZ resources.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic DocumentextractKMLFromArchive(File file) Extracts the contents of the given ZIP archive and parses the first root-level KML document found within it.
-
Constructor Details
-
KMLUtils
public KMLUtils()
-
-
Method Details
-
extractKMLFromArchive
Extracts the contents of the given ZIP archive and parses the first root-level KML document found within it. The main KML document is conventionally named doc.kml but this is not required; the.kmlextension is expected, however.- Parameters:
file- A File object that presumably represents a KMZ file (ZIP archive).- Returns:
- A KML document, or
nullif a root-level KML file could not be found in the archive. - Throws:
IOException- The file was not a valid ZIP archive or some other I/O error occurred.SAXException- If a KML document was found but it is not well-formed.- See Also:
-