+---------------------+---------------------+ | ST_Equals(@g1, @g1) | ST_Equals(@g1, @g2) | +---------------------+---------------------+ | 1 | 0 | +---------------------+---------------------+ 

• ST_FrechetDistance( g1 , g2  [, unit ]) 

Returns the discrete FrØchet distance between two geometries, reflecting how similar the geometries are. The result is a double-precision number measured in the length unit of the spatial reference system (SRS) of the geometry arguments, or in the length unit of the unit  argument if that argument is given. 

This function implements the discrete FrØchet distance, which means it is restricted to distances between the points of the geometries. For example, given two LineString  arguments, only the points explicitly mentioned in the geometries are considered. Points on the line segments between these points are not considered. 

ST_FrechetDistance()  handles its geometry arguments as described in the introduction to this section, with these exceptions: 

•The geometries may have a Cartesian or geographic SRS, but only LineString  values are supported. If the arguments are in the same Cartesian or geographic SRS, but either is not a LineString , an ER_NOT_IMPLEMENTED_FOR_CARTESIAN_SRS  or ER_NOT_IMPLEMENTED_FOR_GEOGRAPHIC_SRS  error occurs, depending on the SRS type. 

ST_FrechetDistance()  handles its optional unit  argument as described in the introduction to this section. 

mysql> SET @ls1 = ST_GeomFromText(’LINESTRING(0 0,0 5,5 5)’); mysql> SET @ls2 = ST_GeomFromText(’LINESTRING(0 1,0 6,3 3,5 6)’); mysql> SELECT ST_FrechetDistance(@ls1, @ls2); +--------------------------------+ | ST_FrechetDistance(@ls1, @ls2) | +--------------------------------+ | 2.8284271247461903 | +--------------------------------+ 

mysql> SET @ls1 = ST_GeomFromText(’LINESTRING(0 0,0 5,5 5)’, 4326); mysql> SET @ls2 = ST_GeomFromText(’LINESTRING(0 1,0 6,3 3,5 6)’, 4326); mysql> SELECT ST_FrechetDistance(@ls1, @ls2); +--------------------------------+ | ST_FrechetDistance(@ls1, @ls2) | +--------------------------------+ | 313421.1999416798 | +--------------------------------+ mysql> SELECT ST_FrechetDistance(@ls1, @ls2, ’foot’); +----------------------------------------+ | ST_FrechetDistance(@ls1, @ls2, ’foot’) | +----------------------------------------+ | 1028284.7767115477 | +----------------------------------------+ 

This function was added in MySQL 8.0.23. 

