示例#1
0
        static void Kml1Test(string shpPath)
        {
            IFeatureSet fs      = FeatureSet.Open(shpPath);
            var         kmlName = Path.GetFileNameWithoutExtension(shpPath);
            var         kml     = fs.ToKML(kmlName);

            fs.ToKMZ(kmlName, Path.ChangeExtension(shpPath, ".kmz"));

            Console.WriteLine(kml);
            var kmlPath = Path.ChangeExtension(shpPath, ".kml");

            if (File.Exists(kmlPath))
            {
                File.Delete(kmlPath);
            }

            using var sw = new StreamWriter(kmlPath, false);
            sw.WriteLine(kml);
        }