【问题标题】:Why isn't this GEORADIUS call on redis working?为什么这个对 redis 的 GEORADIUS 调用不起作用?
【发布时间】:2016-11-21 22:44:47
【问题描述】:
  1. 将 x 添加到 mytest

    127.0.0.1:6379> geoadd mytest -78.45 38.13 x
    (integer) 1
    
  2. 尝试在 x 的 50.000 公里范围内找到点:

    127.0.0.1:6379> georadius mytest 72.8 19.13 50000 km
    (empty list or set)
    
  3. 将 y 添加到 mytest:

    127.0.0.1:6379> geoadd mytest 72.8 19.13 y
    (integer) 1
    
  4. 计算 x 和 y 之间的距离:

    127.0.0.1:6379> geodist mytest x y km
    "12979.3623"
    

如果 (4) 发现 x 和 y 之间的距离仅为 12979 公里,为什么 (2) 是空集?

【问题讨论】:

    标签: redis geolocation geospatial


    【解决方案1】:

    这看起来像是一个缺陷 - 我建议您通过在 http://github.com/antirez/redis/issues 上打开一个问题来报告它。

    有趣的是,请注意:

    127.0.0.1:6379> GEORADIUS mytest -78.45 38.13 50000 km
    1) "x"
    2) "y"
    

    还有:

    127.0.0.1:6379> GEORADIUSBYMEMBER mytest y 50000 km
    1) "y"
    127.0.0.1:6379> GEORADIUSBYMEMBER mytest x 50000 km
    1) "x"
    2) "y"
    

    【讨论】:

    • Bug 已修复 @redis repo。
    猜你喜欢
    • 2013-11-02
    • 1970-01-01
    • 1970-01-01
    • 2014-08-09
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多