5

I am very happy so see that Redis now offers a Geo API

I would like to host a service where, given a latitude-longitude pair, I retrieve a bounding-box (of OSM) from a pgsql query. Since I expect queries to be done in the proximity of each other, I would like to cache the bounding-boxes.

Then, given a new latitude-longitude pair, I would like to use redis to see if the query coordinates fall into a bounding-box recently queried.

Does anybody know if the Geo API of Redis supports bounding boxes. Or maybe there is a different approach to make above task more efficient.

1
  • 1
    GeoHash might be the closest you can get.
    – BradHards
    Commented Jul 2, 2017 at 4:54

1 Answer 1

1

It seems like you have to work with radius/ distance, not bounding boxes. You can check if a previous point falls within a given distance to the new point using GEODIST or store all previous points and use the GEORADIUS to find all points within a given distance.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.