# Chalk SQL Reference: Geometry Functions
source: https://docs.chalk.ai/chalksql-docs#section-geometry-functions

## `geometry_as_geojson(geometry)`
source: https://docs.chalk.ai/chalksql-docs#geometry_as_geojson

Geospatial (Presto-flavored Velox `geometry` function).

**Parameters**

- `geometry`: `large_binary`
  The input `geometry`, as WKB.

## `geometry_from_geojson(geojson)`
source: https://docs.chalk.ai/chalksql-docs#geometry_from_geojson

Geospatial (Presto-flavored Velox geometry function).

**Parameters**

- `geojson`: `large_string`
  The geometry as a GeoJSON string.

## `geometry_nearest_points(geometry1, geometry2)`
source: https://docs.chalk.ai/chalksql-docs#geometry_nearest_points

Geospatial (Presto-flavored Velox geometry function).

**Parameters**

- `geometry1`: `large_binary`
  The first input geometry, as WKB.
- `geometry2`: `large_binary`
  The second input geometry, as WKB.

## `st_area(geometry)`
source: https://docs.chalk.ai/chalksql-docs#st_area

Geospatial (Presto-flavored Velox `geometry` function).

**Parameters**

- `geometry`: `large_binary`
  The input `geometry`, as WKB.

## `st_astext(geometry)`
source: https://docs.chalk.ai/chalksql-docs#st_astext

Geospatial (Presto-flavored Velox `geometry` function).

**Parameters**

- `geometry`: `large_binary`
  The input `geometry`, as WKB.

## `st_boundary(geometry)`
source: https://docs.chalk.ai/chalksql-docs#st_boundary

Geospatial (Presto-flavored Velox `geometry` function).

**Parameters**

- `geometry`: `large_binary`
  The input `geometry`, as WKB.

## `st_buffer(geometry, distance)`
source: https://docs.chalk.ai/chalksql-docs#st_buffer

Geospatial (Presto-flavored Velox `geometry` function).

**Parameters**

- `geometry`: `large_binary`
  The input `geometry`, as WKB.
- `distance`: `double`
  The buffer `distance`.

## `st_centroid(geometry)`
source: https://docs.chalk.ai/chalksql-docs#st_centroid

Geospatial (Presto-flavored Velox `geometry` function).

**Parameters**

- `geometry`: `large_binary`
  The input `geometry`, as WKB.

## `st_contains(geometry1, geometry2)`
source: https://docs.chalk.ai/chalksql-docs#st_contains

Geospatial (Presto-flavored Velox geometry function).

**Parameters**

- `geometry1`: `large_binary`
  The first input geometry, as WKB.
- `geometry2`: `large_binary`
  The second input geometry, as WKB.

## `st_convexhull(geometry)`
source: https://docs.chalk.ai/chalksql-docs#st_convexhull

Geospatial (Presto-flavored Velox `geometry` function).

**Parameters**

- `geometry`: `large_binary`
  The input `geometry`, as WKB.

## `st_crosses(geometry1, geometry2)`
source: https://docs.chalk.ai/chalksql-docs#st_crosses

Geospatial (Presto-flavored Velox geometry function).

**Parameters**

- `geometry1`: `large_binary`
  The first input geometry, as WKB.
- `geometry2`: `large_binary`
  The second input geometry, as WKB.

## `st_difference(geometry1, geometry2)`
source: https://docs.chalk.ai/chalksql-docs#st_difference

Geospatial (Presto-flavored Velox geometry function).

**Parameters**

- `geometry1`: `large_binary`
  The first input geometry, as WKB.
- `geometry2`: `large_binary`
  The second input geometry, as WKB.

## `st_dimension(geometry)`
source: https://docs.chalk.ai/chalksql-docs#st_dimension

Geospatial (Presto-flavored Velox `geometry` function).

**Parameters**

- `geometry`: `large_binary`
  The input `geometry`, as WKB.

## `st_disjoint(geometry1, geometry2)`
source: https://docs.chalk.ai/chalksql-docs#st_disjoint

Geospatial (Presto-flavored Velox geometry function).

**Parameters**

