/// Read file in KMZ and KML format private void ReadGISFile() { string pathToimage = null; using (FileStream reader = new FileStream(path, FileMode.Open)) using (KmzFile kmzFile = KmzFile.Open(reader)) { KmlFile kmlFile = kmzFile.GetDefaultKmlFile(); var image = kmlFile.Root.Flatten().OfType <GroundOverlay>().FirstOrDefault(); if (image != null) { pathToimage = image.Icon.Href.ToString(); } var latLonBox = kmlFile.Root.Flatten().OfType <LatLonBox>().FirstOrDefault(); if (latLonBox != null) { var coorners = GetMapCorners(latLonBox); map = new Map() { MapCorners = coorners, Rotation = latLonBox.Rotation, Name = kmlFile.Root.Flatten().OfType <Folder>().FirstOrDefault().Name }; } } ReadArchiveAndExport(pathToimage); }