GML to GeoJSON Converter
Contents
[
Hide
]
Use the Aspose.GIS for .NET library to convert GML to GeoJSON file format.
Live Example
Aspose.GIS for .NET / C# presents you online free the “GML to GeoJSON Converter” application, where you may to investigate the functionality and quality it works.
Code sample - GML to GeoJSON Converter
The following code snippet shows you how to implement GML to GeoJSON Converter. If you specify a spatial reference system for the destination GeoJSON layer, all geometries will be converted to it.
This file contains hidden or 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
// 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 from GML to GeoJSON. | |
VectorLayer.Convert("source.gml", Drivers.Gml, "destination.geojson", Drivers.GeoJson, 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