Convert Geometry to GeoJSON

3149
2
02-27-2018 04:14 AM
MatthiasPorges
New Contributor

Is it possible to output a Geometry object in the http://geojson.org/ format (as a simple string) somehow? The runtime only seems to support ToJson(), which is a ArcGIS-specific format.

Maybe there is an open source library or a C# code snippet out there that does that?

Tags (2)
0 Kudos
2 Replies
dotMorten_esri
Esri Frequent Contributor

There's no GeoJson support out of the box. I'm not aware of any open-source .NET libraries, but since GeoJSON is rather simple, I doubt it would take you very long to write a simple serializer

0 Kudos
dotMorten_esri
Esri Frequent Contributor

Perhaps this library will give you a headstart? https://github.com/GeoJSON-Net/GeoJSON.Net

There are probably more, but this was the first I found when searching for one.

0 Kudos