Agree that it would be very nice to be able to do clever queries on GeoPt fields. I.e. find records for which some GeoPt field is within some boundaries. Where "boundaries" could given as a radius around a point, or perhaps even a polygon. Likewise I can see that some folks would like queries for "west of" etc.
On the side: float operations are rather expensive, so I recommend to: - scale up to integers whenever that is feasible - compute a float only once; in your code you should compute the 'lat' of the request only once and not everyt time the loop is traversed. - Robert On Dec 3, 5:02 am, niklasr <[EMAIL PROTECTED]> wrote: > There's the problem of "show everything close to a geopt". I came > around it by iterating a 2nd time after the query and saving only > nearby entities to a new list as at most one property per query can > have inequality filter and geohash isn't usable. So we can filter and > find everything in a radius or even exactly within by geopts defined > city limits. It would however be preferred to do this without the 2nd > iteration. > L=[] > things = Thing.all().filter("modified >", twomonthsback).order("- > modified) > if self.request.get('lat'): > for thing in things: > if thing.geopt: > if thing.geopt.lat < float(self.request.get > ('lat')): > L.append(thing) > Despite the extra iteration this way seems better for the user than > geohash as there are no borders, Now close but different geopt inputs > will output more similar lists than with the geohash where the geohash > border could be e.g. in the middle of a locality. Please let me know > your comments. > best regards, > Niklas --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Google App Engine" group. To post to this group, send email to google-appengine@googlegroups.com 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 -~----------~----~----~----~------~----~------~--~---