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

CartesianPolyFilterBuilder doesn't handle edge case around the 180 meridian

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 2.9, 2.9.1, 2.9.2, 3.0, 3.0.1
    • 3.1, 4.0-ALPHA
    • modules/spatial
    • None
    • New

    Description

      Test case:
      Points all around the globe, plus two points at 0, 179.9 and 0,-179.9 (on each side of the meridian). Then, do a Cartesian Tier filter on a point right near those two. It will return all the points when it should just return those two.

      The flawed logic is in the else clause below:

      if (longX2 != 0.0) {
      		//We are around the prime meridian
      		if (longX == 0.0) {
      			longX = longX2;
      			longY = 0.0;
              	shape = getShapeLoop(shape,ctp,latX,longX,latY,longY);
      		} else {//we are around the 180th longitude
      			longX = longX2;
      			longY = -180.0;
      			shape = getShapeLoop(shape,ctp,latY,longY,latX,longX);
      	}
      

      Basically, the Y and X values are transposed. This currently says go from longY (-180) all the way around to longX which is the lower left longitude of the box formed. Instead, it should go from the lower left long to -180.

      Attachments

        1. TEST-2359.patch
          1 kB
          Nicolas Helleringer
        2. LUCENE-2359.patch
          2 kB
          Grant Ingersoll
        3. LUCENE-2359.patch
          19 kB
          Nicolas Helleringer
        4. LUCENE-2359.patch
          12 kB
          Nicolas Helleringer
        5. LUCENE-2359.patch
          12 kB
          Nicolas Helleringer

        Issue Links

          Activity

            People

              gsingers Grant Ingersoll
              gsingers Grant Ingersoll
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: