|
1 | | -[](https://github.com/GeoJSON-Net/GeoJSON.Text/actions/workflows/ci-build.yml) [](https://codecov.io/gh/GeoJSON-Net/GeoJSON.Text) |
| 1 | +[](https://github.com/GeoJSON-Net/GeoJSON.Text/actions/workflows/ci-build.yml) [](https://codecov.io/gh/GeoJSON-Net/GeoJSON.Text) |
2 | 2 |
|
| 3 | +# GeoJSON.Text |
| 4 | +GeoJSON.Text is a .NET library for the [RFC 7946 The GeoJSON Format](https://tools.ietf.org/html/rfc7946) and it uses and provides [System.Text.Json](https://docs.microsoft.com/en-us/dotnet/api/system.text.json?view=net-6.0) converters for serialization and deserialization of GeoJSON data. |
3 | 5 |
|
4 | | -# GetJson.Text |
5 | | -.Net library for GeoJSON types & corresponding System.TExt.Json (de)serializers |
| 6 | +## Installation & Usage |
| 7 | + |
| 8 | +[GeoJSON.Text NuGet package](https://www.nuget.org/packages/GeoJSON.Text/): |
| 9 | + |
| 10 | +`Install-Package GeoJSON.Text` |
| 11 | + |
| 12 | +### Serialization |
| 13 | + |
| 14 | +```csharp |
| 15 | +Position position = new Position(51.899523, -2.124156); |
| 16 | +Point point = new Point(position); |
| 17 | + |
| 18 | +string json = JsonSerializer.Serialize(point); |
| 19 | +``` |
| 20 | + |
| 21 | +### Deserialization |
| 22 | + |
| 23 | +```csharp |
| 24 | +string json = "{\"coordinates\":[-2.124156,51.899523],\"type\":\"Point\"}"; |
| 25 | + |
| 26 | +Point point = JsonSerializer.Deserialize<Point>(json); |
| 27 | +``` |
| 28 | + |
| 29 | +See the [Tests](https://github.com/GeoJSON-Net/GeoJSON.Text/tree/master/src/GeoJSON.Text.Test.Unit) for more examples. |
| 30 | + |
| 31 | +## Special considerations for Newtonsoft.Json |
| 32 | + |
| 33 | +GeoJSON.Text is made to support System.Text.Json, and does not support serializing or deserializing GeoJSON models using Newtonsoft.Json. |
| 34 | + |
| 35 | +If using Newtonsoft.Json support is needed, please use [GeoJSON.Net](https://github.com/GeoJSON-Net/GeoJSON.Net). |
| 36 | + |
| 37 | +## Contributing |
| 38 | +Highly welcome! Just fork away and send a pull request. We try and review most pull requests within a couple of days. |
| 39 | + |
| 40 | +## Thanks |
| 41 | +This library would be NOTHING without its [contributors](https://github.com/GeoJSON-Net/GeoJSON.Text/graphs/contributors) - thanks so much!! |
| 42 | + |
| 43 | +## Sponsors |
| 44 | + |
| 45 | + We have the awesome .NET tools from [JetBrains](http://www.jetbrains.com/). |
| 46 | + |
| 47 | +[](http://www.jetbrains.com/resharper/) |
| 48 | + |
| 49 | +## Contributors |
| 50 | + |
| 51 | +This project exists thanks to all the people who contribute. |
| 52 | +<a href="https://github.com/GeoJSON-Net/GeoJSON.Text/graphs/contributors"><img src="https://opencollective.com/geojson-net/contributors.svg?width=890&button=false" /></a> |
| 53 | + |
| 54 | + |
| 55 | +## Backers |
| 56 | + |
| 57 | +Thank you to all our backers! 🙏 [[Become a backer](https://opencollective.com/geojson-net#backer)] |
| 58 | + |
| 59 | +<a href="https://opencollective.com/geojson-net#backers" target="_blank"><img src="https://opencollective.com/geojson-net/backers.svg?width=890"></a> |
| 60 | + |
| 61 | + |
| 62 | +## Sponsors |
| 63 | + |
| 64 | +Support this project by becoming a sponsor. Your logo will show up here with a link to your website. [[Become a sponsor](https://opencollective.com/geojson-net#sponsor)] |
| 65 | + |
| 66 | +<a href="https://opencollective.com/geojson-net/sponsor/0/website" target="_blank"><img src="https://opencollective.com/geojson-net/sponsor/0/avatar.svg"></a> |
| 67 | +<a href="https://opencollective.com/geojson-net/sponsor/1/website" target="_blank"><img src="https://opencollective.com/geojson-net/sponsor/1/avatar.svg"></a> |
| 68 | +<a href="https://opencollective.com/geojson-net/sponsor/2/website" target="_blank"><img src="https://opencollective.com/geojson-net/sponsor/2/avatar.svg"></a> |
| 69 | +<a href="https://opencollective.com/geojson-net/sponsor/3/website" target="_blank"><img src="https://opencollective.com/geojson-net/sponsor/3/avatar.svg"></a> |
| 70 | +<a href="https://opencollective.com/geojson-net/sponsor/4/website" target="_blank"><img src="https://opencollective.com/geojson-net/sponsor/4/avatar.svg"></a> |
| 71 | +<a href="https://opencollective.com/geojson-net/sponsor/5/website" target="_blank"><img src="https://opencollective.com/geojson-net/sponsor/5/avatar.svg"></a> |
| 72 | +<a href="https://opencollective.com/geojson-net/sponsor/6/website" target="_blank"><img src="https://opencollective.com/geojson-net/sponsor/6/avatar.svg"></a> |
| 73 | +<a href="https://opencollective.com/geojson-net/sponsor/7/website" target="_blank"><img src="https://opencollective.com/geojson-net/sponsor/7/avatar.svg"></a> |
| 74 | +<a href="https://opencollective.com/geojson-net/sponsor/8/website" target="_blank"><img src="https://opencollective.com/geojson-net/sponsor/8/avatar.svg"></a> |
| 75 | +<a href="https://opencollective.com/geojson-net/sponsor/9/website" target="_blank"><img src="https://opencollective.com/geojson-net/sponsor/9/avatar.svg"></a> |
0 commit comments