All Products
Search
Document Center

PolarDB:ST_AsBox

Last Updated:Mar 28, 2026

Returns the bounding box of a geomgrid object as a PostgreSQL box type.

Syntax

box   ST_AsBox(geomgrid grid);
box[] ST_AsBox(geomgrid[] grid);

Parameters

ParameterTypeDescription
gridgeomgridThe grid whose bounding box you want to get.

Return value

  • The scalar form returns a box value.

  • The array form returns a box[] value.

Examples

Single grid

Get the bounding box of a grid specified by its text encoding:

SELECT ST_AsBox(ST_GridFromText('G0013103220310313'));

Output:

                                   st_asbox
------------------------------------------------------------------------------
 (116.46666666666667,39.31666666666667),(116.4588888888889,39.30888888888889)

See also