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

Robert Muir commented on LUCENE-8746:
-------------------------------------

I agree, this thing kinda evolved: starting from a single polygon, to realizing 
that it really needed to handle multipolygon case directly (this is more than 
boolean "or" for cases like Russia where there are shit-tons), to now also 
being used for shapes rather than just point-in-polygon.

Its ripe for refactoring: pretty sure I even created the initial mess with some 
confusing method names like {{componentXYZ()}}

I didn't properly review the source code, but looked over the high level PR, +1

> Make EdgeTree (aka ComponentTree) support different type of components
> ----------------------------------------------------------------------
>
>                 Key: LUCENE-8746
>                 URL: https://issues.apache.org/jira/browse/LUCENE-8746
>             Project: Lucene - Core
>          Issue Type: Improvement
>            Reporter: Ignacio Vera
>            Priority: Major
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> Currently the class {{EdgeTree}} is a bit confusing as it is in reality a 
> tree of components. The inner class {{Edge}} is the one that builds a tree of 
> edges which is used by Polygon2D and Line2D to represent their structure.
> Here is proposed:
> 1) Create a new class called {{ComponentTree}} which is in fact the current 
> {{EdgeTree}}
> 2) Modify {{EdgeTree}} to be in fact the inner class Edge
> 3) Extract a {{Component}} interface so we can have different types of 
> components in the same tree. This allow us to support heterogeneous trees of 
> components.
> 4) Make {{Polygon2D}} and {{Line2D}} instance of the component interface.
> 4) With this change, {{LatLonShapePolygonQuery}} and {{LatLonShapeLineQuery}} 
> can be replaced with one {{LatLonShapeComponentQuery.}}  
>  
>  
>  



--
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