-
Notifications
You must be signed in to change notification settings - Fork 300
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
Getting nearest neighbors with S2 geometry. #80
Comments
Strange issue. It seems S2ClosestPointQuery is what you want. |
@a1983 Looks a good API to use. Certainly will do what I want. Can you clarify on the precision part ? Should I index at the highest "level" which I believe is 30 for my bounding box coordinates ? I also need to know what precision I should index my query coordinates. |
What @a1983 said. @winash12: you don't need to worry about "precision" or which level to index at. Just create an |
Sorry, this is only available in C++. Does java has the same function or can achieve the same function? |
I am looking for a S2 geometry version of this SE answer - https://gis.stackexchange.com/questions/18330/using-geohash-for-proximity-searches/92331#92331
I want to use S2 cells to do approximate nearest neighbor searches
I have a bounding box on a 2D grid i.e. composed of latitudes and longitudes. For each latitude and longitude I want a S2 cell.These need to be "indexed" with a particular precision. That precision needs to be linked to a radius in kilometers or meters.
Then I have a whole bunch of query coordinates completely unrelated to the above coordinates. So I can convert this coordinate to a index as well and maybe get's neighbors as well. These can be indexed at a lower precision.
Then use this index to return nearest neighbors from the original bounding box. Here I am assuming some bit shifting will have to be done.
I have a highly optimized SkipList which does fast inserts and range queries. So the range query would return coordinates from the bounding box given the lower and upper range values from (3).
Is that possible with s2 geometry ?
The text was updated successfully, but these errors were encountered: