Convert to SHP
Use the Aspose.GIS for .NET library to convert to SHP file format from other popular vector-based gis files.
Live Example
Aspose.GIS for .NET / C# presents you online free the “Convert to SHP” application, where you may to investigate the functionality and quality it works.
Code sample - Convert to SHP
The following code snippet shows you how to convert to SHP. If you specify a spatial reference system for the destination SHP layer, all geometries will be converted to it.
// For complete examples and data files, please go to https://github.com/aspose-gis/Aspose.GIS-for-.NET | |
// Specify conversion settings if necessary. It is optional. | |
ConversionOptions options = null; | |
// This options assigns Wgs84 to the destination layer. | |
// Conversion may throw error If destination layer does not support the Wgs84 spatial reference. So need to check. | |
if (Drivers.Shapefile.SupportsSpatialReferenceSystem(SpatialReferenceSystem.Wgs84)) | |
{ | |
options = new ConversionOptions() | |
{ | |
DestinationSpatialReferenceSystem = SpatialReferenceSystem.Wgs84, | |
}; | |
} | |
// Convert file format to SHP. | |
VectorLayer.Convert("source.kml", Drivers.Kml, "destination.shp", Drivers.Shapefile, options); |
This sample show general possibilities. Aspose.GIS for .NET has wide options to convert files. Each vector-based format has its own read/write options which is inherited from the DriverOptions class.
Platform - .NET / C#
We supports Framework 4.7 or later under Windows, and .NET Core 2.0 or later under Windows or Linux