-
-
Notifications
You must be signed in to change notification settings - Fork 50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Geoqueries on boxes #100
Comments
A geohash in itself is not a point but also a box. I guess you could perhaps create a field in each venue doc that holds an array of geohashes. E.g. |
@IjzerenHein Ah, I see. I actually meant the other way around. The user's location is a point, and I want to check inside of which boxes it belongs. So the venue has let's say 4 polygons, but I make it a box that contains all of those polygons (using the lowest and highest lat/lon of all polygons). This should make it easier to do a "fast" initial filter because traditionally I would be able to do: const within = xLat <= lat && xLon <= lon && yLat >= lat && yLon >= lon; And then I can filter inside of those matches (which is going to be a much smaller data set, in which I can then testing the polygons). Which is what I do right now on the client. I just fetch everything and filter client-side. But as you can imagine that's not very scalable. I suppose it would help if I could filter this out before it gets observed but even then, there's a limit. But because (afaik) geohash boxes are fixed in position/grid I can't really do that, can I? Or did I misunderstand what you said? Why can't firestore just let me do multiple range clauses on multiple fields. 😄 |
I have venues with delivery areas that I store inside of boxes. My initial plan was to find all venues that have a box I'm inside of, but unfortunately firestore doesn't allow multi-field range queries.
I want to find all the venues that have a delivery area (box) that the user is inside of. Geohashing works with points, so I'm not quite sure how to solve this.
Do you maybe have any pointers?
The text was updated successfully, but these errors were encountered: