Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7562045
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T13:18:56+00:00 2026-05-30T13:18:56+00:00

I am experiencing inconsistent behavior across machines with conversion to Well-Known Text (WKT) of

  • 0

I am experiencing inconsistent behavior across machines with conversion to Well-Known Text (WKT) of spatial types in SQL server 2008. It looks as if the data is being stored identically, but the conversion back to WKT acts differently depending on the machine!

Here’s something I put together to pinpoint the issue:

SET NOCOUNT ON;

DECLARE @TestTable TABLE (TestPoint GEOGRAPHY);
INSERT INTO @TestTable(TestPoint)  VALUES (geography::STGeomFromText('POINT(-124.957140999999993 39.326679)',4326));

DECLARE @PointAsText NVARCHAR(max);
SELECT @PointAsText = TestPoint.STAsText() from @TestTable;
PRINT @PointAsText;

DECLARE @PointAsBinary BINARY(22);
SELECT  @PointAsBinary = CAST(TestPoint AS BINARY(22)) from @TestTable;
print @PointAsBinary;

print @@version;

On various machines I have available, I see two different results:

POINT (-124.95714099999999 39.326679)
0xE6100000010C1EA5129ED0A94340492A53CC413D5FC0
Microsoft SQL Server 2008 R2 (SP1) – 10.50.2500.0 (X64)
    Jun 17 2011 00:54:03
    Copyright (c) Microsoft Corporation
    Developer Edition (64-bit) on Windows NT 6.1 (Build 7601: Service Pack 1)

or

POINT (-124.957141 39.326679)
0xE6100000010C1EA5129ED0A94340492A53CC413D5FC0
Microsoft SQL Server 2008 R2 (RTM) – 10.50.1600.1 (Intel X86)
    Apr 2 2010 15:53:02
    Copyright (c) Microsoft Corporation
    Developer Edition on Windows NT 6.0 (Build 6002: Service Pack 2) (Hypervisor)

Another test case shows that an X64 machine with 2008 R2 (RTM) gives -124.95714099999999. So, definitely indicates x86 vs x64.

I’m at least somewhat familiar with lack of floating point precision, but I was unaware it was architecture specific. It seems as if working with SQL spatial storage involves data going through through WKT conversions like these. Am I failing to see a more appropriate strategy to working with this data?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T13:18:58+00:00Added an answer on May 30, 2026 at 1:18 pm

    There’s been no activity for a couple weeks so I’ll answer with what I know.

    My best understanding of this is that use of Well-Known-Text (WKT) just needs to be avoided. I am not sure about Well-Known-Binary (WKB) as an option.

    To be certain that you don’t lose precision/granularity when using SqlGeography in your database, you can use the SqlGeography class in your middleware or application. The class is binarily serializeable, to help in this regard.

    Leaving the safety of SqlGeography class via Well-Known-Text(WKT) is when precision will start to fade. It is preferable to do this only when showing to the user or when forced to communicate with non-.NET platforms (such as using a web service).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm experiencing something a bit strange. I have a table on SQL Server 2008,
I've been experiencing very inconsistent results while developing an iPhone app and trying to
When experiencing networking problems on client machines, I'd like to be able to run
I'm experiencing some issues with rewriting my blocking socket server to a non-blocking version.
I'm experiencing an issue with chromes click behavior. There are cases (havnt been able
Im experiencing strange behavior when converting String to DateTime and then again ToString(). Convert.ToDateTime(16-02-2012).ToString(MM/dd/yyyy)
Im experiencing an issue with a production server. I can connect to the server
I am experiencing some different javascript behavior when running my site on Kindle Fire
I experiencing a strange behavior of C#. Its some thing like this.. var date
I'm experiencing very different behavior when creating a wx.Panel depending on whether the main

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.