From time to time one might feel the urgent need to execute geospatial queries on the Google AppEngine. Thinking in common SQL this is pretty easy, just a combined WHERE clause:
SELECT * FROM t_spatialdata WHERE latitude >= south AND latitude <= north AND longitude >= west AND longitude <= east
Unfortunately something like this is not possible, when using AppEngine, as you can only filter by one argument (i.e. only by latitude). I think the reason for this is that AppEngine internally sorts the table and then 'cuts' away what doesn't match the filter.
So this problem can basically be solved, by using a algorithm called Geohash, which unfortunately didn't want to return proper results, at least not the implementations I found. (The 'official' implementation uses the BitSet-Class which is not present when using AppEngine/GWT)
The solution I went for is the "javageomodel"-project which follows (afaik) a similar algorithm but worked. http://code.google.com/p/javageomodel/
The problem you will face, when trying to use this in your AppEngine project is that it will be missing (just at runtime!) two classes from the Apache Commons project: StringUtils and Validator. At least the latter one is over 1MByte in size. So I decided to replace the Validator lines with standard "assert"-calls, but adding the jars probably would have worked too.
For your convenience I uploaded the final jar that works fine: