CREATE PROCEDURE habitatArea() BEGIN SELECT ST_Area(ST_ConvexHull(ST_GeomFromText(m.g))) AS area FROM places, (SELECT CONCAT("MULTIPOINT(", i.str, ")") AS g FROM (SELECT GROUP_CONCAT(x, " ", y) AS str FROM places) i) AS m LIMIT 1; END
I used
+----------------------------------+ | ST_Area(ST_GeomFromText(@mpoly)) |
+----------------------------------+
and
+-----------------------------------------------+ | ST_ConvexHull(ST_GeomFromText(@mpoly)) | +-----------------------------------------------+