You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@lucene.apache.org by "Ignacio Vera (Jira)" <ji...@apache.org> on 2020/02/24 08:52:00 UTC

[jira] [Commented] (LUCENE-9239) TestLatLonMultiPolygonShapeQueries error with CIRCLE queries

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

Ignacio Vera commented on LUCENE-9239:
--------------------------------------

The current implementation uses cartesian geometry to find the closest point from a line to a point (our edges are cartesian!). Then it uses the spherical geometry to calculate the distance between this two points. This error is a side effect of this approach. If we look at it graphically:

!screenshot-1.png|width=467,height=251!


The center of the circle is the point outside of the polygon. The two points in the polygon are the closest points calculated using the cartesian geometry. One point belongs to the edge of the polygon, and the second one belongs to the edge created from the tessellation (the edge does not belong to the original polygon).

The issue here is that when calculating the haversin distance to those points, the one belonging to polygon edge is not within distance but the second one, belonging to the internal edge is within distance. This tricks the contain login.

I think we can change the contains logic to mitigate this effect by:

* We should only return that a triangle is CANDIDATE if the center of the circle is inside the triangle.
* We can ignore the edges that do not belong to the original polygon (The above logic will provide if a polygon is CANDIDATE)


 

> TestLatLonMultiPolygonShapeQueries error with CIRCLE queries
> ------------------------------------------------------------
>
>                 Key: LUCENE-9239
>                 URL: https://issues.apache.org/jira/browse/LUCENE-9239
>             Project: Lucene - Core
>          Issue Type: Bug
>            Reporter: Ignacio Vera
>            Priority: Major
>         Attachments: screenshot-1.png
>
>
> The failure can be reproduced with:
> {code}
> ant test  -Dtestcase=TestLatLonMultiPolygonShapeQueries -Dtests.method=testRandomBig -Dtests.seed=844FBD6099212BE8 -Dtests.multiplier=2 -Dtests.nightly=true -Dtests.slow=true -Dtests.linedocsfile=/home/jenkins/jenkins-slave/workspace/Lucene-Solr-NightlyTests-8.x/test-data/enwiki.random.lines.txt -Dtests.locale=sr-BA -Dtests.timezone=Asia/Ashkhabad -Dtests.asserts=true -Dtests.file.encoding=UTF-8
> {code}
> The error message:
> {code}
> query=LatLonShapeQuery: field=shape:[CIRCLE([78.01086555431775,0.9513280497489234] radius = 1097753.4254892308 meters),] docID=43632
>   shape=[[-22.350172194105966, 49.931598911327825] [90.0, 49.931598911327825] [90.0, 51.408196891378765] [-22.350172194105966, 51.408196891378765] [-22.350172194105966, 49.931598911327825] , [76.12283244781244, -28.218674420982268] [81.7520930577503, -28.218674420982268] [81.7520930577503, -1.0286448278003566E-32] [76.12283244781244, -1.0286448278003566E-32] [76.12283244781244, -28.218674420982268] ]
>   deleted?=false  distanceQuery=CIRCLE([78.01086555431775,0.9513280497489234] radius = 1097753.4254892308 meters)
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org