What are the units of the geography coordinates?

Sergey T 21 Reputation points
2022-09-07T04:39:41.573+00:00

What are the units that the Geography type is supposed to be using? I could not find a clear documentation for that.
There is some ambiguity if it always uses degree and that should be documented.

Here is a sample SQL:

DECLARE @g1 geography;
DECLARE @g2 geography;
SET @g1 = geography::STGeomFromText('POINT(-2.5969212962962964 0)', 4807);
SET @g2 = geography::STGeomFromText('POINT(-1.4858101851851855 0)', 4807);
SELECT @g1.STDistance(@g2);

result is 123690.498850248

Which is only possible if the geography coordinates are interpreted as degrees. The srid=4807 is a peculiar geographic coordinate system that uses gradians as the units. One gradian is 0.9 degree.
See https://spatialreference.org/ref/epsg/4807/html/

The input points in the above query correspond to (0, 0) and (1, 0) in 4326, so if the geography type was taking units into account, the distance should be close to 111320.

SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
12,884 questions
{count} votes

Accepted answer
  1. Seeya Xi-MSFT 16,451 Reputation points
    2022-09-07T08:46:05.177+00:00

    Hi @Sergey T ,

    Welcome to Microsoft Q&A!

    What are the units that the Geography type is supposed to be using? I could not find a clear documentation for that.

    Maybe this is the documentation you're looking for: Spatial Data Types Overview

    Best regards,
    Seeya


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    1 person found this answer helpful.

1 additional answer

Sort by: Most helpful
  1. Olaf Helper 41,101 Reputation points
    2022-09-07T05:03:35.497+00:00

    What are the units that the Geography type is supposed to be using?

    Degree, what else?

    I could not find a clear documentation for that.

    Where have you searched? Latitude & Langitude are always in degree.

    The srid=4807 is a peculiar geographic coordinate

    Not really, more 4326 = WGS 84 spatial reference system

    See https://en.wikipedia.org/w/index.php?title=Spatial_reference_system

    0 comments No comments