Convert KML to SHP in C#

KML is a file format used to display geographic data. Whereas, the SHP file contains geometry data as a set of vector coordinates. In some use cases, you might want to convert a KML file to SHP format. Following such scenarios, this article discusses how to convert a KML file to SHP format programmatically in C#.

  1. KML to SHP Converter - C# API Installation
  2. How to Convert a KML File to SHP Format in C#
  3. Convert KML to SHP Programmatically in C#

KML to SHP Converter - C# API Installation

Aspose.GIS for .NET API can be used to create, edit, or convert different geographical file formats. You can quickly configure it by downloading the DLL files from the New Releases section or running the following NuGet installation command:

PM> Install-Package Aspose.GIS

How to Convert a KML File to SHP Format in C#

The steps below demonstrate how to convert a KML file to an SHP file:

  1. Initialize an instance of the ConversionOptions class.
  2. Assign Wgs84 to the destination layer.
  3. Convert KML to SHP file.

The subsequent heading further explains the details of this conversion.

Convert KML to SHP Programmatically in C#

Please follow the steps below to convert KML to SHP file:

  1. Create a ConversionOptions class object.
  2. Assign Wgs84 to the destination layer.
  3. Convert KML to SHP file with Convert method.

The code sample below shows how to convert KML to SHP programmatically in C#.

Get Free License

You can obtain a free temporary license in order to avoid the evaluation limitations of the API.

Conclusion

In this article, you have learned how to convert a KML file to SHP format programmatically in C#. Moreover, many other features of the API are covered under the documentation section. Please feel free to contact us at forum in case you have any ambiguities or concerns.

See Also