Last modified: 2014-02-12 23:38:27 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T47661, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 45661 - Distance query sometimes overreaches the specified distance
Distance query sometimes overreaches the specified distance
Status: NEW
Product: MediaWiki extensions
Classification: Unclassified
SemanticMaps (Other open bugs)
unspecified
All All
: Unprioritized normal (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-03-03 12:45 UTC by kvolden
Modified: 2014-02-12 23:38 UTC (History)
1 user (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description kvolden 2013-03-03 12:45:26 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.
Comment 1 Jeroen De Dauw 2013-03-04 02:23:10 UTC
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.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links