-
Notifications
You must be signed in to change notification settings - Fork 46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Using NetTopologySuite.Io.GeoJSON4STJ with FluentValidation throws ArgumentOutOfRangeException #109
Comments
Very related to #68 |
That issue was openend in 2020 and isn't closed yet. Does that mean that all hope is lost (in my case ;)? Without FV, everything seems to be in working order.. |
Would it be sufficient to avoid throwing exceptions on properties? If so, that can be discussed, I think. |
I think changing the property getters not to throw is a good idea regardless. Perhaps return That said, ultimately, if your model contains an object that's serialized using our GeoJSON stuff and you use Swashbuckle or a similar tool to auto-generate the spec for it by reflecting over the CLR model instead of using that same GeoJSON stuff, then you're going to get an incorrect result. Changing a few property getters to stop throwing errors won't fix that. |
As a workaround, I have removed I can use NTS.IO.GeoJSON4STJ now.. |
@jeroenwo we also discovered this issue yesterday.. sigh. This really does need fixing. |
As a workaround you can add the |
... to not throw ArgumentOutOfRangeException. * Instead double.NaN is returned. * The setters don't perform any operation. refers to NetTopologySuite/NetTopologySuite.IO.GeoJSON/issues/109
* Instead double.NaN is returned. * The setters don't perform any operation. refers to NetTopologySuite/NetTopologySuite.IO.GeoJSON/issues/109
This includes everything added to JTS 1.20.0. For details, see the JTS release documentation for this version: https://github.com/locationtech/jts/releases/tag/1.20.0 Other changes include: 1. `NetTopologySuite.Geometries.Utilities.Extracter`, which includes our own strongly-typed spin on the other extracters found in this namespace. 2. #685 / #686: Better handling of `srsDimension` when reading GML. 3. Start taking advantage of some more modern .NET SDK features. (Don't worry, .NET Standard 2.0 is still fully supported.) 4. #702 / #703: `NetTopologySuite.Geometries.GeometryCollection` now implements `System.Collections.Generic.IReadOnlyList<Geometry>`. 5. #712 / (related to) NetTopologySuite/NetTopologySuite.IO.GeoJSON#109: Certain property getters no longer throw exceptions. Very softly related to: locationtech/jts#434 (comment) 6. #733: *some* help converting between tuples and coordinates 7. #738: minor documentation fix 8. #745 / #746: Add a .NET Standard 2.1 target so that the majority of modern applications no longer need to deal with a transient `System.Memory` package reference. 9. #751: .NET-specific (mostly) performance improvement for most queries using `NetTopologySuite.Index.Strtree` indexes. 10. #765 / #655 / #656 / locationtech/jts#714: Deviate from JTS a little bit in an attempt to soften a regression related to elevation that was introduced by OverlayNG. See linked issues for history, discussion, and more. 11. Bump `System.Memory` package reference to 4.6.0 so that .NET Standard 2.0 consumers debugging into this will see a link to the currently maintained version of this "slow span" package.
Good morning,
I am using NetTopologySuite.Io.GeoJSON4STJ in combination with FluentValidation, and when I try to do a POST to an endpoint with for example an
IFeature
with Polygon data, I get the following exception:I have narrowed it down to th
FluentValidation
initialization:Reproduction:
<PackageReference Include="FluentValidation.AspNetCore" Version="10.3.3" />
Program.cs
:builder.Services.AddFluentValidation();
IFeature
Here is an example of the project I use:
TestGeoJsonWebApi.zip
The complete stack trace:
I know it isn't a purely NTS problem but more an integration thing, but I was wondering if you can shed some light on it..
The text was updated successfully, but these errors were encountered: