GIS Converter -Model Code

Dani_S 4,946 Reputation points
2025-12-17T14:53:45.9+00:00

Hi Michel,

1.Can you please passed on these files and see if there are problems with them?

If yes can you please provide the fixes.

2.In this FromOption function in FileExtensionHelpers.cs.txt

I do not handle .json since of ambiguity

with these formats:

{ “.json”, “GeoJson” }, { “.json”, “EsriJson” }, { “.json”, “GeoJsonSeq” }, { “.json”, “TopoJson” },

How is cab be solved ?

    public static FileExtension? FromOption(string option)

    {

        if (string.IsNullOrWhiteSpace(option)) return null;

        switch (option.Trim().ToLowerInvariant())

        {

            case "csv": return FileExtension.Csv;

            case "esrijson": return FileExtension.EsriJson;

            case "gdb":

            case "gdbtable":

            case "gdbtablx":

                return FileExtension.FileGdb;

            case "geojson": return FileExtension.GeoJson;

            case "jsonl":

            case "ndjson":

                return FileExtension.GeoJsonSeq;

            case "gpkg": return FileExtension.GeoPackage;

            case "gml": return FileExtension.Gml;

            case "gpx": return FileExtension.Gpx;

            case "kml": return FileExtension.Kml;

            case "kmz": return FileExtension.Kmz;

            case "mif":

            case "mid": return FileExtension.MapInfoInterchange;

            case "tab":

            case "dat":

            case "map":

            case "id":

                return FileExtension.MapInfoTab;

            case "osm": return FileExtension.Osm;

            case "shp":

            case "shx":

            case "dbf":

                return FileExtension.Shapefile;

            case "topojson": return FileExtension.TopoJson;

             

            default: return null;

        }

    }

2.The files:

Model Code

README.md.txt

Model

README.md.txt

ConversionResult.cs.txt

FileExtension.cs.txt

FileExtensionHelpers.cs.txt

Thanks in advance,

Developer technologies | C#
Developer technologies | C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
0 comments No comments
{count} votes

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.