Convert to GIS formats with advanced options
Leave feedback
On this page
GroupDocs.Conversion provides the GisConvertOptions class to specify GIS (Geographic Information System) file format conversion settings.
The following GIS (Geographic Information System) formats can be both loaded and saved:
| Format | Extension | Description |
|---|---|---|
| GeoJSON | .geojson | JSON-based format for geographical features |
| KML | .kml | Keyhole Markup Language (Google Earth) |
| GPX | .gpx | GPS Exchange Format |
| TopoJSON | .topojson | GeoJSON extension with topology encoding |
| GML | .gml | Geography Markup Language (XML-based) |
| OSM | .osm | OpenStreetMap XML format |
The following GIS formats can be loaded and converted to any of the formats above:
| Format | Extension | Description |
|---|---|---|
| GeoJSON Text Sequence | .geojsons | Newline-delimited sequence of GeoJSON features |
| KMZ | .kmz | Zipped KML (Google Earth) |
Format - Specifies the desired GIS file format. Available options are: GeoJson, Kml, Gpx, TopoJson, Gml, Osm.
GisConvertOptions supports conversion between GIS formats. The following examples demonstrate common conversions.
Convert a GeoJSON file to KML (Keyhole Markup Language) for Google Earth:
using GroupDocs.Conversion;
using GroupDocs.Conversion.Options.Convert;
using GroupDocs.Conversion.FileTypes;
string sourceFile = "geographic-data.geojson";
string outputFile = "geographic-data.kml";
using (var converter = new Converter(sourceFile))
{
var options = new GisConvertOptions
{
Format = GisFileType.Kml
};
converter.Convert(outputFile, options);
}
Convert a GPX (GPS Exchange Format) file to GeoJSON:
using GroupDocs.Conversion;
using GroupDocs.Conversion.Options.Convert;
using GroupDocs.Conversion.FileTypes;
string sourceFile = "tracking-route.gpx";
string outputFile = "tracking-route.geojson";
using (var converter = new Converter(sourceFile))
{
var options = new GisConvertOptions
{
Format = GisFileType.GeoJson
};
converter.Convert(outputFile, options);
}
Convert a GeoJSON file to TopoJSON format for topology-preserving conversions:
using GroupDocs.Conversion;
using GroupDocs.Conversion.Options.Convert;
using GroupDocs.Conversion.FileTypes;
string sourceFile = "map-boundaries.geojson";
string outputFile = "map-boundaries.topojson";
using (var converter = new Converter(sourceFile))
{
var options = new GisConvertOptions
{
Format = GisFileType.TopoJson
};
converter.Convert(outputFile, options);
}
Convert a KMZ (zipped KML) file exported from Google Earth to GeoJSON:
using GroupDocs.Conversion;
using GroupDocs.Conversion.Options.Convert;
using GroupDocs.Conversion.FileTypes;
string sourceFile = "placemarks.kmz";
string outputFile = "placemarks.geojson";
using (var converter = new Converter(sourceFile))
{
var options = new GisConvertOptions
{
Format = GisFileType.GeoJson
};
converter.Convert(outputFile, options);
}
Convert a GeoJSON file to GML (Geography Markup Language):
using GroupDocs.Conversion;
using GroupDocs.Conversion.Options.Convert;
using GroupDocs.Conversion.FileTypes;
string sourceFile = "parcels.geojson";
string outputFile = "parcels.gml";
using (var converter = new Converter(sourceFile))
{
var options = new GisConvertOptions
{
Format = GisFileType.Gml
};
converter.Convert(outputFile, options);
}
Every supported GIS source format — GeoJSON, GeoJSON Text Sequence, GML, GPX, KML, KMZ, OSM and TopoJSON — converts to every GIS target format: GeoJSON, GML, GPX, KML, OSM and TopoJSON.
GML and OSM are available as conversion targets starting with version 26.9. GIS conversion is available on .NET Framework 4.6.2 as well as on .NET 6 and later starting with version 26.9.
Note: To convert FROM GIS formats to PDF, images, or other document formats, use PdfConvertOptions, ImageConvertOptions, or other appropriate ConvertOptions classes.
Was this page helpful?
Any additional feedback you'd like to share with us?
Please tell us how we can improve this page.
Thank you for your feedback!
We value your opinion. Your feedback will help us improve our documentation.