Techniques for geospatial search using vectorization

I am trying to build an image search vector DB but I want the location to be part of the vector i.e. when I search for an image, this will be searched with a location(lat/long), and only those images I need which are within a radius of that location.

Metadata search isn’t helping here.

Any help is much appreciated.

Hi Anirudh,
We did get some feedback from one of our data scientists:
For this specific use case, I have a workaround that is a bit simpler. With metadata filtering we can support the following filter: return all images whose lat and long are both within a distance R from some interest point. This is not the same as radius - it is actually all the images within a square with edge length 2R centered at the point of interest. If the customer insists on radius R, then they can post-filter to verify that the returned results are indeed within radius R. Assuming uniform distribution, this will cause the query to return only about 27% (=4/pi-1) more points. This number can be made arbitrarily close to zero by having a more complicated metadata filter.

One other note: They may be able to use s2 indexes to convert lat long in s2 cells which can be then used with range queries on strings S2 Cells | S2Geometry

Thanks for using the community and I hope these responses help you in your journey.


1 Like