GeoJSON-Net / GeoJSON.Net

.Net library for GeoJSON types & corresponding Json.Net (de)serializers
MIT License
444 stars 168 forks source link

Check if a polygon is a rectangle? #125

Closed rijethma closed 5 years ago

rijethma commented 5 years ago

Do you think it'll be beneficial for us to add such an extension method?

matt-lethargic commented 5 years ago

Hi @rijethma thanks for the suggestion. I'm actually torn on this idea, it feels like it's moving away from the primary purpose of GeoJSON.Net which is to serialise and deserialise geojson, I'm very much into things doing one thing and doing it well, much like SRP.

One thing that comes to mind is a new Nuget package that GeoJSON.Net Extenions or something, but then we'd just have one method in it "check if polygon is rectangle"

Discuss!

xfischer commented 5 years ago

Hi @rijethma and @matt-lethargic. This is topology related. It should be more appropriate to use a dedicated library for this (NetTopologySuite, ...)

matt-lethargic commented 5 years ago

Agreed @xfischer and a good point even I use NetTopologySuite for a few things like this!

xfischer commented 5 years ago

Just to add a little more context, we are in Spherical Geometry.

rijethma commented 5 years ago

Thanks for the suggestion! I'll explore the NetTopologySuite library.