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

Issue with holes in polygons

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Not A Problem
    • None
    • None
    • modules/spatial3d
    • None
    • New

    Description

      Hi,

      It seems the behavior of adding holes to polygons is not behaving well. It seems it is all related to the following method:

      /** Check if a point is within the provided holes.
      *@param point point to check.
      *@return true if the point is within any of the holes.
      */
      protected boolean isWithinHoles(final GeoPoint point) {
      if (holes != null) {
      for (final GeoPolygon hole : holes) {
      if (!hole.isWithin(point))

      { return true; }

      }
      }
      return false;
      }

      The negation in the if clause is wrong. This affects two classes, GeoConvexPolygon and GeoConcavePolygon. I have ready a patch if you think it should be corrected.

      Thanks,

      I.

      Attachments

        Activity

          People

            kwright@metacarta.com Karl Wright
            ivera Ignacio Vera
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: