zoukankan      html  css  js  c++  java
  • 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"
    '''
    
  • 相关阅读:
    git revert和git reset的区别
    git merge 和 git rebase 小结
    Markdown——入门指南
    使用Git Wiki 管理文档时,文档编写的基本用法
    mysql 列 默认添加 dedault null ??
    redis aof文件过大问题
    redis源码分析——aofrewrite
    改变文章的字号大小
    推荐大家使用的CSS书写规范及顺序
    inline-block 前世今生
  • 原文地址:https://www.cnblogs.com/kai-/p/12890798.html
Copyright © 2011-2022 走看看