Created
June 27, 2024 11:38
-
-
Save conholdate-gists/83b388aaf894f47fc677f8643bd738ed to your computer and use it in GitHub Desktop.
Convert KML to SHP Shape File in C# .NET
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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