Skip to content

Fix STAsBinary to return WKB format instead of CLR#1364

Merged
ulvii merged 12 commits intomicrosoft:devfrom
peterbae:github-1280
Jul 3, 2020
Merged

Fix STAsBinary to return WKB format instead of CLR#1364
ulvii merged 12 commits intomicrosoft:devfrom
peterbae:github-1280

Conversation

@peterbae
Copy link
Copy Markdown
Contributor

Fixes issue #1280.

STAsBinary is a method that's supported by SSMS to return a WKB (Well-Known binary) format of a Geometry/Geography instance. The driver also implemented this method when it first implemented spatial datatypes, but it was wrongly returning a CLR (Microsoft's internal representation of a Geometry/Geography instance, different from WKB) value instead. This PR adds new logic to parse existing spatial datatype instance into a WKB format.

The counterpart method to this method, STGeomFromWKB, (which takes in a WKB and returns a Geometry/Geography instance) will be fixed at a later date, and I've put a note in the Javadocs telling users to use deserialize(byte[]) instead which does the exact same thing as current STGeomFromWKB.

@peterbae peterbae changed the title Fix | Change STAsBinary to return WKB format instead of CLR Fix STAsBinary to return WKB format instead of CLR Jun 18, 2020
@peterbae peterbae added the Public API Changes in Public API label Jun 18, 2020
@ulvii ulvii added this to the 8.4.0 milestone Jun 25, 2020
Comment thread src/main/java/com/microsoft/sqlserver/jdbc/SQLServerSpatialDatatype.java Outdated
@ulvii ulvii merged commit c82222a into microsoft:dev Jul 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Public API Changes in Public API

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants