0

I would like to ask what is the difference between geometry and geography using the PostGIS function ST_Azimuth.

When I execute the following query:

SELECT degrees( ST_Azimuth(ST_MakePoint(21.304116745663165, 38.68607570952619), ST_MakePoint(21.286237118117278,38.71455640443629)) )

I get 327.880195438529 degrees.

But when I cast the geometries to geography as the following query :

SELECT degrees( ST_Azimuth(ST_MakePoint(21.304116745663165, 38.68607570952619)::geography, ST_MakePoint(21.286237118117278,38.71455640443629)::geography) )

I get 333.810802282843 degrees.

Does the cast to geography give a more accurate result? Or a different calculation is made?

My geometries have SRID=4326.

Thank you in advance.

4

1 回答 1

1

在我看来,地理似乎为您提供了 WGS84 地球上的点对点方位角(因此是一个近似球面),而几何则为您提供了平面上的点对点方位角。

所以,是的,进行了不同的计算。

于 2012-12-20T12:49:16.957 回答