Convert KML to GeoJSON in C#
Export KML to GeoJSON using server side APIs, without needing softwares like ArcGIS, ArcMap, QGIS or Google Earth.
How to Convert KML to GeoJSON Using C#
In order to convert KML to GeoJSON, we’ll use
API which is a feature-rich, powerful and easy to use GIS API for C# platform. Open
package manager, search for Aspose.GIS and install. You may also use the following command from the Package Manager Console.
Command
PM> Install-Package Aspose.GIS
Steps for converting KML to GeoJSON in C#
Conversion can be done with just one line of code while using VectorLayer.Convert method. It takes 4 parameters as detailed below.
- A string type file path to the source KML file
- Source driver to let the API know about the input format. Set it to Drivers.Kml
- The string type file path to the destination GeoJSON data file
- Destination driver to specify output format. Set it to Drivers.GeoJson
System Requirements
Our APIs are supported on all major platforms and Operating Systems. Before executing the code below, please make sure that you have the following prerequisites on your system.
Save KML as GeoJSON - C#
KML to GeoJSON Live Demos
Convert KML to GeoJSON right now by visiting our Live Demos website . The live demo has the following benefits
.NET GIS Library
Aspose.GIS for .NET is a GIS data manipulation and conversion API. It fully supports reading, writing and converting famous GIS data formats such as ESRI Shapefiles, GeoJSON, TopoJSON, ESRI Geodatabase, Geography Markup Language, Google Earth, GPS Exchange Format, MapInfo Formats and OpenStreetMap. It is a standalone .NET based API and does not require any GIS based softwares like ArcGIS / ArcMap, QGIS etc.KML What is KML File Format?
KML (Keyhole Markup Language) contains geospatial information in XML notation. KML can be opened in Geographic Information System (GIS) applications provided they support it. Many applications have started providing support for KML format after it has been adopted as international standard.
Read MoreGeoJSON What is GeoJSON File Format?
GeoJSON is a JSON based format designed to represent the geographical features with their non-spatial attributes. This format defines different JSON (JavaScript Object Notation) objects and their joining fashion. JSON represents a collective information about the Geographical features, their spatial extents, and properties.
Read MoreOther Supported Conversions
You can also convert KML into many other file formats including few listed below.