반응형

 Redis 데이터 타입 – Geo

 

·       Version : Redis 3.2.100 (Windows)

 

Redis Geo 데이터 타입은 위치정보(위도, 경도) 데이터를 효율적으로 저장하고 사용할 있다.  geoadd, geopos, geodist, georadius, geohash 명령어를 사용한다.

 

[geoadd]

데이터를 저장한다.

geoadd key longitude latitude member [longitude latitude member] …

ex) geopos position 127.1058431 37.5164113 “Local A” 127.0980748 37.5301218 “Local 2”

 

 

[geopos]

데이터를 검색한다

geopos key member [member] …

ex) geopos position “Local A” “Local 2”

bitcount key start end

ex) bitcount order:20190509 0 -1

 

 

[geodist]

맴버간의 거리를 반환

geodist key member1 member2 [unit]

ex) geodist position “Local A” “Local 2”

 

 

[georadius]

중심위치로 부터 최대 거리(반지름)으로 지정된 경계 내에 있는 목록을 반환

georadius key longitude latitude radius m|km|ft|mi

ex) georadius position 127 37 50 mi ASC

 

 

 

[참고자료]

https://redis.io/commands

 

2019-05-14 / Sungwook Kang / http://sungwookkang.com

 

Redis, Redis ,geoadd, geopos, geodist, georadius, geohash데이터 타입, 위치정보, 레디스 위치 정보,

반응형

'NoSql, MemoryDB' 카테고리의 다른 글

Redis Memory 정보  (0) 2019.05.21
Redis Architecture  (0) 2019.05.18
Redis 데이터 타입 – bit  (0) 2019.05.10
Redis 데이터 타입 – Sorted Set  (0) 2019.05.03
Redis 데이터 타입 - Set  (0) 2019.04.30

+ Recent posts