NetTopologySuite / NetTopologySuite.IO.SqlServerBytes

A SQL Server IO module for NTS which works directly with the serialization format
BSD 3-Clause "New" or "Revised" License
16 stars 12 forks source link

#12 Provide a custom way to validate the geometry when written to SQL. #25

Closed kristofdegrave closed 2 years ago

kristofdegrave commented 2 years ago

This allows to override the default IsValid of the NTS Geometry and provide an own strategy. This way you can use the IsValidOp with the option SelfTouchingRingFormingHoleValid flagged. Or just make them all valid following the JTS way. Either way the developer will have more control, and if we would manage to provide a IsValidSqlServerOp, it could be passed this way.

kristofdegrave commented 2 years ago

@airbreather @FObermaier This is a blocking issue for us to use this solution. Is it possible to review my possible solution and provide some feedback on it?

Thanks in advance!

FObermaier commented 2 years ago

May I ask what your GeometryValidator does?

kristofdegrave commented 2 years ago

It provides a custom implementation for validating the geometry.

GeometryValidator is a callback that gets the geometry and returns if it is valid or not. The result of this function call is stored inside the cached IsValid flag of the SqlGeometry in the database.

This provides for us the developers some more flexibility and allows a custom IsValid functionality for SQL Server, without having to impact the NTS Geometry IsValid Implementation.

FObermaier commented 2 years ago

I assumed that, but it can't be open-sourced to be usable for others?

kristofdegrave commented 2 years ago

I was planning to use your implementation for now, with the SelfTouchingRingFormingHoleValid flag on. This would help us already, and we would be able to investigate further to fine tune the IsValid implementation for SQL Server.

And if we can fine tune it more, we will push the issues and possible solutions back to the community.

FObermaier commented 2 years ago

That sounds like a plan 👍

kristofdegrave commented 2 years ago

So can this get approved then?

kristofdegrave commented 2 years ago

Not especially waiting for you, more waiting on the nuget package :)

kristofdegrave commented 2 years ago

Thanks!

kristofdegrave commented 2 years ago

@FObermaier @airbreather When can this feature get released in a stable nuget package?

kristofdegrave commented 2 years ago

@FObermaier @airbreather You have any idea when this can get into a nuget package? We have a production release waiting on this. Thanks!