We had the same problem, we use AWS and DynamoDB in particular. We solved this problem with the CloudSearch Service, every time we store some "geo-search" data in our database, we index the data in the CloudSearch instance using lat, lon as filters (for this you need to do the conversion to lat and lon to turn it into uint).
Then we say that you want to search for a specific lat / bosom and radius, you calculate the corresponding geo objects (latmin, latmax, lonmin, lonmax) and request a CloudSearch instance with specific filters to obtain the key scheme of your data, you can query DynamoDB for information .
Some code in Java to do just above:
Using RectangularWindows from the com.javadocmd.simplelatlng.window package by Tyler Coles, calculating the bounding box, and performing the conversion for lat / lon.
RectangularWindow rectangularWindow = new RectangularWindow(newLatLng(location.getLat().doubleValue(), location.getLon().doubleValue()), radius.doubleValue(), radius.doubleValue(), LengthUnit.KILOMETER); latMin = (long) ((180 + rectangularWindow.getMinLatitude()) * 100000); latMax = (long) ((180 + rectangularWindow.getMaxLatitude()) * 100000); lonMin = (long) ((360 + rectangularWindow.getLeftLongitude()) * 100000); lonMax = (long) ((360 + rectangularWindow.getRightLongitude()) * 100000);
Then an example query in an instance of CloudSearch:
http: // [SEARCHURL] / 2011-02-01 / search? bq = (and lat: 22300347..22309340 (and lon: 28379282..28391589))
I'm not sure if this is the best solution, but what did we come up with
Eras
source share