GEOPOS

Syntax
GEOPOS key [member [member ...]]
Available since:
3.2.0
Time complexity:
O(1) for each member requested.
ACL categories:
@read, @geo, @slow,

返回由排序集在key表示的地理空间索引中所有指定成员的位置(经度,纬度)。

给定一个表示地理空间索引的排序集合,使用GEOADD命令填充,通常很有用获取指定成员的坐标。当通过GEOADD填充地理空间索引时,坐标被转换为52位的地理哈希,因此返回的坐标可能不完全与用于添加元素的坐标相同,但可能会引入小的误差。

该命令可以接受可变数量的参数,因此即使指定了单个元素,它也始终返回一个位置数组。

示例

GEOADD Sicily 13.361389 38.115556 "Palermo" 15.087269 37.502669 "Catania" GEOPOS Sicily Palermo Catania NonExisting

RESP2 回复

Array reply: An 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 Nil reply elements of the array.

RESP3 回复

Array reply: An 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 reply elements of the array.
RATE THIS PAGE
Back to top ↑