ST_AREA()
This page is part of MariaDB's Documentation.
The parent of this page is: Functions for MariaDB Enterprise Server
Topics on this page:
Overview
Returns double-precision area of the given Polygon value as measured in its spatial reference system.
EXAMPLES
SELECT ST_AREA(ST_PolyFromText(
'POLYGON((15 40, 15 20, 25 20, 30 25, 30 35, 25 40, 15 40))'
)) AS Area;
+------+
| Area |
+------+
| 275 |
+------+
SET @polygon ='Polygon((0 0,0 5,5 0,0 0),(2 2,2 5,5 2,2 2))';
SELECT ST_Area(ST_GeomFromText(@polygon));
+------------------------------------+
| ST_Area(ST_GeomFromText(@polygon)) |
+------------------------------------+
| 8 |
+------------------------------------+
SET @poly = ST_PolygonFromText('POLYGON((0 40, 0 20, 6 30, 12 20, 12 40, 0 40))');
SELECT ST_Area(@poly);
+----------------+
| ST_Area(@poly) |
+----------------+
| 180 |
+----------------+
CHANGE HISTORY
EXTERNAL REFERENCES
Additional information on this topic may be found in the MariaDB Public Knowledge Base.