[GIS] How to write GML and GeoJSON features while retaining attributes in .NET

convertfields-attributesgeojsongmlnet

I am developing a .NET project [C#] that needs to export/write features as GML and GeoJSON, including, of course, the attributes; data could queried by a database or manually entered.

I checked NetTopologySuite and GeoApi, I have also tried DotSpatial and SharpMap, but none seems to be able to include attribute fields and values in the output.

Am I wrong? Is there anybody who can help me or suggest the right place to start from?

Best Answer

OGR (part of the GDAL library) ships with several language wrappers, where C# is one of them.

There is some documentation here. Here is a list of supported formats.

Also, se the API tutorial. The examples shows C++ and Python, but you should be able to get an idea how it works.

Not sure if the docs on .NET version is up to date though..