[ 
https://issues.apache.org/jira/browse/LUCENE-7909?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16091492#comment-16091492
 ] 

Karl Wright commented on LUCENE-7909:
-------------------------------------

The comment (here from GeoPolygonFactory) is not very clear:

{code}
   * @param holes is a list of polygons representing "holes" in the outside 
polygon.  Holes describe the area outside
   *  each hole as being "in set".  Null == none.
{code}

The meaning is that the polygon(s) in "holes" describe the area OUTSIDE the 
hole.  So the code is right given that.


> Issue with holes in polygons
> ----------------------------
>
>                 Key: LUCENE-7909
>                 URL: https://issues.apache.org/jira/browse/LUCENE-7909
>             Project: Lucene - Core
>          Issue Type: Bug
>          Components: modules/spatial3d
>            Reporter: Ignacio Vera
>            Assignee: Karl Wright
>
> 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.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to