1. 18 12月, 2019 1 次提交
  2. 08 10月, 2019 1 次提交
    • A
      Geo: output 10 chars of geohash, not 11. · 009862ab
      antirez 提交于
      This does not limit the actual precision, because the last digit bits were
      garbage, and the shift value became even negative in the last iteration.
      009862ab
  3. 15 1月, 2019 1 次提交
  4. 04 7月, 2017 1 次提交
    • A
      Fix GEORADIUS edge case with huge radius. · b2cd9fca
      antirez 提交于
      This commit closes issue #3698, at least for now, since the root cause
      was not fixed: the bounding box function, for huge radiuses, does not
      return a correct bounding box, there are points still within the radius
      that are left outside.
      
      So when using GEORADIUS queries with radiuses in the order of 5000 km or
      more, it was possible to see, at the edge of the area, certain points
      not correctly reported.
      
      Because the bounding box for now was used just as an optimization, and
      such huge radiuses are not common, for now the optimization is just
      switched off when the radius is near such magnitude.
      
      Three test cases found by the Continuous Integration test were added, so
      that we can easily trigger the bug again, both for regression testing
      and in order to properly fix it as some point in the future.
      b2cd9fca
  5. 20 12月, 2016 1 次提交
  6. 05 12月, 2016 1 次提交
    • A
      Geo: improve fuzz test. · b1fc06f7
      antirez 提交于
      The test now uses more diverse radius sizes, especially sizes near or
      greater the whole earth surface are used, that are known to trigger edge
      cases. Moreover the PRNG seeding was probably resulting into the same
      sequence tested over and over again, now seeding unsing the current unix
      time in milliseconds.
      
      Related to #3631.
      b1fc06f7
  7. 27 7月, 2016 1 次提交
    • A
      Multiple GEORADIUS bugs fixed. · 356a6304
      antirez 提交于
      By grepping the continuous integration errors log a number of GEORADIUS
      tests failures were detected.
      
      Fortunately when a GEORADIUS failure happens, the test suite logs enough
      information in order to reproduce the problem: the PRNG seed,
      coordinates and radius of the query.
      
      By reproducing the issues, three different bugs were discovered and
      fixed in this commit. This commit also improves the already good
      reporting of the fuzzer and adds the failure vectors as regression
      tests.
      
      The issues found:
      
      1. We need larger squares around the poles in order to cover the area
      requested by the user. There were already checks in order to use a
      smaller step (larger squares) but the limit set (+/- 67 degrees) is not
      enough in certain edge cases, so 66 is used now.
      
      2. Even near the equator, when the search area center is very near the
      edge of the square, the north, south, west or ovest square may not be
      able to fully cover the specified radius. Now a test is performed at the
      edge of the initial guessed search area, and larger squares are used in
      case the test fails.
      
      3. Because of rounding errors between Redis and Tcl, sometimes the test
      signaled false positives. This is now addressed.
      
      Whenever possible the original code was improved a bit in other ways. A
      debugging example stanza was added in order to make the next debugging
      session simpler when the next bug is found.
      356a6304
  8. 18 2月, 2016 1 次提交
  9. 06 10月, 2015 1 次提交
  10. 15 9月, 2015 1 次提交
    • A
      GEORADIUS: Don't report duplicates when radius is huge. · 3c23b5ff
      antirez 提交于
      Georadius works by computing the center + neighbors squares covering all
      the area of the specified position and radius. Then a distance filter is
      used to remove elements which are actually outside the range.
      
      When a huge radius is used, like 5000 km or more, adjacent neighbors may
      collide and be the same, leading to the reporting of the same element
      multiple times. This only happens in the edge case of huge radius but is
      not ideal.
      
      A robust but slow solution would involve qsorting the range to remove
      all the duplicates. However since the collisions are only in adjacent
      boxes, for the way they are ordered in the code, it is much faster to
      just check if the current box is the same as the previous one processed.
      
      This commit adds a regression test for the bug.
      
      Fixes #2767.
      3c23b5ff
  11. 09 7月, 2015 1 次提交
    • A
      GEOENCODE / GEODECODE commands removed. · b96af595
      antirez 提交于
      Rationale:
      
      1. The commands look like internals exposed without a real strong use
      case.
      2. Whatever there is an use case, the client would implement the
      commands client side instead of paying RTT just to use a simple to
      reimplement library.
      3. They add complexity to an otherwise quite straightforward API.
      
      So for now KILLED ;-)
      b96af595
  12. 29 6月, 2015 4 次提交
  13. 27 6月, 2015 1 次提交
  14. 26 6月, 2015 1 次提交
    • A
      Geo: from lat,lon API to lon,lat API according to GIS standard · fa9d62d3
      antirez 提交于
      The GIS standard and all the major DBs implementing GIS related
      functions take coordinates as x,y that is longitude,latitude.
      It was a bad start for Redis to do things differently, so even if this
      means that existing users of the Geo module will be required to change
      their code, Redis now conforms to the standard.
      
      Usually Redis is very backward compatible, but this is not an exception
      to this rule, since this is the first Geo implementation entering the
      official Redis source code. It is not wise to try to be backward
      compatible with code forks... :-)
      
      Close #2637.
      fa9d62d3
  15. 24 6月, 2015 2 次提交
    • A
      Geo: GEOHASH command test. · 5fd756bf
      antirez 提交于
      5fd756bf
    • A
      Geo: GEORADIUS fuzzy testing by reimplementing it in Tcl. · cf89a19f
      antirez 提交于
      We set random points in the world, pick a random position, and check if
      the returned points by Redis match the ones computed by Tcl by brute
      forcing all the points using the distance between two points formula.
      
      This approach is sounding since immediately resulted in finding a bug in
      the original implementation.
      cf89a19f
  16. 23 6月, 2015 1 次提交
  17. 22 6月, 2015 3 次提交
    • A
      Geo: fix tests after distance precision change · 575e247a
      antirez 提交于
      575e247a
    • A
      Geo: removed JSON failing test (false positive) · 73134f6a
      antirez 提交于
      Server output is matched to a pre-computed output. The last digits
      differ because of rouding errors.
      73134f6a
    • M
      [In-Progress] Add Geo Commands · 7f4ac3d1
      Matt Stancliff 提交于
      Current todo:
        - replace functions in zset.{c,h} with a new unified Redis
          zset access API.
      
      Once we get the zset interface fixed, we can squash
      relevant commits in this branch and have one nice commit
      to merge into unstable.
      
      This commit adds:
        - Geo commands
        - Tests; runnable with: ./runtest --single unit/geo
        - Geo helpers in deps/geohash-int/
        - src/geo.{c,h} and src/geojson.{c,h} implementing geo commands
        - Updated build configurations to get everything working
        - TEMPORARY: src/zset.{c,h} implementing zset score and zset
          range reading without writing to client output buffers.
        - Modified linkage of one t_zset.c function for use in zset.c
      
      Conflicts:
      	src/Makefile
      	src/redis.c
      7f4ac3d1