GEO Introduction

Apply for Redis Developer Course Redis Regular Inspection / Technical Support Redis Enterprise Server

Introduction

GEO

Geo is a feature introduced in Redis version 3.2. You enter longitude (vertical line) and latitude (horizontal line) of two points/cities and compute the distance between them.
Redis Geo assumes the Earth is a perfect sphere. Therefore an error of about 0.5% can occur in the worst case.
Geo uses the Sorted Set data structure. So some commands can be used as Sorted Set commands.
Range query: ZRANGE key 0 -1, delete: ZREM key member, count: ZCARD key

Command summary


Geo command list

CommandsVersionSyntaxDescription
GEOADD3.2.0key longitude latitude member [longitude latitude member ...]
GEOPOS3.2.0 key member [member ...]
GEODIST3.2.0key member1 member2 [unit]
GEORADIUSBYMEMBER 3.2.0 key member radius m|km|ft|mi [WITHCOORD] [WITHDIST] [WITHHASH] [COUNT count] [ASC|DESC] [STORE key] [STOREDIST key]
GEORADIUS3.2.0 key longitude latitude radius m|km|ft|mi [WITHCOORD] [WITHDIST] [WITHHASH] [COUNT count] [ASC|DESC] [STORE key] [STOREDIST key]
GEOHASH3.2.0key member [member ...]

Total : 6


<< PFMERGE GEOADD >>

Email 답글이 올라오면 이메일로 알려드리겠습니다.