Last modified: 2014-02-12 23:38:27 UTC
Using a distance query like [[Has coordinates::X N, Y E (Z km)]] is, according to the example page, supposed to query for all items with a coordinate property set Z km from the point X N, Y E. But as the algorithm used (seemingly, at least) only defines a "square" of 2Z km * 2Z km centered on X N, Y E, the query sometimes overreaches beyond a distance of Z. A worst case scenario is when an item is placed at a corner of this box, where it considers an item of distance sqrt(2)*Z km from X N, Y E to be a hit. This is an overshoot of over 41%. I'd suggest, without having studied the code in detail, to add a step in the algorithm where you do a proper distance calculation on the hits within the bounding square to filter out the ones that are actually too far away.
Known behaviour. Don't think we can do much better without having proper geospatial indexing, or adding a post-processing step to the query system. Right now you might be able to filter the result set of the query, though if this affects the result set when it was at it's max size (ie the limit), then it will no longer be there, and that is something unexpected.