For our application, we used Geohashing based on this 
article: http://code.google.com/apis/maps/articles/geospatial.html

It is a slightly different twist on the indexes which I think would prevent 
you from having to re-index every time you want to change the precision. 

http://en.wikipedia.org/wiki/Geohash
"Geohashes offer properties like arbitrary precision and the possibility of 
gradually removing characters from the end of the code to reduce its size 
(and gradually lose precision)."

Instead of an indexed property that looks like this (what you currently 
have):

[u'37.3411|-121.8940|37.3395|-121.8926', 
u'37.3411|-121.8929|37.3395|-121.8916', 
...] 

We have this...

/** Geocells in which this entity resides */ 
@Index 
List<String> cells;

Which looks like this:

[8, 8f, 8f1, 8f12, 8f12a, 8f12ac, 8f12ac6, 8f12ac60, 8f12ac605, 8f12ac605f, 
8f12ac605fb, 8f12ac605fb3, 8f12ac605fb34]

The query then looks like this:

List<String> cells = [compute list of cells from a lat/lng, there is code 
out there to do that]
Query<Entity> query = ofy.load().type(Entity.class) .filter("cells in", 
cells)

hope that helps,

jon

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-appengine/-/saVfn6u9wSAJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en.

Reply via email to