3

I followed several example about geospatial support in Redis. I tried to add POINT features to my Redis dataset without any problem, and subsequently I can query POINT names within certain radius (in meters, km, miles) of a certain coordinate (or a certain member of POINT).

The next immediate feature i need to try is POINT-in-POLYGON query. Now I am curious :

Does Redis geo have the capability for storing polygon? If yes, does this polygon capability come as native or need another stack of software/extension?

Rino
  • 131
  • 1
  • 4
  • No built-in way to do that. A similar [question](https://stackoverflow.com/questions/44019693/redis-how-to-get-points-in-a-given-rectangle-using-geohash-api). – for_stack Oct 09 '18 at 01:37
  • That would actually be a great addition to redis :) – Not_a_Golfer Oct 09 '18 at 07:06
  • Any luck with this? – grabhints Dec 10 '18 at 14:43
  • Interesting. I am looking or this as well. The closest I find is https://github.com/RedisLabs/geo.lua – kalyanvgopal Dec 26 '18 at 09:05
  • @grabhints My motive was to get to know Redis for the first time, without specific urge to use it, as I am happy with PostGIS. So after that point, knowing that there's no built-in way for Point-in-arbitrary-polygon query, I did not dig more. Not to mention that, as i recall, the available plugin (i believe, the one in Github) has some degree of inacurracy. Nevertheless I am curious too with this Point-in-arbitrary-polygon query too. :) – Rino Dec 27 '18 at 10:35

1 Answers1

1

I think it is still not possible to store polygons with redis geospatial.

But I found an article explaining how to load a custom lua script to query points (stored in redis) within a polygon. The GEOSEARCH command allows you to do that for a bounding box out of the box if it is enough for you.