ST_INTERSECTION
Returns a geometry representing the point set intersection of two geometries. It outputs the spatial region shared by both input objects.
Syntax
ST_INTERSECTION(g1,g2)Description
Examples
SET @g1 = ST_GEOMFROMTEXT('POINT(2 1)');
SET @g2 = ST_GEOMFROMTEXT('LINESTRING(2 1, 0 2)');
SELECT ASTEXT(ST_INTERSECTION(@g1,@g2));
+----------------------------------+
| ASTEXT(ST_INTERSECTION(@g1,@g2)) |
+----------------------------------+
| POINT(2 1) |
+----------------------------------+Last updated
Was this helpful?

