Convert to GIS formats with advanced options

GroupDocs.Conversion provides the GisConvertOptions class to specify GIS (Geographic Information System) file format conversion settings.

Supported GIS Formats

The following GIS (Geographic Information System) formats can be both loaded and saved:

FormatExtensionDescription
GeoJSON.geojsonJSON-based format for geographical features
KML.kmlKeyhole Markup Language (Google Earth)
GPX.gpxGPS Exchange Format
TopoJSON.topojsonGeoJSON extension with topology encoding
GML.gmlGeography Markup Language (XML-based)
OSM.osmOpenStreetMap XML format

The following GIS formats can be loaded and converted to any of the formats above:

FormatExtensionDescription
GeoJSON Text Sequence.geojsonsNewline-delimited sequence of GeoJSON features
KMZ.kmzZipped KML (Google Earth)

Properties

Format - Specifies the desired GIS file format. Available options are: GeoJson, Kml, Gpx, TopoJson, Gml, Osm.

Conversion Examples

GisConvertOptions supports conversion between GIS formats. The following examples demonstrate common conversions.

GeoJSON to KML

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);
}

GPX to GeoJSON

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);
}

GeoJSON to TopoJSON

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);
}

KMZ to GeoJSON

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);
}

GeoJSON to GML

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);
}

Format Support Notes

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.

More Resources

Close
Loading

Analyzing your prompt, please hold on...

An error occurred while retrieving the results. Please refresh the page and try again.