All Products
Search
Document Center

PolarDB:ST_patchAvg

Last Updated:Mar 28, 2026

Computes the average value of each attribute dimension across all pcpoint objects in a pcpatch, and returns a new pcpoint whose dimensions are set to those averages.

Syntax

pcpoint ST_patchAvg(pcpatch pc);

Parameters

ParameterDescription
pcThe pcpatch object to aggregate.

Examples

SELECT ST_AsText(ST_PatchAvg(pa)) FROM patches WHERE id = 7;

Output:

{"pcid":1,"pt":[-126.46,45.54,54.5,5]}