ES|QL ST_BUFFER function
geometry- Expression of type
geo_point,geo_shape,cartesian_pointorcartesian_shape. Ifnull, the function returnsnull. distance-
Buffer distance in the units of the input spatial reference system
Computes a buffer area around the input geometry at the specified distance. The distance is in the units of the input spatial reference system. Positive distances expand the geometry, negative distances shrink it. Points and lines become polygons when buffered.
| geometry | distance | result |
|---|---|---|
| cartesian_point | double | cartesian_shape |
| cartesian_point | float | cartesian_shape |
| cartesian_point | integer | cartesian_shape |
| cartesian_point | long | cartesian_shape |
| cartesian_shape | double | cartesian_shape |
| cartesian_shape | float | cartesian_shape |
| cartesian_shape | integer | cartesian_shape |
| cartesian_shape | long | cartesian_shape |
| geo_point | double | geo_shape |
| geo_point | float | geo_shape |
| geo_point | integer | geo_shape |
| geo_point | long | geo_shape |
| geo_shape | double | geo_shape |
| geo_shape | float | geo_shape |
| geo_shape | integer | geo_shape |
| geo_shape | long | geo_shape |
ROW wkt = "POLYGON ((0 0, 4 0, 4 4, 0 4, 0 0))"
| EVAL buffered = ST_BUFFER(TO_GEOSHAPE(wkt), -1)
| wkt:keyword | buffered:geo_shape |
|---|---|
| POLYGON ((0 0, 4 0, 4 4, 0 4, 0 0)) | POLYGON ((1.0 1.0, 1.0 3.0, 3.0 3.0, 3.0 1.0, 1.0 1.0)) |