Bobby Sciacchitano
Bobby Sciacchitano

Reputation: 851

Approaches to storing geospatial data in 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).

Upvotes: 9

Views: 6012

Answers (2)

schmijos
schmijos

Reputation: 8725

Another project you maybe want to have a look into is Tile38.

Tile38 is a geolocation data store, spatial index, and realtime geofence. It supports a variety of object types including lat/lon points, bounding boxes, XYZ tiles, Geohashes, and GeoJSON.

Querying in particular seems really nice to use. For example you can set fences which trigger webhooks.

I don't know about migrating data though.

Upvotes: 2

Didier Spezia
Didier Spezia

Reputation: 73286

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

Upvotes: 5

Related Questions