Skip to content

Instantly share code, notes, and snippets.

@conholdate-gists
Created June 27, 2024 11:38
Show Gist options
  • Save conholdate-gists/83b388aaf894f47fc677f8643bd738ed to your computer and use it in GitHub Desktop.
Save conholdate-gists/83b388aaf894f47fc677f8643bd738ed to your computer and use it in GitHub Desktop.
Convert KML to SHP Shape File in C# .NET
// Specify conversion settings.
Aspose.Gis.ConversionOptions options = null;
// This options assigns Wgs84 to the destination layer.
if (Aspose.Gis.Drivers.Shapefile.SupportsSpatialReferenceSystem(Aspose.Gis.SpatialReferencing.SpatialReferenceSystem.Wgs84))
{
options = new Aspose.Gis.ConversionOptions()
{
DestinationSpatialReferenceSystem = Aspose.Gis.SpatialReferencing.SpatialReferenceSystem.Wgs84,
};
}
// Convert file format from KML to SHP
Aspose.Gis.VectorLayer.Convert("second.kml", Aspose.Gis.Drivers.Kml, "destination.shp", Aspose.Gis.Drivers.Shapefile, options);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment