Spatial Geohash Functions +--------------------+--------------------+ | MBRWithin(@g1,@g2) | MBRWithin(@g2,@g1) | +--------------------+--------------------+ | 1 | 0 | +--------------------+--------------------+ 12.17.10 Spatial Geohash Functions Geohash is a system for encoding latitude and longitude coordinates of arbitrary precision into a text string. Geohash values are strings that contain only characters chosen from "0123456789bcdefghjkmnpqrstuvwxyz" . The functions in this section enable manipulation of geohash values, which provides applications the capabilities of importing and exporting geohash data, and of indexing and searching geohash values. Unless otherwise specified, functions in this section handle their geometry arguments as follows: •If any argument is  NULL , the return value is  NULL . •If any argument is invalid, an error occurs. •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). •If any point argument does not have SRID 0 or 4326, an  ER_SRS_NOT_FOUND  error occurs.  point argument SRID validity is not checked. Ranges shown are in degrees. The exact range limits deviate slightly due to floating-point arithmetic. •If any SRID argument refers to an undefined spatial reference system (SRS), an  ER_SRS_NOT_FOUND error occurs. •If any SRID argument is not within the range of a 32-bit unsigned integer, an  ER_DATA_OUT_OF_RANGE error occurs. •Otherwise, the return value is non- NULL . These geohash functions are available: Returns a geohash string in the connection character set and collation. For the first syntax, the  longitude  must be a number in the range [ − 180, 180], and the  latitude must be a number in the range [ − 90, 90]. For the second syntax, a  POINT  value is required, where the X and Y coordinates are in the valid ranges for longitude and latitude, respectively. The resulting string is no longer than  max_length  characters, which has an upper limit of 100. The string might be shorter than  max_length  characters because the algorithm that creates the geohash value continues until it has created a string that is either an exact representation of the location or max_length  characters, whichever comes first. ST_GeoHash()  handles its arguments as described in the introduction to this section. 2333 • ST_GeoHash( longitude ,  latitude ,  max_length ) ,  ST_GeoHash( point ,  max_length )