Possible Duplicate:
Google App Engine Geohashing
I'm trying to use AppEngine to store a model with Latitude and Longitude parameters. All seems to go alright, except when I try to retrieve all users between two locations. I do as follows:
String query = "select from " + TUser.class.getName();
query += " WHERE ( iLatitude >= " + lat_min + " && iLatitude <= " + lat_max + ")";
query += " && ( iLongitude >= " + lon_min + " && iLongitude <= " + lon_max + ")";
List<TUser> obj = (List<TUser>)pm.newQuery(query).execute();
But, as said in AppEngine Documentation, this throws a:
java.lang.IllegalArgumentException: Only one inequality filter per query is supported. Encountered both latitude and longitude
I'm trying to find a workarround for this, but no luck. Working with coordinates will always need at least two inequalities. How can this be solved then? Any solution? Or does anyone knows when will be implemented in AppEngine?
As the database has hundreds of thousands users, I can't filter the query just by latitude, and then iterate the result with a FOR to get the ones with the correct longitude. Too much data.
Thanks,