> ## Documentation Index
> Fetch the complete documentation index at: https://docs.firebolt.io/llms.txt
> Use this file to discover all available pages before exploring further.

<AgentInstructions>

## Submitting Feedback

If you encounter incorrect, outdated, or confusing documentation on this page, submit feedback:

POST https://docs.firebolt.io/feedback

```json
{
  "path": "/reference-sql/functions-reference/geospatial/st_distance",
  "feedback": "Description of the issue"
}
```

Only submit feedback when you have something specific and actionable to report.

</AgentInstructions>

> Reference material for ST_DISTANCE function

# ST_DISTANCE

The `ST_DISTANCE` function calculates the shortest distance, measured as a geodesic arc between two `GEOGRAPHY` objects, measured in meters. It models the earth as a perfect sphere with a fixed radius of 6,371,008 meters.

If either input is empty, `ST_DISTANCE` will return `NULL`.

## Syntax

```sql theme={"theme":{"light":"github-light","dark":"github-dark"}}
ST_DISTANCE(<geo1>, <geo2>)
```

## Parameters

| Parameter | Description                                                      | Supported input types |
| :-------- | :--------------------------------------------------------------- | :-------------------- |
| `<geo1>`  | The first `GEOGRAPHY` object to calculate the distance between.  | `GEOGRAPHY`           |
| `<geo2>`  | The second `GEOGRAPHY` object to calculate the distance between. | `GEOGRAPHY`           |

## Return Type

`ST_DISTANCE` returns a value of type `DOUBLE PRECISION`.

## Example

The following code example constructs two Points from their WKT representations: One at the Statue of Liberty in New York City, and one at the Big Ben in London. It then returns the shortest distance between them, as measured as a geodesic arc, in meters:

```sql theme={"theme":{"light":"github-light","dark":"github-dark"}}
SELECT ST_DISTANCE(
ST_GEOGFROMTEXT('POINT(-74.04447010745835 40.68924450077543)'),
ST_GEOGFROMTEXT('POINT(-0.12418551935155021 51.50086274661804)')
) AS result
```

**Returns**

| result (DOUBLE PRECISION) |
| :------------------------ |
| 5574863.932096738         |
