All Products
Search
Document Center

ApsaraDB RDS:ST_Generalize

Last Updated:Aug 02, 2023

This topic describes the ST_Generalize function. This function aggregates a geographic grid from a high level to a low level.

Syntax

geomgrid ST_Generalize(geomgrid gridcode, integer precision);
geomgrid[] ST_Generalize(geomgrid[] gridarray, integer precision, bool degenerated default false);

Parameters

Parameter

Description

gridcode

The geographic grid object.

gridarray

The array of geographic grids.

precision

The aggregation level.

degenerated

Specifies whether to use a degenerated grid.

Description

This function aggregates a geographic grid or an array of geographic grids to a low level.

Examples

SELECT ST_AsText(ST_Generalize(ST_GridFromText('GZ0026206440'), 5));
 st_astext 
-----------
 GZ00262

SELECT ST_Generalize(ST_As3DGrid(
'srid=4490;LINESTRING Z (116 39 2000,116.012 39.009 3000)'::geometry, 10), 8);
                st_generalize                 
---------------------------------------------
 {01024008722600000000,01024008742600000000}