Uploaded image for project: 'Lucene - Core'
  1. Lucene - Core
  2. LUCENE-4550

For extremely wide shapes (> 180 degrees) distErrPct is not used correctly

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 4.0
    • 4.2, 6.0
    • modules/spatial
    • None
    • New

    Description

      When a shape is given to a PrefixTreeStrategy (index or query time), it needs to know how many levels down the prefix tree to go for a target precision (distErrPct). distErrPct is basically a fraction of the radius of the shape, defaulting to 2.5% (0.0025).

      If the shape presented is extremely wide, > 180 degrees, then the internal calculations in SpatialArgs.calcDistanceFromErrPct(...) will wrongly measure the shape's size as having width < 180 degrees, yielding more accuracy than intended. Given that this happens for unrealistic shape sizes and results in more accuracy, I am flagging this as "minor", but a bug nonetheless. Indeed, this was discovered as a result of someone using lucene-spatial incorrectly, not for an actual shape they have. But in the extreme [erroneous] case they had, they had 566k terms generated, when it should have been ~1k tops.

      Attachments

        Activity

          People

            dsmiley David Smiley
            dsmiley David Smiley
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: