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

Nicholas Knize commented on LUCENE-8721:
----------------------------------------

bq. Should we check whether there is an intersection between the range of 
latitudes of the query and of the box/triangle?

Yes. I posted the wrong patch. Corrected in the new one.

bq. the coordinates are on the encoded space.

The coordinates are in the decoded space but they have been quantized so I've 
corrected maxLon to use its quantized variant.

bq. +1 to simplify the logic on EdgeTree. It is trivial to merge the methods 
relate &  internalComponentRelate and it makes sense. I will open an issue.

+1 to simplify. I went ahead and started by merging the two methods in this 
patch since it made sense. The new issue can explore further refactoring the 
logic for clarity.

> LatLonShapePolygon and LineQuery fail on shared dateline queries
> ----------------------------------------------------------------
>
>                 Key: LUCENE-8721
>                 URL: https://issues.apache.org/jira/browse/LUCENE-8721
>             Project: Lucene - Core
>          Issue Type: Bug
>            Reporter: Nicholas Knize
>            Priority: Major
>         Attachments: LUCENE-8721.patch, LUCENE-8721.patch
>
>
> Indexed shapes should be returned with search geometries that share the 
> dateline on the opposite hemisphere. 
> For example:
> {code:java}
>   public void testSharedDateline() throws Exception {
>     //// index /////
>     Directory dir = newDirectory();
>     RandomIndexWriter w = new RandomIndexWriter(random(), dir);
>     Document doc = new Document();
>     // index western hemisphere geometry
>     Polygon indexPoly = new Polygon(
>         new double[] {-7.5d, 15d, 15d, 0d, -7.5d},
>         new double[] {-180d, -180d, -176d, -176d, -180d}
>     );
>     Field[] fields = LatLonShape.createIndexableFields("test", indexPoly);
>     for (Field f : fields) {
>       doc.add(f);
>     }
>     w.addDocument(doc);
>     w.forceMerge(1);
>     ///// search //////
>     IndexReader reader = w.getReader();
>     w.close();
>     IndexSearcher searcher = newSearcher(reader);
>     // search w/ eastern hemisphere geometry that shares the dateline
>     Polygon searchPoly = new Polygon(new double[] {-7.5d, 15d, 15d, 0d, 
> -7.5d},
>         new double[] {180d, 180d, 170d, 170d, 180d});
>     Query q = LatLonShape.newPolygonQuery("test", QueryRelation.INTERSECTS, 
> searchPoly);
>     assertEquals(1, searcher.count(q));
>     IOUtils.close(w, reader, dir);
>   }
> {code}



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