Kmz Class
Reads and writes KMZ: a KML document, Kml, in a zip archive, with the files it references.
public static class KmzRemarks
The reader reads the doc.kml entry, or else the first .kml entry at the root of the archive, or else the first .kml entry of the archive, and ignores the other files, such as the icons and the images of the overlays. The writer writes the KML document in a doc.kml entry.
Methods
| Name | Description |
|---|---|
| Read(Stream) | Reads the placemarks of a KMZ archive. |
| Write(GeoFeatureCollection, Stream, KmlWriterOptions?) | Writes features as a KMZ archive, with a doc.kml entry. |
Read(Stream)
Kmz.csReads the placemarks of a KMZ archive.
public static GeoFeatureCollection Read(Stream stream)Parameters
streamStream- The KMZ archive. It is left open. When it cannot seek, it is copied in memory.
Returns
GeoFeatureCollection The placemarks of the KML document of the archive.
Exceptions
FormatException- The stream is not a zip archive, the archive has no KML document, or the document is not well-formed XML or not KML.
Write(GeoFeatureCollection, Stream, KmlWriterOptions?)
Kmz.csWrites features as a KMZ archive, with a doc.kml entry.
public static void Write(GeoFeatureCollection features, Stream stream, KmlWriterOptions? options = null)Parameters
featuresGeoFeatureCollection- The features.
streamStream- The stream to write to. It is left open.
optionsKmlWriterOptions?- The options of the KML document, or
nullfor the defaults.
Exceptions
ArgumentException- A position is not finite, or a text contains a character that XML cannot represent.