开发者

App Engine - Precomputing bounding boxes for proximity search

I'm trying to do a location-based search on App Engine, but since the data store doesn't support multiple inequality operators, I can't search "where lat between a and b and lon between c and d".

One of the solutions is to pre-compute bounding boxes to search on, as explained here:

http://code.google.com/appengine/articles/geosearch.html

http://mutiny.googlecode.com

However, I'm a little confused about "slices". I'm trying to figure out:

  1. Why have slices? Why not just increase the resolution? Don't they do the same thing?
  2. Why does the same have 5 configs - won't one do?

    GEOBOX_CONFIGS = ( (4, 5, True), (3, 2, True), (3, 8, False), (3, 16, False), (2, 5, False), )

I'm trying to figure out what to set the config to for my own app, but there are so many variables, it's not clear what to do. Do I increase the resolution (first number), the numbe开发者_开发问答r of slices (second number), add/remove config?

Ultimately, I'm interested in points within 10-15 miles (the code already sorts them by distance), but I don't understand why it can't be done with 1 config and the resolution set high enough.


I found another example which seems to wrap everything up nicely, and I don't need to worry about all those crazy config values!

http://code.google.com/p/geomodel/wiki/Usage

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