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

Karl Wright commented on LUCENE-8133:
-------------------------------------

Ok, what is happening is that the polygon tiling code "tries" a few things to 
see if they work out.  It's expecting the GeoConvexPolygon construction to be 
successful when it does this.  The problem is that sometimes the constructor 
throws an IllegalArgumentException -- not something the code was expecting.

The solution seems to be to just catch the exception and signal that the tiling 
can't be created:

{code}
      try {
        // No holes, for test
        final GeoPolygon testPolygon = new GeoConvexPolygon(planetModel, 
points, null, internalEdges, returnIsInternal);
        if (testPolygon.isWithin(testPoint)) {
          return null;
        }
      } catch (IllegalArgumentException e) {
        return null;
      }
{code}

[~ivera], can you extend your test case to verify that the shape produced works 
properly?  If that passes I will commit my fix.


> Small polygon fails with misleading error:  Convex polygon has a side that is 
> more than 180 degrees
> ---------------------------------------------------------------------------------------------------
>
>                 Key: LUCENE-8133
>                 URL: https://issues.apache.org/jira/browse/LUCENE-8133
>             Project: Lucene - Core
>          Issue Type: Bug
>          Components: modules/spatial3d
>            Reporter: Ignacio Vera
>            Assignee: Karl Wright
>            Priority: Major
>         Attachments: LUCENE-8133.patch, image-2018-01-22-12-52-21-656.png, 
> image-2018-01-22-12-55-17-096.png
>
>
> Hi [~karl wright],
> I am trying to create a polygon that is valid but I am getting an error which 
> is probably incorrect. I think it is a problem with precision.
> I will attach a test.
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org

Reply via email to