# GEOGRAPHY\_WITHIN\_DISTANCE

This function takes in two geospatial objects and determines whether any part of them is within the given distance, in meters.

![](https://images.contentstack.io/v3/assets/bltac01ee6daa3a1e14/bltac78831c29b58153/6a2c43b9ddfec5ae1f6c5609/within_distance-69kMaC.png)

## Syntax

```
GEOGRAPHY_WITHIN_DISTANCE ( geo1, geo2, meters )

```

## Arguments

* geo1, geo2: any valid geospatial object or WKT string: path, point or polygon.
* meters: the maximum range, in meters

## Return Type

Boolean

## Examples

> **❗ Important**: The two queries below give equivalent results, but WITHIN\_DISTANCE can take advantage of any spatial indexes on the columns for faster execution.

```sql
SELECT name FROM neighborhoods WHERE
GEOGRAPHY_WITHIN_DISTANCE("POINT(-73.94990499 40.69150746)", shape, 10000);

SELECT name FROM neighborhoods WHERE
GEOGRAPHY_DISTANCE("POINT(-73.94990499 40.69150746)", shape) <= 10000;

```

## Related Topics

For more information about working with geospatial data, see [Working with Geospatial Features](https://docs.singlestore.com/db/v9.1/developer-resources/functional-extensions/working-with-geospatial-features.md).

***

Modified at: June 29, 2022

Source: [/db/v9.1/reference/sql-reference/geospatial-functions/geography-within-distance/](https://docs.singlestore.com/db/v9.1/reference/sql-reference/geospatial-functions/geography-within-distance/)

(An index of the documentation is available at /llms.txt)
