GeoJSON-Net / GeoJSON.Text

.Net library for GeoJSON types & corresponding System.TExt.Json (de)serializers
MIT License
39 stars 10 forks source link

GeoJson.Text compatibility with *.Contrib converters #16

Open TheAtomicOption opened 2 years ago

TheAtomicOption commented 2 years ago

Currently the nugets in https://github.com/GeoJSON-Net/GeoJSON.Net.Contrib for converting to/from GeoJSON objects only work with GeoJSON.NET. This effectively locks anyone who needs them into the old Newtonsoft.Json libraries.

The most straight forward solution I can see for this is to fork GeoJSON.Net.Contrib to a new GeoJSON.Text.Contrib repo, and modify the using statements to GeoJSON.Text, and create new nugets to match.

TheAtomicOption commented 2 years ago

Update I've forked the repo myself and renamed everything here: https://github.com/TheAtomicOption/GeoJSON.Text.Contrib

the Wkb compiles and tests correctly.

The MsSqlServer compiles but fails all tests as the testing project can't find the native DLLs

The EntityFramework project compiles, but fail some tests due to not counting coordinates correctly and null not matching NaN for the unused Z dimension.

Since EF Core now uses NetTopologySuite since v2.2 I converted the extension methods in that project to be to/from NTS types.


Feel free to Fork this fork back into a new repo under the GeoJSON-Net user, and create nugets as appropriate

TheAtomicOption commented 2 years ago

Fixed EF tests

TheAtomicOption commented 2 years ago

Added explicit reference to System.Data.SqlClient which fixes missing dependency for MsSqlSpatial tests. Fixed Misc tests by making them use System.Text.Json instead of Newtonsoft.

All tests now pass when run with the last build. However the VS button to run tests fails during build due to treating the Nuget warnings as errors. This might be related to this long unresolved bug: https://github.com/NuGet/Home/issues/5375

TheAtomicOption commented 2 years ago

Added suppression of the NU1701 warning at the package dependency declaration level. VS test buttons now build and run all tests successfully.

I'm going to consider this a complete successful conversion until someone brings up additional issues.

TheAtomicOption commented 2 years ago

Built a basic WKT converter that's independent of SqlServer DLLs into the Wkb assembly.

matt-lethargic commented 2 years ago

Nice one 👍