May 2017
Beginner to intermediate
328 pages
7h 17m
English
The area of a polygon or MultiPolygon geometry is computed with the ST_Area function. The same rules that we used with the perimeter calculations apply: when the argument is of the geometry type, the planimetric variant will be used, and with the geography type, the geodesic variant will be used:
SELECT ST_Area(ST_GeomFromText('POLYGON((391390 5817855,391490 5817955,391590 5818055, 319590 5817855,391390 5817855))', 32633)); st_area--------- 7180000
The argument is of the geometry type, and the SRID is 32633, which leads us to UTM 33N. The result is given in square meters:
SELECT ST_Area( ST_MakePolygon(ST_MakeLine(ARRAY[ST_MakePoint(20,50),ST_MakePoint(19.95,49.98), ST_MakePoint(19.90,49.90),ST_MakePoint(20,50)]))::geography ...Read now
Unlock full access