content/commands/geodist.md
Return the distance between two members in the geospatial index represented by the sorted set.
Given a sorted set representing a geospatial index, populated using the [GEOADD]({{< relref "/commands/geoadd" >}}) command, the command returns the distance between the two specified members in the specified unit.
If one or both the members are missing, the command returns NULL.
The unit must be one of the following, and defaults to meters:
The distance is computed assuming that the Earth is a perfect sphere, so errors up to 0.5% are possible in edge cases.
{{% redis-cli %}} GEOADD Sicily 13.361389 38.115556 "Palermo" 15.087269 37.502669 "Catania" GEODIST Sicily Palermo Catania GEODIST Sicily Palermo Catania km GEODIST Sicily Palermo Catania mi GEODIST Sicily Foo Bar {{% /redis-cli %}}
| Redis Software | Redis Cloud | <span style="min-width: 9em; display: table-cell">Notes</span> | |:----------------------|:-----------------|:------| | <span title="Supported">✅ Standard</span> <span title="Supported"><nobr>✅ Active-Active</nobr></span> | <span title="Supported">✅ Standard</span> <span title="Supported"><nobr>✅ Active-Active</nobr></span> | |
{{< multitabs id="geodist-return-info" tab1="RESP2" tab2="RESP3" >}}
One of the following:
-tab-sep-
One of the following:
{{< /multitabs >}}