[+/-]
Each function that belongs to this group takes a geometry value
as its argument and returns some quantitative or qualitative
property of the geometry. Some functions restrict their argument
type. Such functions return NULL if the
argument is of an incorrect geometry type. For example,
Area() returns
NULL if the object type is neither
Polygon nor MultiPolygon.

User Comments
The GLength function can not be used for calculating the distance on a sphere ... like earth. correct me if i m wrong.
Yes, IIRC mysql's geometry calculations are limited to the cartesian plane. This is important when needing to make calculations that involve non-cartesian coordinates (such as mercator coordinates)
In case you want to get a center point of any geometry, consider the function I created:
DELIMITER //
DROP FUNCTION IF EXISTS GetCenterPoint; //
CREATE FUNCTION GetCenterPoint(g GEOMETRY) RETURNS POINT NO SQL DETERMINISTIC
BEGIN
DECLARE envelope POLYGON;
DECLARE sw, ne POINT; #South-West and North-East points
DECLARE lat, lng DOUBLE;
SET envelope = ExteriorRing(Envelope(g));
SET sw = PointN(envelope, 1);
SET ne = PointN(envelope, 3);
SET lat = X(sw) + (X(ne)-X(sw))/2;
SET lng = Y(sw) + (Y(ne)-Y(sw))/2;
RETURN POINT(lat, lng);
END; //
We use it a lot in our project http://www.sunnyrentals.com to distinguish coordinates to center a map to.
Add your own comment.