[Xapian-discuss] Geolocation

Olly Betts olly at survex.com
Tue Oct 21 06:14:29 BST 2008


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



More information about the Xapian-discuss mailing list