These functions return properties of Polygon
or MultiPolygon values.
ST_Area() and
Area() are synonyms. For more
information, see the description of
ST_Area().
ST_Centroid() and
Centroid() are synonyms. For
more information, see the description of
ST_Centroid().
ST_ExteriorRing() and
ExteriorRing() are synonyms.
For more information, see the description of
ST_ExteriorRing().
ST_InteriorRingN() and
InteriorRingN() are synonyms.
For more information, see the description of
ST_InteriorRingN().
ST_NumInteriorRings() and
NumInteriorRings() are
synonyms. For more information, see the description of
ST_NumInteriorRings().
Returns a double-precision number indicating the area of the argument, as measured in its spatial reference system. For arguments of dimension 0 or 1, the result is 0.
mysql>SET @poly = 'Polygon((0 0,0 3,3 0,0 0),(1 1,1 2,2 1,1 1))';mysql>SELECT ST_Area(ST_GeomFromText(@poly));+---------------------------------+ | ST_Area(ST_GeomFromText(@poly)) | +---------------------------------+ | 4 | +---------------------------------+ mysql>SET @mpoly =->'MultiPolygon(((0 0,0 3,3 3,3 0,0 0),(1 1,1 2,2 2,2 1,1 1)))';mysql>SELECT ST_Area(ST_GeomFromText(@mpoly));+----------------------------------+ | ST_Area(ST_GeomFromText(@mpoly)) | +----------------------------------+ | 8 | +----------------------------------+
ST_Area() and
Area() are synonyms.
ST_Area() was added in MySQL
5.6.1.
Returns the mathematical centroid for the
MultiPolygon value
mpoly as a
Point. The result is not guaranteed to be
on the MultiPolygon.
mysql>SET @poly =->ST_GeomFromText('POLYGON((0 0,10 0,10 10,0 10,0 0),(5 5,7 5,7 7,5 7,5 5))');mysql>SELECT GeometryType(@poly),ST_AsText(ST_Centroid(@poly));+---------------------+--------------------------------------------+ | GeometryType(@poly) | ST_AsText(ST_Centroid(@poly)) | +---------------------+--------------------------------------------+ | POLYGON | POINT(4.958333333333333 4.958333333333333) | +---------------------+--------------------------------------------+
ST_Centroid() and
Centroid() are synonyms.
ST_Centroid() was added in
MySQL 5.6.1.
Returns the exterior ring of the Polygon
value poly as a
LineString.
mysql>SET @poly =->'Polygon((0 0,0 3,3 3,3 0,0 0),(1 1,1 2,2 2,2 1,1 1))';mysql>SELECT ST_AsText(ST_ExteriorRing(ST_GeomFromText(@poly)));+----------------------------------------------------+ | ST_AsText(ST_ExteriorRing(ST_GeomFromText(@poly))) | +----------------------------------------------------+ | LINESTRING(0 0,0 3,3 3,3 0,0 0) | +----------------------------------------------------+
ST_ExteriorRing() and
ExteriorRing() are synonyms.
ST_ExteriorRing() was added
in MySQL 5.6.1.
Returns the N-th interior ring
for the Polygon value
poly as a
LineString. Rings are numbered beginning
with 1.
mysql>SET @poly =->'Polygon((0 0,0 3,3 3,3 0,0 0),(1 1,1 2,2 2,2 1,1 1))';mysql>SELECT ST_AsText(ST_InteriorRingN(ST_GeomFromText(@poly),1));+-------------------------------------------------------+ | ST_AsText(ST_InteriorRingN(ST_GeomFromText(@poly),1)) | +-------------------------------------------------------+ | LINESTRING(1 1,1 2,2 2,2 1,1 1) | +-------------------------------------------------------+
ST_InteriorRingN() and
InteriorRingN() are synonyms.
ST_InteriorRingN() was added
in MySQL 5.6.1.
Returns the number of interior rings in the
Polygon value
poly.
mysql>SET @poly =->'Polygon((0 0,0 3,3 3,3 0,0 0),(1 1,1 2,2 2,2 1,1 1))';mysql>SELECT ST_NumInteriorRings(ST_GeomFromText(@poly));+---------------------------------------------+ | ST_NumInteriorRings(ST_GeomFromText(@poly)) | +---------------------------------------------+ | 1 | +---------------------------------------------+
ST_NumInteriorRings() and
NumInteriorRings() are
synonyms.
ST_NumInteriorRings() was
added in MySQL 5.6.1.