OpenGIS proposes a number of functions that can produce geometries. They are designed to implement spatial operators.
ST_Buffer() and
Buffer() are synonyms. For more
information, see the description of
ST_Buffer().
Buffer() was added in MySQL
5.6.1.
Returns a geometry that represents all points whose distance
from the geometry value g is less
than or equal to a distance of d.
ST_Buffer() supports negative
distances for polygons, multipolygons, and geometry
collections containing polygons or multipolygons. For point,
multipoint, linestring, multilinestring, and geometry
collections not containing any polygons or multipolygons,
ST_Buffer() with a negative
distance returns NULL.
ST_Buffer() and
Buffer() are synonyms.
ST_Buffer() was added in MySQL
5.6.1.
Returns a geometry that represents the point set difference of
the geometry values g1 and
g2.
mysql>SET @g1 = POINT(1,1), @g2 = POINT(2,2);mysql>SELECT ST_AsText(ST_Difference(@g1, @g2));+------------------------------------+ | ST_AsText(ST_Difference(@g1, @g2)) | +------------------------------------+ | POINT(1 1) | +------------------------------------+
ST_Difference() was added in
MySQL 5.6.1.
Returns a geometry that represents the point set intersection
of the geometry values g1 and
g2.
mysql>SET @g1 = ST_GeomFromText('LineString(1 1, 3 3)');mysql>SET @g2 = ST_GeomFromText('LineString(1 3, 3 1)');mysql>SELECT ST_AsText(ST_Intersection(@g1, @g2));+--------------------------------------+ | ST_AsText(ST_Intersection(@g1, @g2)) | +--------------------------------------+ | POINT(2 2) | +--------------------------------------+
ST_Intersection() was added in
MySQL 5.6.1.
Returns a geometry that represents the point set symmetric
difference of the geometry values
g1 and
g2, which is defined as:
g1symdifferenceg2:= (g1uniong2) difference (g1intersectiong2)
Or, in function call notation:
ST_SymDifference(g1,g2) = ST_Difference(ST_Union(g1,g2), ST_Intersection(g1,g2))
mysql>SET @g1 = POINT(1,1), @g2 = POINT(2,2);mysql>SELECT ST_AsText(ST_SymDifference(@g1, @g2));+---------------------------------------+ | ST_AsText(ST_SymDifference(@g1, @g2)) | +---------------------------------------+ | MULTIPOINT(1 1,2 2) | +---------------------------------------+
ST_SymDifference() was added in
MySQL 5.6.1.
Returns a geometry that represents the point set union of the
geometry values g1 and
g2.
mysql>SET @g1 = ST_GeomFromText('LineString(1 1, 3 3)');mysql>SET @g2 = ST_GeomFromText('LineString(1 3, 3 1)');mysql>SELECT ST_AsText(ST_Union(@g1, @g2));+--------------------------------------+ | ST_AsText(ST_Union(@g1, @g2)) | +--------------------------------------+ | MULTILINESTRING((1 1,3 3),(3 1,1 3)) | +--------------------------------------+
ST_Union() was added in MySQL
5.6.1.
In addition, Section 12.15.7, “Geometry Property Functions”, discusses several functions that construct new geometries from existing ones. See that section for descriptions of these functions: