Hello :) Has anyone ever done geo-searching with xapian? My thought for now are like this: Add the following values to a document # - (lat + 90) * 1_000_000 (to aleviate float problems) # - (lon + 180) * 1_000_000 (to aleviate float problems) Then when a user picks a range we do the same transforms and search as two ranges with prefix. Does that sound reasonable? has anyone else done something similar? should I perhaps in stead write a custom value range class to do this? - andreas
Andreas Marienborg schrieb:> Hello :) > > Has anyone ever done geo-searching with xapian? >Salve! For geolocation you will want to use a HTM (Hierarchical Triangular Mesh) library: http://www.sdss.jhu.edu/htm/ Markus
On Fri, Oct 17, 2008 at 11:23:49AM +0200, Andreas Marienborg wrote:> Add the following values to a document > # - (lat + 90) * 1_000_000 (to aleviate float problems) > # - (lon + 180) * 1_000_000 (to aleviate float problems)Incidentally, there's no need to work in integers here - just use Xapian::sortable_serialise() which compactly encodes floating point numbers as strings which sort in the same order as the floating point numbers do. It's designed for such purposes. Cheers, Olly