Open Queatz opened 6 years ago
What is your usecase? E.g. you can use a superfast bounding box query using x1,y1,x2,y2 coordinates and then filter on those results (using query filters).
@greenrobot geoqueries are a bit different, i.e.
You could do some lat/lon pre-processing to get a bounding box to query within an area.
Still, it would be good to collect some use cases to identify most important use cases.
My specific use case is getting the 10 closest to a lat/lng. It could span 100m or 1000000m. With bounding boxes one would have to progressively requery with a larger bounding until a total of 10 are found. There are performance hits because if you're far from i.e. a city with many data points, then by the time your progressively bigger bounding box includes the city, it includes the entire city, and then the data points are sorted in code.
I would also go for an increasing bounding box. You could mitigate the "city effect" by setting a limit of results, e.g. to 100. The quality sacrifice may be acceptable depending on your use case.
Agreed, that is what I will be doing for now.
Would love to have easy geospatial queries locally in my app.
Might want to look into open source ArangoDB's implementation:
https://docs.arangodb.com/3.3/AQL/Tutorial/Geospatial.html
https://github.com/arangodb/arangodb/blob/devel/arangod/RocksDBEngine/RocksDBGeoIndex.cpp