0

I have coordinates, which are assigned a corresponding geohash in my database. Now I want to retrieve all of the coordinates within two bounding coordinates (top right and top left corner). How can I do that properly?

I tried getting the geohash that fits both of those bounding coordinates, but this solution does not work when they are in completely different regions of the world (so they are not sharing anything in common).

Is there a better way to do that?

Thanks for your help

ReasoN
  • 366
  • 4
  • 17
  • You might find the following discussion useful: https://stackoverflow.com/questions/46553682/is-there-a-way-to-use-geofire-with-firestore – Joshua Melcon Dec 30 '18 at 22:58

1 Answers1

0

Unfortunately, this isn't something you can do out-of-the-box with datastore / App engine. (There are no built in spatial queries.)

For early prototyping, etc., you can do it the hard way - retrieve all the rows, and discard the ones not meeting your query in code. Obviously, probably not viable with real production data.

See related question Query for Entities Nearby with Geopt for some possible production solutions.

Elliot Nelson
  • 11,371
  • 3
  • 30
  • 44