Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
---
{
"title": "ST_XMAX",
"language": "en",
"description": "Returns the maximum X (longitude) coordinate of the bounding box of a geometry."
}
---

## Description

Returns the maximum X (longitude) coordinate of the bounding box of a geometry.

## Syntax

```sql
ST_XMAX( <geometry>)
```

## Parameters

| Parameter | Description |
|------|----------|
| `<geometry>` | The geometry object from which to extract the maximum X coordinate of the bounding box. |

## Return Value

The the maximum X coordinate of the bounding box, of type double-precision floating-point number (Double).

- Returns the maximum X coordinate of the bounding box if the input is a valid geometry object.
- Returns NULL if the input is NULL or an invalid geometry (e.g., a non-geometry string).

## Example

Extract the maximum X coordinate of the bounding box of a point

```sql
SELECT ST_XMax(ST_Point(24.7, 56.7));
```

```text
+---------------------------------+
| ST_XMax(st_point(24.7, 56.7)) |
+---------------------------------+
| 24.7 |
+---------------------------------+
```

Extract the maximum X coordinate of the bounding box of a linestring

```sql
SELECT ST_XMax(ST_LineStringFromText('LINESTRING (0 0, 4 4)'));
```

```text
+---------------------------------------------------------+
| ST_XMax(st_linestringfromtext('LINESTRING (0 0, 4 4)')) |
+---------------------------------------------------------+
| 4 |
+---------------------------------------------------------+
```

Extract the maximum X coordinate of the bounding box of a polygon

```sql
SELECT ST_XMax(ST_Polygon('POLYGON ((0 0, 4 0, 4 3, 0 3, 0 0))'));
```

```text
+------------------------------------------------------------------+
| ST_XMax(st_polygon('POLYGON ((0 0, 4 0, 4 3, 0 3, 0 0))')) |
+------------------------------------------------------------------+
| 4 |
+------------------------------------------------------------------+
```

Input is an invalid geometry

```sql
SELECT ST_XMax('not a geometry');
```

```text
+------------------------------------------+
| ST_XMax('not a geometry') |
+------------------------------------------+
| NULL |
+------------------------------------------+
```

Input is NULL

```sql
SELECT ST_XMax(NULL);
```

```text
+-------------------------+
| ST_XMax(null) |
+-------------------------+
| NULL |
+-------------------------+
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
---
{
"title": "ST_XMIN",
"language": "en",
"description": "Returns the minimum X (longitude) coordinate of the bounding box of a geometry."
}
---

## Description

Returns the minimum X (longitude) coordinate of the bounding box of a geometry.

## Syntax

```sql
ST_XMIN( <geometry>)
```

## Parameters

| Parameter | Description |
|------|----------|
| `<geometry>` | The geometry object from which to extract the minimum X coordinate of the bounding box. |

## Return Value

The the minimum X coordinate of the bounding box, of type double-precision floating-point number (Double).

- Returns the minimum X coordinate of the bounding box if the input is a valid geometry object.
- Returns NULL if the input is NULL or an invalid geometry (e.g., a non-geometry string).

## Example

Extract the minimum X coordinate of the bounding box of a point

```sql
SELECT ST_XMin(ST_Point(24.7, 56.7));
```

```text
+---------------------------------+
| ST_XMin(st_point(24.7, 56.7)) |
+---------------------------------+
| 24.7 |
+---------------------------------+
```

Extract the minimum X coordinate of the bounding box of a linestring

```sql
SELECT ST_XMin(ST_LineStringFromText('LINESTRING (0 0, 4 4)'));
```

```text
+---------------------------------------------------------+
| ST_XMin(st_linestringfromtext('LINESTRING (0 0, 4 4)')) |
+---------------------------------------------------------+
| 4 |
+---------------------------------------------------------+
```

Extract the minimum X coordinate of the bounding box of a polygon

```sql
SELECT ST_XMin(ST_Polygon('POLYGON ((0 0, 4 0, 4 3, 0 3, 0 0))'));
```

```text
+------------------------------------------------------------------+
| ST_XMin(st_polygon('POLYGON ((0 0, 4 0, 4 3, 0 3, 0 0))')) |
+------------------------------------------------------------------+
| 4 |
+------------------------------------------------------------------+
```

Input is an invalid geometry

```sql
SELECT ST_XMin('not a geometry');
```

```text
+------------------------------------------+
| ST_XMin('not a geometry') |
+------------------------------------------+
| NULL |
+------------------------------------------+
```

Input is NULL

```sql
SELECT ST_XMin(NULL);
```

```text
+-------------------------+
| ST_XMin(null) |
+-------------------------+
| NULL |
+-------------------------+
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
---
{
"title": "ST_YMAX",
"language": "en",
"description": "Returns the maximum Y (latitude) coordinate of the bounding box of a geometry."
}
---

## Description

Returns the maximum Y (latitude) coordinate of the bounding box of a geometry.

## Syntax

```sql
ST_YMAX( <geometry>)
```

## Parameters

| Parameter | Description |
|------|----------|
| `<geometry>` | The geometry object from which to extract the maximum Y coordinate of the bounding box. |

## Return Value

The the maximum Y coordinate of the bounding box, of type double-precision floating-point number (Double).

- Returns the maximum Y coordinate of the bounding box if the input is a valid geometry object.
- Returns NULL if the input is NULL or an invalid geometry (e.g., a non-geometry string).

## Example

Extract the maximum Y coordinate of the bounding box of a point

```sql
SELECT ST_YMax(ST_Point(24.7, 56.7));
```

```text
+---------------------------------+
| ST_YMax(st_point(24.7, 56.7)) |
+---------------------------------+
| 24.7 |
+---------------------------------+
```

Extract the maximum Y coordinate of the bounding box of a linestring

```sql
SELECT ST_YMax(ST_LineStringFromText('LINESTRING (0 0, 4 4)'));
```

```text
+---------------------------------------------------------+
| ST_YMax(st_linestringfromtext('LINESTRING (0 0, 4 4)')) |
+---------------------------------------------------------+
| 4 |
+---------------------------------------------------------+
```

Extract the maximum Y coordinate of the bounding box of a polygon

```sql
SELECT ST_YMax(ST_Polygon('POLYGON ((0 0, 4 0, 4 3, 0 3, 0 0))'));
```

```text
+------------------------------------------------------------------+
| ST_YMax(st_polygon('POLYGON ((0 0, 4 0, 4 3, 0 3, 0 0))')) |
+------------------------------------------------------------------+
| 4 |
+------------------------------------------------------------------+
```

Input is an invalid geometry

```sql
SELECT ST_YMax('not a geometry');
```

```text
+------------------------------------------+
| ST_YMax('not a geometry') |
+------------------------------------------+
| NULL |
+------------------------------------------+
```

Input is NULL

```sql
SELECT ST_YMax(NULL);
```

```text
+-------------------------+
| ST_YMax(null) |
+-------------------------+
| NULL |
+-------------------------+
```
Loading