[QUESTION] Same values being returned by STAsBinary and serialize
See original GitHub issueQuestion
My understanding is that sql server uses CLR data types for representing Spatial types internally, and the method STAsBinary
would convert the object to a WKB format.
The difference between these two formats is clear when I query an actual DB:
DECLARE @g geometry;
SET @g = (geometry::STGeomFromText('LINESTRING( -122.360 47.656, -122.343 47.656)', 0))
select @g as CLR, @g.STAsBinary() as WKB
But the JDBC driver seems to return the same exact values whether I use STAsBinary()
or serialize()
. Is this intentional? I was under the impression that WKB formats needed to follow the protocol described here.
Relevant Issues and Pull Requests
Issue Analytics
- State:
- Created 4 years ago
- Comments:7 (3 by maintainers)
Top Results From Across the Web
geography and the entity framework - MSDN - Microsoft
Another problem I have with the binary approach is that the STBinary method just ditches the Z and M values of the SqlGeography...
Read more >SQL Server geography result format - Stack Overflow
You can create such value in C# like this (reference Microsoft.SqlServer. ... Serialize().Value; var hexString = "0x" + BitConverter.
Read more >Serialize and Deserialize a Binary Tree - GeeksforGeeks
Serialization is to store the tree in a file so that it can be later restored. The structure of the tree must be...
Read more >SQLCreator only reading geometry column ... - FME Community
I'm using an SQL Creator to return data from three tables (Microsoft SQL Server), one of which contains a geometry column.
Read more >Exporting Spatial Data From SQL Server to ESRI Shapefile
The problem seems to be that, even though we're only returning ... the shapegeom value directly, use the STAsBinary() method in the SQL ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I think the STAsBinary() should return the same value as SQL Server (I thought it returned a WKB format), but from what I’m seeing, it’s currently returning the CLR format of the datatype. We will make a fix for this in the near future, so that the STAsBinary() returns the WKB format as the javadoc indicates.
Sounds good, thanks for the update! I’ll go ahead and create an issue for this.