- `geometry1`: `large_binary`
  The first input geometry, as WKB.
- `geometry2`: `large_binary`
  The second input geometry, as WKB.

## `st_distance(geometry1, geometry2)`
source: https://docs.chalk.ai/chalksql-docs#st_distance

Geospatial (Presto-flavored Velox geometry function).

**Parameters**

- `geometry1`: `large_binary`
  The first input geometry, as WKB.
- `geometry2`: `large_binary`
  The second input geometry, as WKB.

## `st_endpoint(geometry)`
source: https://docs.chalk.ai/chalksql-docs#st_endpoint

Geospatial (Presto-flavored Velox `geometry` function).

**Parameters**

- `geometry`: `large_binary`
  The input `geometry`, as WKB.

## `st_envelope(geometry)`
source: https://docs.chalk.ai/chalksql-docs#st_envelope

Geospatial (Presto-flavored Velox `geometry` function).

**Parameters**

- `geometry`: `large_binary`
  The input `geometry`, as WKB.

## `st_envelopeaspts(geometry)`
source: https://docs.chalk.ai/chalksql-docs#st_envelopeaspts

Geospatial (Presto-flavored Velox `geometry` function).

**Parameters**

- `geometry`: `large_binary`
  The input `geometry`, as WKB.

## `st_equals(geometry1, geometry2)`
source: https://docs.chalk.ai/chalksql-docs#st_equals

Geospatial (Presto-flavored Velox geometry function).

**Parameters**

- `geometry1`: `large_binary`
  The first input geometry, as WKB.
- `geometry2`: `large_binary`
  The second input geometry, as WKB.

## `st_exteriorring(geometry)`
source: https://docs.chalk.ai/chalksql-docs#st_exteriorring

Geospatial (Presto-flavored Velox `geometry` function).

**Parameters**

- `geometry`: `large_binary`
  The input `geometry`, as WKB.

## `st_geometries(geometry)`
source: https://docs.chalk.ai/chalksql-docs#st_geometries

Geospatial (Presto-flavored Velox `geometry` function).

**Parameters**

- `geometry`: `large_binary`
  The input `geometry`, as WKB.

## `st_geometryfromtext(wkt)`
source: https://docs.chalk.ai/chalksql-docs#st_geometryfromtext

Geospatial (Presto-flavored Velox geometry function).

**Parameters**

- `wkt`: `large_string`
  The geometry in WKT format.

## `st_geometryn(geometry, index)`
source: https://docs.chalk.ai/chalksql-docs#st_geometryn

Geospatial (Presto-flavored Velox `geometry` function).

**Parameters**

- `geometry`: `large_binary`
  The input `geometry`, as WKB.
- `index`: `int32`
  The `index` to read.

## `st_geometrytype(geometry)`
source: https://docs.chalk.ai/chalksql-docs#st_geometrytype

Geospatial (Presto-flavored Velox `geometry` function).

**Parameters**

- `geometry`: `large_binary`
  The input `geometry`, as WKB.

## `st_interiorringn(geometry, index)`
source: https://docs.chalk.ai/chalksql-docs#st_interiorringn

Geospatial (Presto-flavored Velox `geometry` function).

**Parameters**

- `geometry`: `large_binary`
  The input `geometry`, as WKB.
- `index`: `int32`
  The `index` to read.

## `st_interiorrings(geometry)`
source: https://docs.chalk.ai/chalksql-docs#st_interiorrings

Geospatial (Presto-flavored Velox `geometry` function).

**Parameters**

- `geometry`: `large_binary`
  The input `geometry`, as WKB.

## `st_intersection(geometry1, geometry2)`
source: https://docs.chalk.ai/chalksql-docs#st_intersection

Geospatial (Presto-flavored Velox geometry function).

**Parameters**

- `geometry1`: `large_binary`
  The first input geometry, as WKB.
- `geometry2`: `large_binary`
  The second input geometry, as WKB.

## `st_intersects(geometry1, geometry2)`
source: https://docs.chalk.ai/chalksql-docs#st_intersects

Geospatial (Presto-flavored Velox geometry function).

