Comments (2)
To follow up on this one:
If I create a multipoint geometry in sql server, and output to hex, then use the hex to create a geometry I get expected results.
That same geometry, when created in C# using Microsoft.SqlServer.Types generates a binary of:
0x000000000104010000003D0AD7A3708D53C0AC1C5A643BEF4540020000000000000000000000000002000000FFFFFFFF0000000004000000000100000001
Which sql server can't parse and throws the above exception.
I suspect that there's something wrong in the hierarchy patterns for multipoint, but I'm struggling to understand the code. You can see that the sql generated binary is identical to the dotmorten one up to the end of the coordinates, and the beginning of what looks like the hierarchy bits.
DECLARE @g geometry;
SET @g = geometry::STMPointFromText('MULTIPOINT((-78.21 43.869))', 4326);
SELECT @g;
DECLARE @g geometry;
SET @g = geometry::STMPointFromText('MULTIPOINT (-78.21 43.869)', 0);
SELECT @g.STAsBinary();
DECLARE @g geometry;
--SET @g = 0x000000000104010000003D0AD7A3708D53C0AC1C5A643BEF454001000000010000000002000000FFFFFFFF0000000004000000000000000001
--fromvs = 0x000000000104010000003D0AD7A3708D53C0AC1C5A643BEF4540020000000000000000000000000002000000FFFFFFFF0000000004000000000100000001
--fromwkb 0x01040000000100000001010000003D0AD7A3708D53C0AC1C5A643BEF4540
SELECT @g.ToString();
from microsoft.sqlserver.types.
Apparently, the initial OGC specifications were not clear and the community started using the representation that this library is doing for MultiPoint geometries. But apparently OGC has since clarified the specifications and accordingly, the version with extra parenthesis are the correct one. I'll fix that.
from microsoft.sqlserver.types.
Related Issues (20)
- ToString() of SqlHierarchyId does not return "NULL" when IsNull == true HOT 1
- GetDescendant for a simple range fails with a HierarchyIdException HOT 2
- Throw HierarchyIdException instead of ArgumentException in GetDescendant method
- HierarchyId serialized in an invalid format which can't be deserialized HOT 11
- Some Geography cannot be deserialized. HOT 4
- When using Microsoft.Data.SqlClient an InvalidCastException will be thrown HOT 3
- Could not load file or assembly Microsoft.SqlServer.Types HOT 13
- SqlHierarchyId Write/Read roundtrip causes data corruption HOT 9
- System.Data.SqlClient needs a version bumb from 4.5.1 to 4.8.3 HOT 4
- assembly load error HOT 4
- DataReader.GetFieldType returned null HOT 10
- Specified type is not registered on the target. HOT 1
- Referenced assembly 'Microsoft.SqlServer.Types, Version=2.5.0.0, Culture=neutral, PublicKeyToken=null' does not have a strong name
- Fill DataTable throws DataReader.GetFieldType null
- Insert to SQL Server throws exception - `Specified type is not registered on the target server`. HOT 1
- Using Microsoft.Data.SqlClient 5.0.1 causes System.TypeLoadException: Could not load type 'Microsoft.Data.SqlClient.Server.IBinarySerialize' HOT 10
- Security Vulnerability: https://github.com/advisories/GHSA-8g2p-5pqh-5jmc HOT 7
- Upgrade from Framework to Standard HOT 2
- STIsValid returning incorrect result for parameterized query HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from microsoft.sqlserver.types.