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"
    '''
    
  • 相关阅读:
    ios动态创建类Class
    iOS 视图控制器转场详解
    HTML5新增标签属性
    HTML5入门篇
    ExtJs 添加员工 实例 ---- 锚点布局 anchor 可自动伸缩
    Ext 初级UI设计
    Ext 面向对象程序设计 入门篇
    改善EF代码的方法(下)
    改善EF代码的方法(上)
    EF 存储过程(下)
  • 原文地址:https://www.cnblogs.com/kai-/p/12890798.html
Copyright © 2011-2022 走看看