**Parameters**

- `geometry1`: `large_binary`
  The first input geometry, as WKB.
- `geometry2`: `large_binary`
  The second input geometry, as WKB.

## `st_isclosed(geometry)`
source: https://docs.chalk.ai/chalksql-docs#st_isclosed

Geospatial (Presto-flavored Velox `geometry` function).

**Parameters**

- `geometry`: `large_binary`
  The input `geometry`, as WKB.

## `st_isempty(geometry)`
source: https://docs.chalk.ai/chalksql-docs#st_isempty

Geospatial (Presto-flavored Velox `geometry` function).

**Parameters**

- `geometry`: `large_binary`
  The input `geometry`, as WKB.

## `st_isring(geometry)`
source: https://docs.chalk.ai/chalksql-docs#st_isring

Geospatial (Presto-flavored Velox `geometry` function).

**Parameters**

- `geometry`: `large_binary`
  The input `geometry`, as WKB.

## `st_issimple(geometry)`
source: https://docs.chalk.ai/chalksql-docs#st_issimple

Geospatial (Presto-flavored Velox `geometry` function).

**Parameters**

- `geometry`: `large_binary`
  The input `geometry`, as WKB.

## `st_isvalid(geometry)`
source: https://docs.chalk.ai/chalksql-docs#st_isvalid

Geospatial (Presto-flavored Velox `geometry` function).

**Parameters**

- `geometry`: `large_binary`
  The input `geometry`, as WKB.

## `st_length(geometry)`
source: https://docs.chalk.ai/chalksql-docs#st_length

Geospatial (Presto-flavored Velox `geometry` function).

**Parameters**

- `geometry`: `large_binary`
  The input `geometry`, as WKB.

## `st_linefromtext(wkt)`
source: https://docs.chalk.ai/chalksql-docs#st_linefromtext

Geospatial (Presto-flavored Velox geometry function).

**Parameters**

- `wkt`: `large_string`
  The geometry in WKT format.

## `st_linestring(points)`
source: https://docs.chalk.ai/chalksql-docs#st_linestring

Geospatial (Presto-flavored Velox geometry function).

**Parameters**

- `points`: `large_list<item: large_binary>`
  The array of point geometries.

## `st_multipoint(points)`
source: https://docs.chalk.ai/chalksql-docs#st_multipoint

Geospatial (Presto-flavored Velox geometry function).

**Parameters**

- `points`: `large_list<item: large_binary>`
  The array of point geometries.

## `st_numgeometries(geometry)`
source: https://docs.chalk.ai/chalksql-docs#st_numgeometries

Geospatial (Presto-flavored Velox `geometry` function).

**Parameters**

- `geometry`: `large_binary`
  The input `geometry`, as WKB.

## `st_numinteriorring(geometry)`
source: https://docs.chalk.ai/chalksql-docs#st_numinteriorring

Geospatial (Presto-flavored Velox `geometry` function).

**Parameters**

- `geometry`: `large_binary`
  The input `geometry`, as WKB.

## `st_numpoints(geometry)`
source: https://docs.chalk.ai/chalksql-docs#st_numpoints

Geospatial (Presto-flavored Velox `geometry` function).

**Parameters**

- `geometry`: `large_binary`
  The input `geometry`, as WKB.

## `st_overlaps(geometry1, geometry2)`
source: https://docs.chalk.ai/chalksql-docs#st_overlaps

Geospatial (Presto-flavored Velox geometry function).

**Parameters**

- `geometry1`: `large_binary`
  The first input geometry, as WKB.
- `geometry2`: `large_binary`
  The second input geometry, as WKB.

## `st_point(x, y)`
source: https://docs.chalk.ai/chalksql-docs#st_point

Geospatial (Presto-flavored Velox geometry function).

**Parameters**

- `x`: `double`
  The input value.
- `y`: `double`
  The second input value.

## `st_pointn(geometry, index)`
source: https://docs.chalk.ai/chalksql-docs#st_pointn

Geospatial (Presto-flavored Velox `geometry` function).

**Parameters**

- `geometry`: `large_binary`
  The input `geometry`, as WKB.
