Geometry Property Functions • ST_Length( ls  [,  unit ]) •If the geometry is a valid  LineString  in a Cartesian SRS, the return value is the Cartesian length of the geometry. ST_Length()  computes a result as follows: Returns a double-precision number indicating the length of the  LineString  or  MultiLineString value  ls  in its associated spatial reference system. The length of a  MultiLineString  value is equal to the sum of the lengths of its elements. •If the geometry is a valid  MultiLineString  in a Cartesian SRS, the return value is the sum of the Cartesian lengths of its elements. •If the geometry is a valid  LineString  in a geographic SRS, the return value is the geodetic length of the geometry in that SRS, in meters. •If the geometry is a valid  MultiLineString  in a geographic SRS, the return value is the sum of the geodetic lengths of its elements in that SRS, in meters. ST_Length()  handles its arguments as described in the introduction to this section, with these exceptions: •If the geometry is not a  LineString  or  MultiLineString , the return value is  NULL . •If the geometry is geometrically invalid, either the result is an undefined length (that is, it can be any number), or an error occurs. •If the length computation result is  +inf , an  ER_DATA_OUT_OF_RANGE  error occurs. •If the geometry has a geographic SRS with a longitude or latitude that is out of range, an error occurs: • If a longitude value is not in the range ( − 180, 180], an ER_GEOMETRY_PARAM_LONGITUDE_OUT_OF_RANGE  error occurs ( ER_LONGITUDE_OUT_OF_RANGE  prior to MySQL 8.0.12). • If a latitude value is not in the range [ − 90, 90], an ER_GEOMETRY_PARAM_LATITUDE_OUT_OF_RANGE  error occurs ( ER_LATITUDE_OUT_OF_RANGE prior to MySQL 8.0.12). Ranges shown are in degrees. The exact range limits deviate slightly due to floating-point arithmetic. As of MySQL 8.0.16,  ST_Length()  permits an optional  unit  argument that specifies the linear unit for the returned length value. These rules apply: •If a unit is specified but not supported by MySQL, an  ER_UNIT_NOT_FOUND  error occurs. •If a supported linear unit is specified and the SRID is 0, an ER_GEOMETRY_IN_UNKNOWN_LENGTH_UNIT  error occurs. •If a supported linear unit is specified and the SRID is not 0, the result is in that unit. •If a unit is not specified, the result is in the unit of the SRS of the geometries, whether Cartesian or geographic. Currently, all MySQL SRSs are expressed in meters. A unit is supported if it is found in the  INFORMATION_SCHEMA ST_UNITS_OF_MEASURE  table. See Section 26.3.37, “The INFORMATION_SCHEMA ST_UNITS_OF_MEASURE Table” . 2311