ES|QL ST_CENTROID_AGG function
field
Calculate the spatial centroid over a field with spatial geometry type. Supports geo_point and cartesian_point, as well as geo_shape and cartesian_shape
| field | result |
|---|---|
| cartesian_point | cartesian_point |
| cartesian_shape
|
cartesian_point |
| geo_point | geo_point |
| geo_shape
|
geo_point |
FROM airports
| STATS centroid=ST_CENTROID_AGG(location)
| centroid:geo_point |
|---|
| POINT(-0.030548143003023033 24.37553649504829) |