- `index`: `int32`
  The `index` to read.

## `st_points(geometry)`
source: https://docs.chalk.ai/chalksql-docs#st_points

Geospatial (Presto-flavored Velox `geometry` function).

**Parameters**

- `geometry`: `large_binary`
  The input `geometry`, as WKB.

## `st_polygon(wkt)`
source: https://docs.chalk.ai/chalksql-docs#st_polygon

Geospatial (Presto-flavored Velox geometry function).

**Parameters**

- `wkt`: `large_string`
  The geometry in WKT format.

## `st_relate(geometry1, geometry2, relation)`
source: https://docs.chalk.ai/chalksql-docs#st_relate

Geospatial (Presto-flavored Velox geometry function).

**Parameters**

- `geometry1`: `large_binary`
  The first input geometry, as WKB.
- `geometry2`: `large_binary`
  The second input geometry, as WKB.
- `relation`: `large_string`
  The DE-9IM intersection matrix pattern.

## `st_startpoint(geometry)`
source: https://docs.chalk.ai/chalksql-docs#st_startpoint

Geospatial (Presto-flavored Velox `geometry` function).

**Parameters**

- `geometry`: `large_binary`
  The input `geometry`, as WKB.

## `st_symdifference(geometry1, geometry2)`
source: https://docs.chalk.ai/chalksql-docs#st_symdifference

Geospatial (Presto-flavored Velox geometry function).

**Parameters**

- `geometry1`: `large_binary`
  The first input geometry, as WKB.
- `geometry2`: `large_binary`
  The second input geometry, as WKB.

## `st_touches(geometry1, geometry2)`
source: https://docs.chalk.ai/chalksql-docs#st_touches

Geospatial (Presto-flavored Velox geometry function).

**Parameters**

- `geometry1`: `large_binary`
  The first input geometry, as WKB.
- `geometry2`: `large_binary`
  The second input geometry, as WKB.

## `st_union(geometry1, geometry2)`
source: https://docs.chalk.ai/chalksql-docs#st_union

Geospatial (Presto-flavored Velox geometry function).

**Parameters**

- `geometry1`: `large_binary`
  The first input geometry, as WKB.
- `geometry2`: `large_binary`
  The second input geometry, as WKB.

## `st_within(geometry1, geometry2)`
source: https://docs.chalk.ai/chalksql-docs#st_within

Geospatial (Presto-flavored Velox geometry function).

**Parameters**

- `geometry1`: `large_binary`
  The first input geometry, as WKB.
- `geometry2`: `large_binary`
  The second input geometry, as WKB.

## `st_x(geometry)`
source: https://docs.chalk.ai/chalksql-docs#st_x

Geospatial (Presto-flavored Velox `geometry` function).

**Parameters**

- `geometry`: `large_binary`
  The input `geometry`, as WKB.

## `st_xmax(geometry)`
source: https://docs.chalk.ai/chalksql-docs#st_xmax

Geospatial (Presto-flavored Velox `geometry` function).

**Parameters**

- `geometry`: `large_binary`
  The input `geometry`, as WKB.

## `st_xmin(geometry)`
source: https://docs.chalk.ai/chalksql-docs#st_xmin

Geospatial (Presto-flavored Velox `geometry` function).

**Parameters**

- `geometry`: `large_binary`
  The input `geometry`, as WKB.

## `st_y(geometry)`
source: https://docs.chalk.ai/chalksql-docs#st_y

Geospatial (Presto-flavored Velox `geometry` function).

**Parameters**

- `geometry`: `large_binary`
  The input `geometry`, as WKB.

## `st_ymax(geometry)`
source: https://docs.chalk.ai/chalksql-docs#st_ymax

Geospatial (Presto-flavored Velox `geometry` function).

**Parameters**

- `geometry`: `large_binary`
  The input `geometry`, as WKB.

## `st_ymin(geometry)`
source: https://docs.chalk.ai/chalksql-docs#st_ymin

Geospatial (Presto-flavored Velox `geometry` function).

**Parameters**

- `geometry`: `large_binary`
  The input `geometry`, as WKB.
