All Products
Search
Document Center

MaxCompute:Geography functions

Last Updated:Aug 26, 2026

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


ST_GEOGPOINT

Constructs a point geographical object from the specified longitude and latitude.

ST_MAKELINE

Constructs a line geographical object from the specified endpoints.

ST_MAKEPOLYGON

Constructs a polygon geographical object from a specified outer boundary (shell) and zero or more holes.

ST_GEOGFROMTEXT

Converts a string in WKT format to a GEOGRAPHY object.

ST_GEOGFROMWKB

Converts a BINARY value in WKB format to a GEOGRAPHY object.

Formatting

ST_ASBINARY

Converts a GEOGRAPHY value to a BINARY value in WKB format.

ST_ASTEXT

Converts a GEOGRAPHY value to a STRING value in WKT format.

Property access

ST_BOUNDINGBOX

Returns the bounding box of a GEOGRAPHY value.

ST_X

Returns the longitude from a point geographical object.

ST_Y

Returns the latitude from a point geographical object.

Spatial operations


ST_CONTAINS

Checks if the first geographical object contains the second.

ST_COVERS

Checks if the first geographical object covers the second (all points of the second object are on the boundary of or within the first).

ST_INTERSECTS

Checks if two geographical objects intersect (they have at least one common point).

ST_WITHIN

Checks if the first geographical object is within the second.

ST_DWITHIN

Checks if the shortest distance between two geographical objects is less than or equal to a specified distance.

ST_DISTANCE

Calculates the shortest distance between two geographical objects, in meters.