MaxCompute provides a series of geography functions prefixed with ST_ to construct, convert, and analyze GEOGRAPHY data. With these functions, you can create geographical objects such as points, lines, and polygons from longitude and latitude coordinates or WKT/WKB input; extract properties like coordinates and bounding boxes; determine spatial relationships such as contains, intersects, and covers; and calculate the distance between geographical objects.
The following geography functions are supported:
Category | Function | Description |
Construction and parsing | Constructs a point geographical object from the specified longitude and latitude. | |
Constructs a line geographical object from the specified endpoints. | ||
Constructs a polygon geographical object from a specified outer boundary (shell) and zero or more holes. | ||
Converts a string in WKT format to a GEOGRAPHY object. | ||
Converts a BINARY value in WKB format to a GEOGRAPHY object. | ||
Formatting | Converts a GEOGRAPHY value to a BINARY value in WKB format. | |
Converts a GEOGRAPHY value to a STRING value in WKT format. | ||
Property access | Returns the bounding box of a GEOGRAPHY value. | |
Returns the longitude from a point geographical object. | ||
Returns the latitude from a point geographical object. | ||
Spatial operations | Checks if the first geographical object contains the second. | |
Checks if the first geographical object covers the second (all points of the second object are on the boundary of or within the first). | ||
Checks if two geographical objects intersect (they have at least one common point). | ||
Checks if the first geographical object is within the second. | ||
Checks if the shortest distance between two geographical objects is less than or equal to a specified distance. | ||
Calculates the shortest distance between two geographical objects, in meters. |