ES|QL TO_GEOSHAPE function
field-
Input value. The input can be a single- or multi-valued column or an expression.
Converts an input value to a geo_shape value. A string will only be successfully converted if it respects the WKT format.
| field | result |
|---|---|
| geo_point | geo_shape |
| geo_shape | geo_shape |
| geohash | geo_shape |
| geohex | geo_shape |
| geotile | geo_shape |
| keyword | geo_shape |
| text | geo_shape |
ROW wkt = "POLYGON ((30 10, 40 40, 20 40, 10 20, 30 10))"
| EVAL geom = TO_GEOSHAPE(wkt)
| wkt:keyword | geom:geo_shape |
|---|---|
| "POLYGON ((30 10, 40 40, 20 40, 10 20, 30 10))" | POLYGON ((30 10, 40 40, 20 40, 10 20, 30 10)) |