Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Approaches to storing geospatial data in Redis

Tags:

redis

I've got a MySQL table consisting of roughly 1 million latitudes and longitudes with a primary key value for each row.

I'd like to migrate this table into Redis either through Geohashing or lat and lon sorted sets.

Has anyone done this? And what was the approach you used for storing and querying data (e.g.: querying data within a lat / lon range for Google Maps).

like image 326
Bobby Sciacchitano Avatar asked Apr 18 '12 06:04

Bobby Sciacchitano


1 Answers

Yes, it has already been done (using geohashing ...)

You can check for instance the data structure behind the Geodis package (from Dvir Volk and friends):

https://github.com/doat/geodis

There were some discussions about it on the Redis mailing-list:

https://groups.google.com/d/topic/redis-db/Mw0lRzutnkE/discussion https://groups.google.com/d/topic/redis-db/6M-aAPA-iXc/discussion https://groups.google.com/d/topic/redis-db/Bps95jeRgr8/discussion

like image 61
Didier Spezia Avatar answered Oct 11 '22 06:10

Didier Spezia