---
title: ST geospatial functions
description: The ST geospatial built-in functions for working with GEOMETRY and GEOGRAPHY values, in Databricks SQL and Databricks Runtime.
canonical_url: https://docs.databricks.com/aws/en/sql/language-manual/sql-ref-st-geospatial-functions
---

# ST geospatial functions

**Applies to:** ![check marked yes](https://docs.databricks.com/aws/en/images/icons/check.png) Databricks SQL ![check marked yes](https://docs.databricks.com/aws/en/images/icons/check.png) Databricks Runtime 17.1 and above

> [!NOTE]
> **Preview**
>
> Support for GEOGRAPHY values is in [Public Preview](https://docs.databricks.com/aws/en/release-notes/release-types.md). Support for GEOMETRY values is [generally available](https://docs.databricks.com/aws/en/release-notes/release-types.md).

ST geospatial functions operate on objects of type `GEOGRAPHY` and/or `GEOMETRY`, or allow to construct `GEOGRAPHY` and `GEOMETRY` values from standard or popular geospatial formats, or export `GEOGRAPHY` and `GEOMETRY` values to standard or popular geospatial formats.

See also:

* [Alphabetical list of ST geospatial functions](https://docs.databricks.com/aws/en/sql/language-manual/sql-ref-st-geospatial-functions-alpha.md)

## Import Databricks functions to get ST functions (Databricks Runtime)

No import needed for Databricks SQL and Spark SQL.

To import ST functions for Python or Scala in notebooks, use the following commands:

### Python

```python
from pyspark.databricks.sql import functions as dbf
```

### Scala

```scala
import com.databricks.sql.functions._
```

## List of ST geospatial functions (Databricks SQL)

### Import

| Function                                                                                                                       | Description                                                                                                                                                           |
| ------------------------------------------------------------------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [st\_geogfromewkt(ewktExpr)](https://docs.databricks.com/aws/en/sql/language-manual/functions/st_geogfromewkt.md)              | Returns a `GEOGRAPHY(ANY)` value from its EWKT representation.                                                                                                        |
| [st\_geogfromgeojson(geojsonExpr)](https://docs.databricks.com/aws/en/sql/language-manual/functions/st_geogfromgeojson.md)     | Returns a `GEOGRAPHY(4326)` value from its GeoJSON representation.                                                                                                    |
| [st\_geogfromtext(wktExpr)](https://docs.databricks.com/aws/en/sql/language-manual/functions/st_geogfromtext.md)               | Returns a `GEOGRAPHY(4326)` value from its WKT representation.                                                                                                        |
| [st\_geogfromwkb(wktExpr)](https://docs.databricks.com/aws/en/sql/language-manual/functions/st_geogfromwkb.md)                 | Returns a `GEOGRAPHY(4326)` value from its WKB representation.                                                                                                        |
| [st\_geogfromwkt(wktExpr)](https://docs.databricks.com/aws/en/sql/language-manual/functions/st_geogfromwkt.md)                 | Returns a `GEOGRAPHY(4326)` value from its WKT representation.                                                                                                        |
| [st\_geomfromewkb(wktExpr)](https://docs.databricks.com/aws/en/sql/language-manual/functions/st_geomfromewkb.md)               | Returns a `GEOMETRY(ANY)` value from its EWKB representation.                                                                                                         |
| [st\_geomfromewkt(ewktExpr)](https://docs.databricks.com/aws/en/sql/language-manual/functions/st_geomfromewkt.md)              | Returns a `GEOMETRY(ANY)` value from its EWKT representation.                                                                                                         |
| [st\_geomfromgeohash(geohashExpr)](https://docs.databricks.com/aws/en/sql/language-manual/functions/st_geomfromgeohash.md)     | Returns the geohash grid box corresponding to the input geohash value as a 2D polygon `GEOMETRY` value.                                                               |
| [st\_geomfromgeojson(geojsonExpr)](https://docs.databricks.com/aws/en/sql/language-manual/functions/st_geomfromgeojson.md)     | Returns a `GEOMETRY(4326)` value from its GeoJSON representation.                                                                                                     |
| [st\_geomfromtext(wktExpr\[, sridExpr\])](https://docs.databricks.com/aws/en/sql/language-manual/functions/st_geomfromtext.md) | Returns a `GEOMETRY(srid)` or `GEOMETRY(ANY)` value from its WKT representation, and sets its SRID value to the value of `sridExpr`, or `0` if `sridExpr` is omitted. |
| [st\_geomfromwkb(wkbExpr\[, sridExpr\])](https://docs.databricks.com/aws/en/sql/language-manual/functions/st_geomfromwkb.md)   | Returns a `GEOMETRY(srid)` or `GEOMETRY(ANY)` value from its WKB representation, and sets its SRID value to the value of `sridExpr`, or `0` if `sridExpr` is omitted. |
| [st\_geomfromwkt(wktExpr\[, sridExpr\])](https://docs.databricks.com/aws/en/sql/language-manual/functions/st_geomfromwkt.md)   | Returns a `GEOMETRY(srid)` or `GEOMETRY(ANY)` value from its WKT representation, and sets its SRID value to the value of `sridExpr`, or `0` if `sridExpr` is omitted. |
| [st\_pointfromgeohash(geohash)](https://docs.databricks.com/aws/en/sql/language-manual/functions/st_pointfromgeohash.md)       | Returns the center of the geohash grid box corresponding to the input geohash value as a 2D point geometry.                                                           |
| [to\_geography(georepExpr)](https://docs.databricks.com/aws/en/sql/language-manual/functions/to_geography.md)                  | Returns a `GEOGRAPHY(ANY)` value from its GeoJSON, WKB, or WKT representation.                                                                                        |
| [to\_geometry(georepExpr)](https://docs.databricks.com/aws/en/sql/language-manual/functions/to_geometry.md)                    | Returns a `GEOMETRY(ANY)` value from its EWKB, GeoJSON, WKB, or WKT representation.                                                                                   |
| [try\_to\_geography(georepExpr)](https://docs.databricks.com/aws/en/sql/language-manual/functions/try_to_geography.md)         | Returns a `GEOGRAPHY(ANY)` value from its GeoJSON, WKB, or WKT representation, or `NULL` if the input representation is invalid.                                      |
| [try\_to\_geometry(georepExpr)](https://docs.databricks.com/aws/en/sql/language-manual/functions/try_to_geometry.md)           | Returns a `GEOMETRY(ANY)` value from its EWKB, GeoJSON, WKB, or WKT representation, or `NULL` if the input representation is invalid.                                 |

### Export

| Function                                                                                                                   | Description                                                                                          |
| -------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- |
| [st\_asbinary(geoExpr)](https://docs.databricks.com/aws/en/sql/language-manual/functions/st_asbinary.md)                   | Returns the WKB representation of the input `GEOGRAPHY` or `GEOMETRY` value as a `BINARY` value.     |
| [st\_asewkb(geoExpr)](https://docs.databricks.com/aws/en/sql/language-manual/functions/st_asewkb.md)                       | Returns the EWKB representation of the input `GEOMETRY` value as a `BINARY` value.                   |
| [st\_asgeojson(geoExpr)](https://docs.databricks.com/aws/en/sql/language-manual/functions/st_asgeojson.md)                 | Returns the GeoJSON representation of the input `GEOGRAPHY` or `GEOMETRY` value as a `STRING` value. |
| [st\_asewkt(geoExpr)](https://docs.databricks.com/aws/en/sql/language-manual/functions/st_asewkt.md)                       | Returns the EWKT representation of the input `GEOGRAPHY` or `GEOMETRY` value as a `STRING` value.    |
| [st\_astext(geoExpr)](https://docs.databricks.com/aws/en/sql/language-manual/functions/st_astext.md)                       | Returns the WKT representation of the input `GEOGRAPHY` or `GEOMETRY` value as a `STRING` value.     |
| [st\_aswkb(geoExpr)](https://docs.databricks.com/aws/en/sql/language-manual/functions/st_aswkb.md)                         | Returns the WKB representation of the input `GEOGRAPHY` or `GEOMETRY` value as a `BINARY` value.     |
| [st\_aswkt(geoExpr)](https://docs.databricks.com/aws/en/sql/language-manual/functions/st_aswkt.md)                         | Returns the WKT representation of the input `GEOGRAPHY` or `GEOMETRY` value as a `STRING` value.     |
| [st\_geohash(geoExpr \[, precisionExpr\])](https://docs.databricks.com/aws/en/sql/language-manual/functions/st_geohash.md) | Returns the geohash of the input geometry at the given precision.                                    |

### Measurements

| Function                                                                                                                            | Description                                                                                                                                                  |
| ----------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| [st\_area(geoExpr)](https://docs.databricks.com/aws/en/sql/language-manual/functions/st_area.md)                                    | Returns the area of the input `GEOGRAPHY` or `GEOMETRY` value.                                                                                               |
| [st\_azimuth(geoExpr1, geoExpr2)](https://docs.databricks.com/aws/en/sql/language-manual/functions/st_azimuth.md)                   | Returns the north-based azimuth from the first point to the second in radians in `[0, 2π)`.                                                                  |
| [st\_closestpoint(geoExpr1, geoExpr2)](https://docs.databricks.com/aws/en/sql/language-manual/functions/st_closestpoint.md)         | Returns the 2D projection of a point on the first `GEOMETRY` value that is closest to the second `GEOMETRY` value with respect to the Euclidean distance.    |
| [st\_distance(geoExpr1, geoExpr2)](https://docs.databricks.com/aws/en/sql/language-manual/functions/st_distance.md)                 | Returns the 2D Cartesian distance between the two input `GEOMETRY` values.                                                                                   |
| [st\_distancesphere(geoExpr1, geoExpr2)](https://docs.databricks.com/aws/en/sql/language-manual/functions/st_distancesphere.md)     | Returns the spherical distance (in meters) between two point `GEOMETRY` values, measured on a sphere whose radius is the mean radius of the WGS84 ellipsoid. |
| [st\_distancespheroid(geoExpr1, geoExpr2)](https://docs.databricks.com/aws/en/sql/language-manual/functions/st_distancespheroid.md) | Returns the geodesic distance (in meters) between two point `GEOMETRY` values on the WGS84 ellipsoid.                                                        |
| [st\_length(geoExpr)](https://docs.databricks.com/aws/en/sql/language-manual/functions/st_length.md)                                | Returns the length of the input `GEOGRAPHY` or `GEOMETRY` value.                                                                                             |
| [st\_perimeter(geoExpr)](https://docs.databricks.com/aws/en/sql/language-manual/functions/st_perimeter.md)                          | Returns the perimeter of the input `GEOGRAPHY` or `GEOMETRY` value.                                                                                          |

### Constructors

| Function                                                                                                                     | Description                                                                                                                                                                                   |
| ---------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [st\_collect(geoArray)](https://docs.databricks.com/aws/en/sql/language-manual/functions/st_collect.md)                      | Collects an array of `GEOGRAPHY` or `GEOMETRY` values into a single multi-geospatial or geometry collection value.                                                                            |
| [st\_collect\_agg(geoCol)](https://docs.databricks.com/aws/en/sql/language-manual/functions/st_collect_agg.md)               | Collects the `GEOGRAPHY` or `GEOMETRY` values in the column into a single multi-geospatial or geometry collection value, or `NULL` if the column has zero rows or only `NULL` values.         |
| [st\_makeenvelope(x1, y1, x2, y2)](https://docs.databricks.com/aws/en/sql/language-manual/functions/st_makeenvelope.md)      | Returns a `GEOMETRY` value representing the 2D axis-aligned envelope (minimum bounding box) defined by the two corner coordinates `(x1, y1)` and `(x2, y2)`.                                  |
| [st\_makeline(geoArray)](https://docs.databricks.com/aws/en/sql/language-manual/functions/st_makeline.md)                    | Returns a linestring `GEOMETRY` value whose points are the non-empty points of the geometries in the input array of geometries, which are expected to be points, linestrings, or multipoints. |
| [st\_makepoint(x, y\[, z\[, m\]\])](https://docs.databricks.com/aws/en/sql/language-manual/functions/st_makepoint.md)        | Returns a point `GEOMETRY` value with the given coordinates and SRID 0. The function takes 2, 3, or 4 `DOUBLE` values, representing the (x, y), (x, y, z), or (x, y, z, m) coordinates.       |
| [st\_makepolygon(outer\[, innerArray\])](https://docs.databricks.com/aws/en/sql/language-manual/functions/st_makepolygon.md) | Constructs a polygon `GEOMETRY` value from the input outer boundary and optional array of inner boundaries, represented as closed linestrings.                                                |
| [st\_point(x, y \[, srid\])](https://docs.databricks.com/aws/en/sql/language-manual/functions/st_point.md)                   | Returns a point `GEOMETRY` value with the given X and Y coordinates and SRID value (if provided).                                                                                             |

### Accessors

| Function                                                                                                                      | Description                                                                                                                             |
| ----------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- |
| [st\_dimension(geoExpr)](https://docs.databricks.com/aws/en/sql/language-manual/functions/st_dimension.md)                    | Returns the topological dimension of the 2D projection of the `GEOMETRY` value.                                                         |
| [st\_dump(geoExpr)](https://docs.databricks.com/aws/en/sql/language-manual/functions/st_dump.md)                              | Returns an array containing the single geometries in the input geometry.                                                                |
| [st\_endpoint(geoExpr)](https://docs.databricks.com/aws/en/sql/language-manual/functions/st_endpoint.md)                      | Returns the last point of the input `GEOGRAPHY` or `GEOMETRY` value, if the input geospatial value is a non-empty linestring.           |
| [st\_envelope(geoExpr)](https://docs.databricks.com/aws/en/sql/language-manual/functions/st_envelope.md)                      | Returns a 2D Cartesian `GEOMETRY` value representing the 2D axis-aligned minimum bounding box (envelope) of the input `GEOMETRY` value. |
| [st\_envelope\_agg(geoCol)](https://docs.databricks.com/aws/en/sql/language-manual/functions/st_envelope_agg.md)              | Returns the envelope of all the geometries in the column, or `NULL` if the column has zero rows, or contains only `NULL` values.        |
| [st\_exteriorring(geoExpr)](https://docs.databricks.com/aws/en/sql/language-manual/functions/st_exteriorring.md)              | Returns the exterior ring of the input polygon `GEOGRAPHY` or `GEOMETRY` as a linestring.                                               |
| [st\_geometryn(geoExpr, nExpr)](https://docs.databricks.com/aws/en/sql/language-manual/functions/st_geometryn.md)             | Returns the 1-based n-th element of the input `GEOMETRY` value as a `GEOMETRY` value.                                                   |
| [st\_geometrytype(geoExpr)](https://docs.databricks.com/aws/en/sql/language-manual/functions/st_geometrytype.md)              | Returns the type of the input `GEOGRAPHY` or `GEOMETRY` value as a string.                                                              |
| [st\_interiorringn(geoExpr, indexExpr)](https://docs.databricks.com/aws/en/sql/language-manual/functions/st_interiorringn.md) | Returns the n-th interior ring of the input polygon `GEOGRAPHY` or `GEOMETRY` as a linestring.                                          |
| [st\_isempty(geoExpr)](https://docs.databricks.com/aws/en/sql/language-manual/functions/st_isempty.md)                        | Returns true if the input `GEOGRAPHY` or `GEOMETRY` value does not contain any non-empty points.                                        |
| [st\_m(geoExpr)](https://docs.databricks.com/aws/en/sql/language-manual/functions/st_m.md)                                    | Returns the M coordinate of the input point `GEOMETRY` value, or NULL if the point is empty or does not have an M coordinate.           |
| [st\_ndims(geoExpr)](https://docs.databricks.com/aws/en/sql/language-manual/functions/st_ndims.md)                            | Returns the coordinate dimension of the input `GEOGRAPHY` or `GEOMETRY` value.                                                          |
| [st\_npoints(geoExpr)](https://docs.databricks.com/aws/en/sql/language-manual/functions/st_npoints.md)                        | Returns the number of non-empty points in the input `GEOGRAPHY` or `GEOMETRY` value.                                                    |
| [st\_nrings(geoExpr)](https://docs.databricks.com/aws/en/sql/language-manual/functions/st_nrings.md)                          | Returns the total number of rings of the input polygon or multipolygon `GEOGRAPHY` or `GEOMETRY` value.                                 |
| [st\_numgeometries(geoExpr)](https://docs.databricks.com/aws/en/sql/language-manual/functions/st_numgeometries.md)            | Returns the number of geometries in the input `GEOMETRY` value.                                                                         |
| [st\_numpoints(geoExpr)](https://docs.databricks.com/aws/en/sql/language-manual/functions/st_numpoints.md)                    | Returns the number of non-empty points in the input `GEOGRAPHY` or `GEOMETRY` value.                                                    |
| [st\_numinteriorrings(geoExpr)](https://docs.databricks.com/aws/en/sql/language-manual/functions/st_numinteriorrings.md)      | Returns the number of interior rings in the input polygon `GEOGRAPHY` or `GEOMETRY` value.                                              |
| [st\_pointn(geoExpr, indexExpr)](https://docs.databricks.com/aws/en/sql/language-manual/functions/st_pointn.md)               | Returns the n-th point from the input linestring `GEOGRAPHY` or `GEOMETRY` value.                                                       |
| [st\_startpoint(geoExpr)](https://docs.databricks.com/aws/en/sql/language-manual/functions/st_startpoint.md)                  | Returns the first point of the input `GEOGRAPHY` or `GEOMETRY` value, if the input geospatial value is a non-empty linestring.          |
| [st\_x(geoExpr)](https://docs.databricks.com/aws/en/sql/language-manual/functions/st_x.md)                                    | Returns the X coordinate of the input point `GEOMETRY` value, or `NULL` if the point is empty.                                          |
| [st\_xmax(geoExpr)](https://docs.databricks.com/aws/en/sql/language-manual/functions/st_xmax.md)                              | Returns the maximum X coordinate of the input `GEOMETRY` value, or `NULL` if the geometry is empty.                                     |
| [st\_xmin(geoExpr)](https://docs.databricks.com/aws/en/sql/language-manual/functions/st_xmin.md)                              | Returns the minimum X coordinate of the input `GEOMETRY` value, or `NULL` if the geometry is empty.                                     |
| [st\_y(geoExpr)](https://docs.databricks.com/aws/en/sql/language-manual/functions/st_y.md)                                    | Returns the Y coordinate of the input point `GEOMETRY` value, or `NULL` if the point is empty.                                          |
| [st\_ymax(geoExpr)](https://docs.databricks.com/aws/en/sql/language-manual/functions/st_ymax.md)                              | Returns the maximum Y coordinate of the input `GEOMETRY` value, or `NULL` if the geometry is empty.                                     |
| [st\_ymin(geoExpr)](https://docs.databricks.com/aws/en/sql/language-manual/functions/st_ymin.md)                              | Returns the minimum Y coordinate of the input `GEOMETRY` value, or `NULL` if the geometry is empty.                                     |
| [st\_z(geoExpr)](https://docs.databricks.com/aws/en/sql/language-manual/functions/st_z.md)                                    | Returns the Z coordinate of the input point `GEOMETRY` value, or `NULL` if the point is empty or does not have a Z coordinate.          |
| [st\_zmax(geoExpr)](https://docs.databricks.com/aws/en/sql/language-manual/functions/st_zmax.md)                              | Returns the maximum Z coordinate of the input `GEOMETRY` value, or `NULL` if the geometry is empty or does not have a Z coordinate.     |
| [st\_zmin(geoExpr)](https://docs.databricks.com/aws/en/sql/language-manual/functions/st_zmin.md)                              | Returns the minimum Z coordinate of the input `GEOMETRY` value, or `NULL` if the geometry is empty or does not have a Z coordinate.     |

### Editors

| Function                                                                                                                           | Description                                                                                    |
| ---------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- |
| [st\_addpoint(geo1Expr, geo2Expr\[, indexExpr\])](https://docs.databricks.com/aws/en/sql/language-manual/functions/st_addpoint.md) | Adds a new point to the n-th position in the input linestring `GEOGRAPHY` or `GEOMETRY` value. |
| [st\_flipcoordinates(geoExpr)](https://docs.databricks.com/aws/en/sql/language-manual/functions/st_flipcoordinates.md)             | Swaps X and Y coordinates of the input `GEOMETRY` value.                                       |
| [st\_force2d(geoExpr)](https://docs.databricks.com/aws/en/sql/language-manual/functions/st_force2d.md)                             | Returns the 2D projection of the input `GEOGRAPHY` or `GEOMETRY` value.                        |
| [st\_multi(geoExpr)](https://docs.databricks.com/aws/en/sql/language-manual/functions/st_multi.md)                                 | Returns the input `GEOGRAPHY` or `GEOMETRY` value as an equivalent multi-geospatial value.     |
| [st\_removepoint(geoExpr, indexExpr)](https://docs.databricks.com/aws/en/sql/language-manual/functions/st_removepoint.md)          | Removes the n-th point from the input linestring `GEOGRAPHY` or `GEOMETRY` value.              |
| [st\_reverse(geoExpr)](https://docs.databricks.com/aws/en/sql/language-manual/functions/st_reverse.md)                             | Reverses the input `GEOGRAPHY` or `GEOMETRY` value.                                            |
| [st\_setpoint(geo1Expr, indexExpr, geo2Expr)](https://docs.databricks.com/aws/en/sql/language-manual/functions/st_setpoint.md)     | Sets the n-th point of the input linestring `GEOGRAPHY` or `GEOMETRY` value.                   |

### Geometry Validation

| Function                                                                                               | Description                                                                      |
| ------------------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------------- |
| [st\_isvalid(geoExpr)](https://docs.databricks.com/aws/en/sql/language-manual/functions/st_isvalid.md) | Returns true if the input `GEOMETRY` value is a valid geometry in the OGC sense. |

### Spatial Reference System Functions

| Function                                                                                                         | Description                                                                                                                                                                      |
| ---------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [st\_estimatesrid(geoExpr)](https://docs.databricks.com/aws/en/sql/language-manual/functions/st_estimatesrid.md) | Returns the best projected spatial reference identifier (SRID) for the center of the bounding box of the input `GEOMETRY` value.                                                 |
| [st\_setsrid(geo, srid)](https://docs.databricks.com/aws/en/sql/language-manual/functions/st_setsrid.md)         | Returns a new `GEOMETRY` value whose SRID is the specified SRID value.                                                                                                           |
| [st\_srid(geoExpr)](https://docs.databricks.com/aws/en/sql/language-manual/functions/st_srid.md)                 | Returns the SRID of the input `GEOGRAPHY` or `GEOMETRY` value.                                                                                                                   |
| [st\_transform(geo, srid)](https://docs.databricks.com/aws/en/sql/language-manual/functions/st_transform.md)     | Transforms the X and Y coordinates of the input `GEOMETRY` from the current coordinate reference system to the coordinate reference system described by the provided SRID value. |

### Distance Relationships

| Function                                                                                                                        | Description                                                                                                                             |
| ------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- |
| [st\_dwithin(geoExpr1, geoExpr2, distanceExpr)](https://docs.databricks.com/aws/en/sql/language-manual/functions/st_dwithin.md) | Returns true if the 2D Cartesian distance between the two input `GEOMETRY` values is smaller than or equal to the input distance value. |

### Topological Relationships

| Function                                                                                                                | Description                                                                                                             |
| ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- |
| [st\_contains(geo1, geo2)](https://docs.databricks.com/aws/en/sql/language-manual/functions/st_contains.md)             | Returns true if the first `GEOMETRY` value contains the second `GEOMETRY` value.                                        |
| [st\_covers(geoExpr1, geoExpr2)](https://docs.databricks.com/aws/en/sql/language-manual/functions/st_covers.md)         | Returns true if the first `GEOMETRY` value covers the second `GEOMETRY` value.                                          |
| [st\_crosses(geo1, geo2)](https://docs.databricks.com/aws/en/sql/language-manual/functions/st_crosses.md)               | Returns true if the two input `GEOMETRY` values cross each other.                                                       |
| [st\_disjoint(geoExpr1, geoExpr2)](https://docs.databricks.com/aws/en/sql/language-manual/functions/st_disjoint.md)     | Returns `true` if the two input `GEOMETRY` values are disjoint.                                                         |
| [st\_equals(geoExpr1, geoExpr2)](https://docs.databricks.com/aws/en/sql/language-manual/functions/st_equals.md)         | Returns true if the two input `GEOMETRY` values are geometrically equal, meaning they correspond to the same point set. |
| [st\_intersects(geoExpr1, geoExpr2)](https://docs.databricks.com/aws/en/sql/language-manual/functions/st_intersects.md) | Returns true if the two input `GEOMETRY` values intersect.                                                              |
| [st\_overlaps(geo1, geo2)](https://docs.databricks.com/aws/en/sql/language-manual/functions/st_overlaps.md)             | Returns true if the two input `GEOMETRY` values overlap each other.                                                     |
| [st\_touches(geo1, geo2)](https://docs.databricks.com/aws/en/sql/language-manual/functions/st_touches.md)               | Returns true if the two input `GEOMETRY` values touch each other.                                                       |
| [st\_within(geo1, geo2)](https://docs.databricks.com/aws/en/sql/language-manual/functions/st_within.md)                 | Returns true if the first `GEOMETRY` value is within the second `GEOMETRY` value.                                       |

### Overlay Functions

| Function                                                                                                                    | Description                                                                                                                              |
| --------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- |
| [st\_difference(geoExpr1, geoExpr2)](https://docs.databricks.com/aws/en/sql/language-manual/functions/st_difference.md)     | Returns the point-set difference of the two input `GEOMETRY` values as a 2D `GEOMETRY` value.                                            |
| [st\_intersection(geoExpr1, geoExpr2)](https://docs.databricks.com/aws/en/sql/language-manual/functions/st_intersection.md) | Returns the point-set intersection of the two input `GEOMETRY` values as a 2D `GEOMETRY` value.                                          |
| [st\_union(geo1, geo2)](https://docs.databricks.com/aws/en/sql/language-manual/functions/st_union.md)                       | Returns the point-set union of the two input `GEOMETRY` values as a 2D geometry.                                                         |
| [st\_union\_agg(geoCol)](https://docs.databricks.com/aws/en/sql/language-manual/functions/st_union_agg.md)                  | Returns the point-wise union of all the geometries in the column, or `NULL` if the column has zero rows, or contains only `NULL` values. |

### Affine Transformations

| Function                                                                                                                                  | Description                                                                                                        |
| ----------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------ |
| [st\_rotate(geoExpr, rotationAngle)](https://docs.databricks.com/aws/en/sql/language-manual/functions/st_rotate.md)                       | Rotates the input `GEOMETRY` value around the Z axis by the given rotation angle (in radians).                     |
| [st\_scale(geoExpr, xfactor, yfactor\[, zfactor\])](https://docs.databricks.com/aws/en/sql/language-manual/functions/st_scale.md)         | Scales the input `GEOMETRY` value in the X, Y, and, if specified, Z directions using the provided scaling factors. |
| [st\_translate(geoExpr, xoffset, yoffset\[, zoffset\])](https://docs.databricks.com/aws/en/sql/language-manual/functions/st_translate.md) | Translates the input `GEOMETRY` value in the X, Y, and, if specified, Z directions using the provided offsets.     |

### Geometry Processing

| Function                                                                                                                                            | Description                                                                                                    |
| --------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- |
| [st\_boundary(geoExpr)](https://docs.databricks.com/aws/en/sql/language-manual/functions/st_boundary.md)                                            | Returns a `GEOMETRY` value representing the boundary of the input `GEOMETRY` value.                            |
| [st\_buffer(geoExpr, radiusExpr)](https://docs.databricks.com/aws/en/sql/language-manual/functions/st_buffer.md)                                    | Returns the buffer of the input `GEOMETRY` value using the specified radius.                                   |
| [st\_centroid(geoExpr)](https://docs.databricks.com/aws/en/sql/language-manual/functions/st_centroid.md)                                            | Returns the centroid of the input `GEOMETRY` value as a 2D point `GEOMETRY` value.                             |
| [st\_concavehull(geoExpr, lengthRatioExpr\[, allowHolesExpr\])](https://docs.databricks.com/aws/en/sql/language-manual/functions/st_concavehull.md) | Returns the concave hull of the input `GEOMETRY` value as a `GEOMETRY` value using the specified length ratio. |
| [st\_convexhull(geoExpr)](https://docs.databricks.com/aws/en/sql/language-manual/functions/st_convexhull.md)                                        | Returns the convex hull of the input `GEOMETRY` value as a `GEOMETRY` value.                                   |
| [st\_pointonsurface(geoExpr)](https://docs.databricks.com/aws/en/sql/language-manual/functions/st_pointonsurface.md)                                | Returns a point that is guaranteed to lie on or inside the input `GEOMETRY` value.                             |
| [st\_simplify(geo, tolerance)](https://docs.databricks.com/aws/en/sql/language-manual/functions/st_simplify.md)                                     | Simplifies the input `GEOMETRY` value using the Douglas-Peucker algorithm.                                     |
