• 杨博东's avatar
    Add GEOSEARCH / GEOSEARCHSTORE commands (#8094) · 4d06d99b
    杨博东 authored
    Add commands to query geospatial data with bounding box.
    
    Two new commands that replace the existing 4 GEORADIUS* commands.
    
    GEOSEARCH key [FROMMEMBER member] [FROMLOC long lat] [BYRADIUS radius
    unit] [BYBOX width height unit] [WITHCORD] [WITHDIST] [WITHASH] [COUNT
    count] [ASC|DESC]
    
    GEOSEARCHSTORE dest_key src_key [FROMMEMBER member] [FROMLOC long lat]
    [BYRADIUS radius unit] [BYBOX width height unit] [WITHCORD] [WITHDIST]
    [WITHASH] [COUNT count] [ASC|DESC] [STOREDIST]
    
    - Add two types of CIRCULAR_TYPE and RECTANGLE_TYPE to achieve different searches
    - Judge whether the point is within the rectangle, refer to:
    geohashGetDistanceIfInRectangle
    4d06d99b
geo.c 33.9 KB