On Thu, Apr 9, 2009 at 3:17 PM, pablo platt <[email protected]> wrote: > How do I query this db? > For example, if I want to find all records in a distance <= 1.5KM from a > (lat, lng) point.
find all quadtiles within 1.5km from a point by using the fact that they're in a regular grid. query the db to find all the records having a tilecode in that list. finally, add a filter to remove any points which might be in one of the tiles but is >1.5km from your point. have a look at how OSM server builds the query for bounding boxes: http://trac.openstreetmap.org/browser/sites/rails_port/lib/osm.rb#L241 http://trac.openstreetmap.org/browser/sites/rails_port/lib/quad_tile.rb#L44 cheers, matt _______________________________________________ dev mailing list [email protected] http://lists.openstreetmap.org/listinfo/dev

