pub trait GeoCommands<T>: PrepareCommand<T> {
    fn geoadd<K, M, I>(
        &self,
        key: K,
        condition: GeoAddCondition,
        change: bool,
        items: I
    ) -> CommandResult<'_, T, usize>
    where
        K: Into<BulkString>,
        M: Into<BulkString>,
        I: ArgsOrCollection<(f64, f64, M)>
, { ... } fn geodist<K, M>(
        &self,
        key: K,
        member1: M,
        member2: M,
        unit: GeoUnit
    ) -> CommandResult<'_, T, Option<f64>>
    where
        K: Into<BulkString>,
        M: Into<BulkString>
, { ... } fn geohash<K, M, C>(
        &self,
        key: K,
        members: C
    ) -> CommandResult<'_, T, Vec<String>>
    where
        K: Into<BulkString>,
        M: Into<BulkString>,
        C: SingleArgOrCollection<M>
, { ... } fn geopos<K, M, C>(
        &self,
        key: K,
        members: C
    ) -> CommandResult<'_, T, Vec<Option<(f64, f64)>>>
    where
        K: Into<BulkString>,
        M: Into<BulkString>,
        C: SingleArgOrCollection<M>
, { ... } fn geosearch<K, M1, M2, A>(
        &self,
        key: K,
        from: GeoSearchFrom<M1>,
        by: GeoSearchBy,
        options: GeoSearchOptions
    ) -> CommandResult<'_, T, A>
    where
        K: Into<BulkString>,
        M1: Into<BulkString>,
        M2: FromValue,
        A: FromSingleValueArray<GeoSearchResult<M2>>
, { ... } fn geosearchstore<D, S, M>(
        &self,
        destination: D,
        source: S,
        from: GeoSearchFrom<M>,
        by: GeoSearchBy,
        options: GeoSearchStoreOptions
    ) -> CommandResult<'_, T, usize>
    where
        D: Into<BulkString>,
        S: Into<BulkString>,
        M: Into<BulkString>
, { ... } }
Expand description

A group of Redis commands related to Geospatial indices

See Also

Redis Geospatial Commands

Provided Methods

Adds the specified geospatial items (longitude, latitude, name) to the specified key.

Return
  • When used without optional arguments, the number of elements added to the sorted set (excluding score updates).
  • If the CH option is specified, the number of elements that were changed (added or updated).
See Also

https://redis.io/commands/geoadd/

Return the distance between two members in the geospatial index represented by the sorted set.

Return

The distance in the specified unit, or None if one or both the elements are missing.

See Also

https://redis.io/commands/geodist/

Return valid Geohash strings representing the position of one or more elements in a sorted set value representing a geospatial index (where elements were added using geoadd).

Return

An array where each element is the Geohash corresponding to each member name passed as argument to the command.

See Also

https://redis.io/commands/geohash/

Return the positions (longitude,latitude) of all the specified members of the geospatial index represented by the sorted set at key.

Return

n array where each element is a two elements array representing longitude and latitude (x,y) of each member name passed as argument to the command. Non existing elements are reported as NULL elements of the array.

See Also

https://redis.io/commands/geopos/

Return the members of a sorted set populated with geospatial information using geoadd, which are within the borders of the area specified by a given shape.

Return

An array of members + additional information depending on which with_xyz options have been selected

See Also

https://redis.io/commands/geosearch/

This command is like geosearch, but stores the result in destination key.

Return

the number of elements in the resulting set.

See Also

https://redis.io/commands/geosearchstore/

Implementors