top of page
CerebroSQL

ST_INTERSECTION

База данных: MySQL

68747470733a2f2f7374796c65732e7265646469746d656469612e636f6d2f74355f32716d366b2f7374796c65

ST_Intersection(g1, g2)

Returns a geometry that represents the point set intersection of the
geometry values g1 and g2.

ST_Intersection() handles its arguments as described in the
introduction to this section.

URL: https://dev.mysql.com/doc/refman/8.0/en/spatial-operator-functions.html

Example

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) |
+--------------------------------------+

bottom of page