Skip to content
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

Add .STAsBinary method to library #19

Open
justintoth opened this issue Jan 11, 2019 · 5 comments
Open

Add .STAsBinary method to library #19

justintoth opened this issue Jan 11, 2019 · 5 comments
Labels
enhancement New feature or request

Comments

@justintoth
Copy link

I'm trying to port over a .NET Framework class library to .NET Standard. I'm using your package for Microsoft.SqlServer.Types, as the Microsoft package doesn't support .NET Standard. However, the STAsBinary method seems to be missing from your implementation:

value = ToHexString(((SqlGeography)parameter.Value).STAsBinary().Value);

@dotMorten
Copy link
Owner

Correct. Well-known binary support is not part of the library. Main goal of the library was to enable you to get geometry in and out of sqlserver. You can always just query sqlserver to return STAsBinary as a column.

@dotMorten dotMorten changed the title STAsBinary method is missing Add .STAsBinary method to library Jan 11, 2019
@dotMorten dotMorten added the enhancement New feature or request label Jan 11, 2019
@justintoth
Copy link
Author

Thanks for the quick response! It looks like it's also missing the MakeValid, EnvelopeAngle, ReorientObject, BufferWithTolerance, Point, Reduce, EnvelopeCenter, STDistance, and STIsValid methods in the SqlGeography class. Do you know if there is a better way for me to port over this code to .NET Standard? (Another nuget library, something I'm missing?)

@dotMorten
Copy link
Owner

Most of these operations are not simple-to-implement features, as they require spatial geometry processing, and without knowing Microsoft's implementation, there's no way to get the exact same results they do. It's better to perform these operations in your sql query instead.
Again this library's main purpose it to be able to query with geometry or return geometry - it's not a spatial processing library (it's just not feasible to produce with the time at hand, and I also have a strict requirement that output must match what SQL Server generates).

@dotMorten
Copy link
Owner

...having said that adding WKB support isn't that hard, and I already have done something similar before that just needs to be ported to here, which is why I renamed the title and left the issue here. I don't have plans to add the other options you asked for, as that is a surprisingly hard task

@ShadowMarker789
Copy link

I don't suppose the feasibility of implementing the full set of features available in Microsoft.SqlServer.DacFx.x64 Nuget which is .Net Framework into .Net Standard, Core, 5, or 6 has changed since the year-and-a-bit since last post?

This is for application-side processing where quite possibly no such Sql Server exists. (or is potentially unreachable due to flaky network conditions, such as an ad-hoc mesh network in volatile terrain)

The talk of Microsoft's implementation makes me think this is a case of Closed-Source current implementations not being made Open-Source, so we'd have to reimplement all of the spatial logic, which does sound like quite the task.

I'm using the STIntersects() among others, which I expect to be among the "... not simple-to-implement" features.

I'm not so sure about calling .Net Framework v 4.6.1 code from a .Net 5 context, or whether that'll work inside a docker container.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants