• GEO


    GEO(地理信息定位):存储经纬度,计算两地距离,范围等

    北京:116.28,39.55

    天津:117.12,39.08

    可以计算天津到北京的距离,天津周围50km的城市,外卖等

    5个城市纬度

    城市 经度 纬度 简称
    北京 116.28 39.55 beijing
    天津 117.12 39.08 tianjin
    石家庄 114.29 38.02 shijiazhuang
    唐山 118.01 39.38 tangshan
    保定 115.29 38.51 baoding

    相关命令

    geoadd key longitude latitude member #增加地理位置信息
    geoadd cities:locations 116.28 39.55 beijing #把北京地理信息添加到cities:locations中
    geoadd cities:locations 117.12 39.08 tianjin
    geoadd cities:locations 114.29 38.02 shijiazhuang
    geoadd cities:locations 118.01 39.38 tangshan
    geoadd cities:locations 115.29 38.51 baoding
        
    geopos key member #获取地理位置信息
    geopos cities:locations beijing #获取北京地理信息
    
    geodist key member1 member2 [unit]#获取两个地理位置的距离 unit:m(米) km(千米) mi(英里) ft(尺)
    geodist cities:locations beijing tianjin km #北京到天津的距离,89公里
    
    georadius key logitude latitude radiusm|km|ft|mi [withcoord] [withdist] [withhash] [COUNT count] [asc|desc] [store key][storedist key]
    
    georadiusbymember key member radiusm|km|ft|mi [withcoord] [withdist] [withhash] [COUNT count] [asc|desc] [store key][storedist key]
    #获取指定位置范围内的地理位置信息集合
    '''
    withcoord:返回结果中包含经纬度
    withdist:返回结果中包含距离中心节点位置
    withhash:返回解雇中包含geohash
    COUNT count:指定返回结果的数量
    asc|desc:返回结果按照距离中心店的距离做升序/降序排列
    store key:将返回结果的地理位置信息保存到指定键
    storedist key:将返回结果距离中心点的距离保存到指定键
    '''
    georadiusbymember cities:locations beijing 150 km
    '''
    1) "beijing"
    2) "tianjin"
    3) "tangshan"
    4) "baoding"
    '''
    
  • 相关阅读:
    JQuery OOP 及 OOP思想的简易理解
    windows下编写shell脚本执行错误
    Kafka常用命令
    OffsetDateTime工具类
    windows下安装consul
    磁盘阵列方案
    shell基本语法记录
    学习CGLIB与JDK动态代理的区别
    Spring源码分析-BeanFactoryPostProcessors 应用之 PropertyPlaceholderConfigurer
    局域网内搭建git
  • 原文地址:https://www.cnblogs.com/kai-/p/12890798.html
Copyright © 2020-2023  润新知