Created
December 5, 2013 15:50
-
-
Save antoniolocandro/7807846 to your computer and use it in GitHub Desktop.
Calculate area of polygon in GCS WGS 84 in Km2 using POSTGIS ST_Area
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Calculate Km2 of a polygon stores in GCS WGS84 | |
-- by default ST_Area returns the calculation in meters so the appropriate conversion was applied | |
-- fir_area_20131205 was the example table used | |
-- the spatial data was in a geom field so geom::geography was added | |
SELECT ST_Area(geom::geography)/1000000 as sqKM from fir_area_20131205 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment