How is "96.8 > 100" ever going to be true? ;p But anyway as pointed out you cant use inequality comparisons on more than one property, you can do bboxes in this way.
The solution is you need to encode both properties (lat/long) into one property. For lat/long this is possible as you pretty much search rectangles, it wouldnt work for arbitary pairs of properties. A common solution floated about on these forums is to use geohashes - a search of 'geohash' should find them - there are even some working implementations. I have a very rudimentory version I created in a branch of geodatastore [1] but have never got round to merging into the main project[2], but there are better implementations available. If geohashs are too coarse for you, then you will need to implement a quadtree index, see [3] for an example. [1] http://code.google.com/p/geodatastore/ [2] http://groups.google.com/group/google-appengine/browse_thread/thread/1f68f321fcb05548/4108ec9656602cf9?show_docid= 4108ec9656602cf9 [3] http://labs.metacarta.com/blog/27.entry/geographic-queries-on-google-app-engine/ On Tue, Oct 28, 2008 at 6:12 PM, sevenseeker <[EMAIL PROTECTED]> wrote: > > Given a bounding box of numbers (here using lat and long), how can I > search within a range of the numbers since there can only be one > inequality comparison per property? > > Here is the query that does not work. > query = db.GqlQuery("SELECT * FROM SpeakingOffer" > "WHERE 96.8 > 100 AND :2 < > location2_lat" > "AND :3 > location1_long AND :4 > location_long" > "ORDER BY entry_time", > lat,lat,long,long) > > Here is the start of another method. > query = db.Query(SpeakingOffer) > query.filter('location1_lat <=', lat) > query.filter('location2_lat >=',lat) > > So what is the recommended method of dealing with this situation? > (outside even of a GIS domain) > > Thanks, > Jason > > > -- Barry - www.nearby.org.uk - www.geograph.org.uk - --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Google App Engine" group. 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 -~----------~----~----~----~------~----~------~--~---
