You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Adrien Grand (JIRA)" <ji...@apache.org> on 2019/03/12 08:25:00 UTC

[jira] [Commented] (LUCENE-8721) LatLonShapePolygon and LineQuery fail on shared dateline queries

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

Adrien Grand commented on LUCENE-8721:
--------------------------------------

Should we check whether there is an intersection between the range of latitudes of the query and of the box/triangle? The patch seems to only look at longitudes, which means it might return CROSSES when it could return DISJOINT if latitudes don't overlap?

Unrelated to your change but I find the relate logic a bit hard to follow due to how it's split between EdgeTree and its sub classes via 3 methods: relate, internalComponentRelate and componentRelate.

> 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
>
>
> 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-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org