Giter Site home page Giter Site logo

Comments (2)

Ogre-69 avatar Ogre-69 commented on May 26, 2024

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.

dotMorten avatar dotMorten commented on May 26, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.