ST_SYMDIFFERENCE(g1,g2)
Returns a geometry that represents the portions of geometry g1
and geometry g2
that don't intersect.
SET @g1 = ST_GEOMFROMTEXT('LINESTRING(10 20, 10 40)'); SET @g2 = ST_GEOMFROMTEXT('LINESTRING(10 15, 10 25)'); SELECT ASTEXT(ST_SYMDIFFERENCE(@g1,@g2)); +----------------------------------------------+ | ASTEXT(ST_SYMDIFFERENCE(@g1,@g2)) | +----------------------------------------------+ | MULTILINESTRING((10 15,10 20),(10 25,10 40)) | +----------------------------------------------+ SET @g2 = ST_GeomFromText('LINESTRING(10 20, 10 41)'); SELECT ASTEXT(ST_SYMDIFFERENCE(@g1,@g2)); +-----------------------------------+ | ASTEXT(ST_SYMDIFFERENCE(@g1,@g2)) | +-----------------------------------+ | LINESTRING(10 40,10 41) | +-----------------------------------+
© 2019 MariaDB
Licensed under the Creative Commons Attribution 3.0 Unported License and the GNU Free Documentation License.
https://mariadb.com/kb/en/st_symdifference/