Update polygon.md

Add WKT function to documentation
This commit is contained in:
Shaun Struwig 2024-03-16 02:34:45 +01:00 committed by GitHub
parent ab3bb77ef8
commit e1b2e0a00b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -4,6 +4,34 @@ sidebar_label: Polygons
title: "Functions for Working with Polygons"
---
## WKT
Returns a WKT (Well Known Text) geometric object from tuples which represent point coordinates.
**Syntax**
```sql
WKT(points)
```
**Parameters**
- `points`: a [tuple](../../data-types/tuple.md) representing coordinate point (x, y) or an [array](../../data-types/array.md) of tuples, or an array of tuple arrays.
**Returned value**
WKT (Well Known Text) geometric object.
**Example**
```sql
SELECT wkt([[(0., 0.), (10., 0.), (10., 10.), (0., 10.)], [(4., 4.), (5., 4.), (5., 5.), (4., 5.)]]);
```
```response
POLYGON((0 0,10 0,10 10,0 10,0 0),(4 4,5 4,5 5,4 5,4 4))
```
## readWKTMultiPolygon
Converts a WKT (Well Known Text) MultiPolygon into a MultiPolygon type.