Ignacio Vera created LUCENE-8850:
------------------------------------

             Summary: Creating a polygon with no area or an invalid area should 
throw an error
                 Key: LUCENE-8850
                 URL: https://issues.apache.org/jira/browse/LUCENE-8850
             Project: Lucene - Core
          Issue Type: Improvement
            Reporter: Ignacio Vera


Working with some polygon data which has some data quality issues I found two 
cases where we can throw an error as we know the polygon is invalid, 

1) We are already computing the signed area on the Polygon constructor, 
therefore if the value is 0, then we know we are building a polygon with no 
area and therefore we can throw an error as it is an invalid polygon.

2) We can calculate the total area of the polygon and holes, if the area is 
lower or equal than 0, then the holes are equal or bigger than the polygon 
which it is an invalid polygon.

In addition I propose anew method to calculate the signed area which requires 
less arithmetic calculations and therefore it introduces less numerical errors.

 



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

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

Reply via email to