GEO Introduction

레디스 개발자 교육 신청 레디스 정기점검/기술지원
Redis Technical Support
레디스 엔터프라이즈 서버
Redis Enterprise Server

소개 Introduction

GEO

Geo는 Redis 버전 3.2에 새로 도입된 기능으로, 두 지점/도시의 경도(세로선/longitude)와 위도(가로선/latitude)를 입력해서 두 지점의 거리를 구합니다.
Redis Geo는 지구(Earth)가 완전한 구(球/sphere)라고 가정합니다. 따라서 최대의 경우 0.5% 정도 오차가 발생할 수 있습니다.
Geo는 Sorted Set Data Structure를 사용합니다. 따라서 몇 가지 명령은 Sorted Set의 명령을 그대로 사용할 수 있습니다.
범위 조회: ZRANGE key 0 -1, 삭제: ZREM key member, 개수 조회: ZCARD key

명령어 요약


Geo 명령어 리스트

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 답글이 올라오면 이메일로 알려드리겠습니다.