ST_AREA Geography Functioin Not Providing Correct Answer



I am using ST_Area() geography function for calculation of area under polygon ( specifically speaking  square ) of 3 sq km having each side length of 1.732 km ( root 3 )


The sql is - 

VMart=> SELECT ST_Area(ST_GeographyFromText('POLYGON((51.215265136 -179.147338754,51.215265136 -179.122500803037,51.230832300 -179.147338754,51.215265136 -179.147338754))'));
(1 row)


On cross verifying the area from google earth and few online tool  )

the area is found to be ~ 3 sq km as seen in the attched snapshot.


What can be the probable reason for NOT getting correct answer by using ST_AREA geography function in vertica ?


Kindly suggest/help to utillize this function reliably.


With regards,




  • Ariel_CaryAriel_Cary Vertica Employee Employee

    Hi Vijay,


    There are a couple of problems with your query.
    1) The coordinates do not form a rectangular regions. It's missing the NE corner.
    2) The coordinate order is inversed. Coordinate data should be entered in (long lat) order. Understandably, this is confusing sometimes as we usually refer to the data as lat/long data.


    Correcting these problems, I get area value closer to your expected result:


    SELECT ST_Area(ST_GeographyFromText('POLYGON((-179.147338754 51.215265136, -179.122500803037 51.215265136, -179.122500803037 51.230832300, -179.147338754 51.230832300, -179.147338754 51.215265136))'));
    (1 row)


    Hope this helps.




Leave a Comment

BoldItalicStrikethroughOrdered listUnordered list
Align leftAlign centerAlign rightToggle HTML viewToggle full pageToggle lights
Drop image/file