# ST_WITHIN

Returns whether the first geometry is within the second geometry. This is the inverse of the ST_CONTAINS function.

## Syntax

`ST_WITHIN(geomA, geomB)`

### Parameters

#### geomA

Expression of type `geo_point`, `cartesian_point`, `geo_shape` or `cartesian_shape`. If `null`, the function returns `null`.

#### geomB

Expression of type `geo_point`, `cartesian_point`, `geo_shape` or `cartesian_shape`. If `null`, the function returns `null`. The second parameter must also have the same coordinate system as the first. It is not possible to combine `geo_*` and `cartesian_*` parameters.

## Examples

```esql
FROM airport_city_boundaries
| WHERE ST_WITHIN(city_boundary, TO_GEOSHAPE("POLYGON((109.1 18.15, 109.6 18.15, 109.6 18.65, 109.1 18.65, 109.1 18.15))"))
| KEEP abbrev, airport, region, city, city_location
```
Filter airport city boundaries to only those within a specified polygon.