content_image/762139.jpg content_image/762140.jpg
•If any argument has 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. If an SRS uses another unit, the range uses the corresponding values in its unit. The exact range limits deviate slightly due to floating-point arithmetic. 

•If the radius  argument is present but not positive, an ER_NONPOSITIVE_RADIUS  error occurs. 

•If the distance exceeds the range of a double-precision number, an ER_STD_OVERFLOW_ERROR  error occurs. 

mysql> SET @pt1 = ST_GeomFromText(’POINT(0 0)’); mysql> SET @pt2 = ST_GeomFromText(’POINT(180 0)’); mysql> SELECT ST_Distance_Sphere(@pt1, @pt2); 

<img src='content_image/762139.jpg'>

• ST_IsValid( g ) 

Returns 1 if the argument is geometrically valid, 0 if the argument is not geometrically valid. Geometry validity is defined by the OGC specification. 

The only valid empty geometry is represented in the form of an empty geometry collection value. ST_IsValid()  returns 1 in this case. MySQL does not support GIS EMPTY  values such as POINT EMPTY . 

ST_IsValid()  handles its arguments as described in the introduction to this section, with this exception: 

•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. If an SRS uses another unit, the range uses the corresponding values in its unit. The exact range limits deviate slightly due to floating-point arithmetic. 

mysql> SET @ls1 = ST_GeomFromText(’LINESTRING(0 0,-0.00 0,0.0 0)’); mysql> SET @ls2 = ST_GeomFromText(’LINESTRING(0 0, 1 1)’); mysql> SELECT ST_IsValid(@ls1); 

<img src='content_image/762140.jpg'>

