Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 39D03200D61 for ; Mon, 4 Dec 2017 18:48:51 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 387AE160C1C; Mon, 4 Dec 2017 17:48:51 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 0C820160C05 for ; Mon, 4 Dec 2017 18:48:49 +0100 (CET) Received: (qmail 72099 invoked by uid 500); 4 Dec 2017 17:48:46 -0000 Mailing-List: contact commits-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@lucene.apache.org Delivered-To: mailing list commits@lucene.apache.org Received: (qmail 71529 invoked by uid 99); 4 Dec 2017 17:48:46 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 04 Dec 2017 17:48:46 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id BB104F60FD; Mon, 4 Dec 2017 17:48:45 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: ab@apache.org To: commits@lucene.apache.org Date: Mon, 04 Dec 2017 17:49:06 -0000 Message-Id: <6c6f40bf43644ab8bfd1767dd5965947@git.apache.org> In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [22/50] lucene-solr:jira/solr-11458-2: LUCENE-8067: Refactor exact circle tests. Committed on behalf of Ignacio Vera. archived-at: Mon, 04 Dec 2017 17:48:51 -0000 LUCENE-8067: Refactor exact circle tests. Committed on behalf of Ignacio Vera. Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/cabaafa1 Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/cabaafa1 Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/cabaafa1 Branch: refs/heads/jira/solr-11458-2 Commit: cabaafa1949cc42fa683268f3d1d77ddd9c2dfdd Parents: 360902e Author: Karl Wright Authored: Tue Nov 28 03:01:05 2017 -0500 Committer: Karl Wright Committed: Tue Nov 28 03:01:05 2017 -0500 ---------------------------------------------------------------------- .../lucene/spatial3d/geom/GeoCircleTest.java | 148 --------------- .../spatial3d/geom/GeoExactCircleTest.java | 190 +++++++++++++++++++ .../geom/RandomGeoShapeRelationshipTest.java | 25 --- 3 files changed, 190 insertions(+), 173 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/cabaafa1/lucene/spatial3d/src/test/org/apache/lucene/spatial3d/geom/GeoCircleTest.java ---------------------------------------------------------------------- diff --git a/lucene/spatial3d/src/test/org/apache/lucene/spatial3d/geom/GeoCircleTest.java b/lucene/spatial3d/src/test/org/apache/lucene/spatial3d/geom/GeoCircleTest.java index 1e6a1d5..95d2a4c 100755 --- a/lucene/spatial3d/src/test/org/apache/lucene/spatial3d/geom/GeoCircleTest.java +++ b/lucene/spatial3d/src/test/org/apache/lucene/spatial3d/geom/GeoCircleTest.java @@ -16,51 +16,10 @@ */ package org.apache.lucene.spatial3d.geom; -import com.carrotsearch.randomizedtesting.annotations.Repeat; import org.apache.lucene.util.LuceneTestCase; import org.junit.Test; public class GeoCircleTest extends LuceneTestCase { - - @Test - public void testExactCircleLUCENE8054() { - // [junit4] > Throwable #1: java.lang.AssertionError: circle1: GeoExactCircle: - // {planetmodel=PlanetModel.WGS84, center=[lat=-1.2097332228999564, lon=0.749061883738567([X=0.25823775418663625, Y=0.2401212674846636, Z=-0.9338185278804293])], - // radius=0.20785254459485322(11.909073566339822), accuracy=6.710701666727661E-9} - // [junit4] > circle2: GeoExactCircle: {planetmodel=PlanetModel.WGS84, center=[lat=-1.2097332228999564, lon=0.749061883738567([X=0.25823775418663625, Y=0.2401212674846636, Z=-0.9338185278804293])], - // radius=0.20701584142315682(11.861134005896407), accuracy=1.0E-5} - final GeoCircle c1 = new GeoExactCircle(PlanetModel.WGS84, -1.2097332228999564, 0.749061883738567, 0.20785254459485322, 6.710701666727661E-9); - final GeoCircle c2 = new GeoExactCircle(PlanetModel.WGS84, -1.2097332228999564, 0.749061883738567, 0.20701584142315682, 1.0E-5); - assertTrue("cannot be disjoint", c1.getRelationship(c2) != GeoArea.DISJOINT); - } - - @Test - public void testExactCircle() { - GeoCircle c; - GeoPoint gp; - - // Construct a variety of circles to see how many actual planes are involved - c = new GeoExactCircle(PlanetModel.WGS84, 0.0, 0.0, 0.1, 1e-6); - gp = new GeoPoint(PlanetModel.WGS84, 0.0, 0.2); - assertTrue(!c.isWithin(gp)); - gp = new GeoPoint(PlanetModel.WGS84, 0.0, 0.0); - assertTrue(c.isWithin(gp)); - - c = new GeoExactCircle(PlanetModel.WGS84, 0.1, 0.0, 0.1, 1e-6); - - c = new GeoExactCircle(PlanetModel.WGS84, 0.2, 0.0, 0.1, 1e-6); - - c = new GeoExactCircle(PlanetModel.WGS84, 0.3, 0.0, 0.1, 1e-6); - - c = new GeoExactCircle(PlanetModel.WGS84, 0.4, 0.0, 0.1, 1e-6); - - c = new GeoExactCircle(PlanetModel.WGS84, Math.PI * 0.5, 0.0, 0.1, 1e-6); - gp = new GeoPoint(PlanetModel.WGS84, Math.PI * 0.5 - 0.2, 0.0); - assertTrue(!c.isWithin(gp)); - gp = new GeoPoint(PlanetModel.WGS84, Math.PI * 0.5, 0.0); - assertTrue(c.isWithin(gp)); - - } @Test public void testCircleDistance() { @@ -459,111 +418,4 @@ public class GeoCircleTest extends LuceneTestCase { assert gc.isWithin(gp)?solid.isWithin(gp):true; } - - @Test - @Repeat(iterations = 100) - public void RandomPointBearingWGS84Test(){ - PlanetModel planetModel = PlanetModel.WGS84; - RandomGeo3dShapeGenerator generator = new RandomGeo3dShapeGenerator(); - GeoPoint center = generator.randomGeoPoint(planetModel); - double radius = random().nextDouble() * Math.PI; - checkBearingPoint(planetModel, center, radius, 0); - checkBearingPoint(planetModel, center, radius, 0.5 * Math.PI); - checkBearingPoint(planetModel, center, radius, Math.PI); - checkBearingPoint(planetModel, center, radius, 1.5 * Math.PI); - } - - @Test - @Repeat(iterations = 10000) - public void RandomPointBearingCardinalTest(){ - double ab = random().nextDouble() * 0.6 + 0.9; - double c = random().nextDouble() * 0.6 + 0.9 ; - PlanetModel planetModel = new PlanetModel(ab, c); - RandomGeo3dShapeGenerator generator = new RandomGeo3dShapeGenerator(); - GeoPoint center = generator.randomGeoPoint(planetModel); - double radius = random().nextDouble() * 0.9 * Math.PI; - checkBearingPoint(planetModel, center, radius, 0); - checkBearingPoint(planetModel, center, radius, 0.5 * Math.PI); - checkBearingPoint(planetModel, center, radius, Math.PI); - checkBearingPoint(planetModel, center, radius, 1.5 * Math.PI); - } - - private void checkBearingPoint(PlanetModel planetModel, GeoPoint center, double radius, double bearingAngle) { - GeoPoint point = planetModel.surfacePointOnBearing(center, radius, bearingAngle); - double surfaceDistance = planetModel.surfaceDistance(center, point); - assertTrue(planetModel.toString() + " " + Double.toString(surfaceDistance - radius) + " " + Double.toString(radius), surfaceDistance - radius < Vector.MINIMUM_ANGULAR_RESOLUTION); - } - - @Test - public void exactCircleLargeTest(){ - boolean success = true; - try { - GeoCircle circle = GeoCircleFactory.makeExactGeoCircle(new PlanetModel(0.5, 0.7), 0.25 * Math.PI, 0,0.35 * Math.PI, 1e-12); - } catch (IllegalArgumentException e) { - success = false; - } - assertTrue(success); - success = false; - try { - GeoCircle circle = GeoCircleFactory.makeExactGeoCircle(PlanetModel.WGS84, 0.25 * Math.PI, 0,0.9996 * Math.PI, 1e-12); - } catch (IllegalArgumentException e) { - success = true; - } - assertTrue(success); - } - - @Test - public void testLUCENE8054(){ - GeoCircle circle1 = GeoCircleFactory.makeExactGeoCircle(PlanetModel.WGS84, -1.0394053553992673, -1.9037325881389144, 1.1546166170607672, 4.231100485201301E-4); - GeoCircle circle2 = GeoCircleFactory.makeExactGeoCircle(PlanetModel.WGS84, -1.3165961602008989, -1.887137823746273, 1.432516663588956, 3.172052880854355E-4); - // Relationship between circles must be different than DISJOINT as centers are closer than the radius. - int rel = circle1.getRelationship(circle2); - assertTrue(rel != GeoArea.DISJOINT); - } - - @Test - public void testLUCENE8056(){ - GeoCircle circle = GeoCircleFactory.makeExactGeoCircle(PlanetModel.WGS84, 0.647941905154693, 0.8542472362428436, 0.8917883700569315, 1.2173787103955335E-8); - GeoBBox bBox = GeoBBoxFactory.makeGeoBBox(PlanetModel.WGS84, 0.5890486225480862, 0.4908738521234052, 1.9634954084936207, 2.159844949342983); - //Center iis out of the shape - assertFalse(circle.isWithin(bBox.getCenter())); - //Edge point is in the shape - assertTrue(circle.isWithin(bBox.getEdgePoints()[0])); - //Shape should intersect!!! - assertTrue(bBox.getRelationship(circle) == GeoArea.OVERLAPS); - } - - @Test - public void testExactCircleBounds() { - - GeoPoint center = new GeoPoint(PlanetModel.WGS84, 0, 0); - // Construct four cardinal points, and then we'll build the first two planes - final GeoPoint northPoint = PlanetModel.WGS84.surfacePointOnBearing(center, 1, 0.0); - final GeoPoint southPoint = PlanetModel.WGS84.surfacePointOnBearing(center, 1, Math.PI); - final GeoPoint eastPoint = PlanetModel.WGS84.surfacePointOnBearing(center, 1, Math.PI * 0.5); - final GeoPoint westPoint = PlanetModel.WGS84.surfacePointOnBearing(center, 1, Math.PI * 1.5); - - GeoCircle circle = GeoCircleFactory.makeExactGeoCircle(PlanetModel.WGS84, 0, 0, 1, 1e-6); - LatLonBounds bounds = new LatLonBounds(); - circle.getBounds(bounds); - assertEquals(northPoint.getLatitude(), bounds.getMaxLatitude(), 1e-2); - assertEquals(southPoint.getLatitude(), bounds.getMinLatitude(), 1e-2); - assertEquals(westPoint.getLongitude(), bounds.getLeftLongitude(), 1e-2); - assertEquals(eastPoint.getLongitude(), bounds.getRightLongitude(), 1e-2); - } - - @Test - public void testLUCENE8065(){ - //boolean isIllegal = false; - //try { - GeoCircle circle1 = GeoCircleFactory.makeExactGeoCircle(PlanetModel.WGS84, 0.03186456479560385, -2.2254294002683617, 1.5702573535090856, 8.184299676008562E-6); - //} catch (IllegalArgumentException e) { - // isIllegal = true; - //} - //assertTrue(isIllegal); - - GeoCircle circle2 = GeoCircleFactory.makeExactGeoCircle(PlanetModel.WGS84, 0.03186456479560385, -2.2254294002683617 , 1.5698163157923914, 1.0E-5); - assertTrue(circle1.getRelationship(circle2) != GeoArea.DISJOINT); - - } } http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/cabaafa1/lucene/spatial3d/src/test/org/apache/lucene/spatial3d/geom/GeoExactCircleTest.java ---------------------------------------------------------------------- diff --git a/lucene/spatial3d/src/test/org/apache/lucene/spatial3d/geom/GeoExactCircleTest.java b/lucene/spatial3d/src/test/org/apache/lucene/spatial3d/geom/GeoExactCircleTest.java new file mode 100644 index 0000000..3e25bce --- /dev/null +++ b/lucene/spatial3d/src/test/org/apache/lucene/spatial3d/geom/GeoExactCircleTest.java @@ -0,0 +1,190 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.lucene.spatial3d.geom; + +import com.carrotsearch.randomizedtesting.annotations.Repeat; +import org.junit.Test; + +/** + * Tests for GeoExactCircle. + */ +public class GeoExactCircleTest extends RandomGeo3dShapeGenerator{ + + @Test + public void testExactCircle() { + GeoCircle c; + GeoPoint gp; + + // Construct a variety of circles to see how many actual planes are involved + c = new GeoExactCircle(PlanetModel.WGS84, 0.0, 0.0, 0.1, 1e-6); + gp = new GeoPoint(PlanetModel.WGS84, 0.0, 0.2); + assertTrue(!c.isWithin(gp)); + gp = new GeoPoint(PlanetModel.WGS84, 0.0, 0.0); + assertTrue(c.isWithin(gp)); + + c = new GeoExactCircle(PlanetModel.WGS84, 0.1, 0.0, 0.1, 1e-6); + + c = new GeoExactCircle(PlanetModel.WGS84, 0.2, 0.0, 0.1, 1e-6); + + c = new GeoExactCircle(PlanetModel.WGS84, 0.3, 0.0, 0.1, 1e-6); + + c = new GeoExactCircle(PlanetModel.WGS84, 0.4, 0.0, 0.1, 1e-6); + + c = new GeoExactCircle(PlanetModel.WGS84, Math.PI * 0.5, 0.0, 0.1, 1e-6); + gp = new GeoPoint(PlanetModel.WGS84, Math.PI * 0.5 - 0.2, 0.0); + assertTrue(!c.isWithin(gp)); + gp = new GeoPoint(PlanetModel.WGS84, Math.PI * 0.5, 0.0); + assertTrue(c.isWithin(gp)); + } + + @Test + @Repeat(iterations = 100) + public void RandomPointBearingWGS84Test(){ + PlanetModel planetModel = PlanetModel.WGS84; + RandomGeo3dShapeGenerator generator = new RandomGeo3dShapeGenerator(); + GeoPoint center = generator.randomGeoPoint(planetModel); + double radius = random().nextDouble() * Math.PI; + checkBearingPoint(planetModel, center, radius, 0); + checkBearingPoint(planetModel, center, radius, 0.5 * Math.PI); + checkBearingPoint(planetModel, center, radius, Math.PI); + checkBearingPoint(planetModel, center, radius, 1.5 * Math.PI); + } + + @Test + @Repeat(iterations = 100) + public void RandomPointBearingCardinalTest(){ + double ab = random().nextDouble() * 0.6 + 0.9; + double c = random().nextDouble() * 0.6 + 0.9 ; + PlanetModel planetModel = new PlanetModel(ab, c); + GeoPoint center = randomGeoPoint(planetModel); + double radius = random().nextDouble() * 0.9 * Math.PI; + checkBearingPoint(planetModel, center, radius, 0); + checkBearingPoint(planetModel, center, radius, 0.5 * Math.PI); + checkBearingPoint(planetModel, center, radius, Math.PI); + checkBearingPoint(planetModel, center, radius, 1.5 * Math.PI); + } + + private void checkBearingPoint(PlanetModel planetModel, GeoPoint center, double radius, double bearingAngle) { + GeoPoint point = planetModel.surfacePointOnBearing(center, radius, bearingAngle); + double surfaceDistance = planetModel.surfaceDistance(center, point); + assertTrue(planetModel.toString() + " " + Double.toString(surfaceDistance - radius) + " " + Double.toString(radius), surfaceDistance - radius < Vector.MINIMUM_ANGULAR_RESOLUTION); + } + + @Test + public void testExactCircleBounds() { + + GeoPoint center = new GeoPoint(PlanetModel.WGS84, 0, 0); + // Construct four cardinal points, and then we'll build the first two planes + final GeoPoint northPoint = PlanetModel.WGS84.surfacePointOnBearing(center, 1, 0.0); + final GeoPoint southPoint = PlanetModel.WGS84.surfacePointOnBearing(center, 1, Math.PI); + final GeoPoint eastPoint = PlanetModel.WGS84.surfacePointOnBearing(center, 1, Math.PI * 0.5); + final GeoPoint westPoint = PlanetModel.WGS84.surfacePointOnBearing(center, 1, Math.PI * 1.5); + + GeoCircle circle = GeoCircleFactory.makeExactGeoCircle(PlanetModel.WGS84, 0, 0, 1, 1e-6); + LatLonBounds bounds = new LatLonBounds(); + circle.getBounds(bounds); + assertEquals(northPoint.getLatitude(), bounds.getMaxLatitude(), 1e-2); + assertEquals(southPoint.getLatitude(), bounds.getMinLatitude(), 1e-2); + assertEquals(westPoint.getLongitude(), bounds.getLeftLongitude(), 1e-2); + assertEquals(eastPoint.getLongitude(), bounds.getRightLongitude(), 1e-2); + } + + @Test + public void exactCircleLargeTest(){ + boolean success = true; + try { + GeoCircle circle = GeoCircleFactory.makeExactGeoCircle(new PlanetModel(0.5, 0.7), 0.25 * Math.PI, 0,0.35 * Math.PI, 1e-12); + } catch (IllegalArgumentException e) { + success = false; + } + assertTrue(success); + success = false; + try { + GeoCircle circle = GeoCircleFactory.makeExactGeoCircle(PlanetModel.WGS84, 0.25 * Math.PI, 0,0.9996 * Math.PI, 1e-12); + } catch (IllegalArgumentException e) { + success = true; + } + assertTrue(success); + } + + /** + * in LUCENE-8054 we have problems with exact circles that have + * edges that are close together. This test creates those circles with the same + * center and slightly different radius. + */ + @Test + @Repeat(iterations = 100) + public void testRandom_LUCENE8054() { + PlanetModel planetModel = PlanetModel.WGS84; + GeoCircle circle1 = (GeoCircle) randomGeoAreaShape(EXACT_CIRCLE, planetModel); + // new radius, a bit smaller than the generated one! + double radius = circle1.getRadius() * (1 - 0.01 * random().nextDouble()); + //circle with same center and new radius + GeoCircle circle2 = GeoCircleFactory.makeExactGeoCircle(planetModel, + circle1.getCenter().getLatitude(), + circle1.getCenter().getLongitude(), + radius, 1e-5 ); + StringBuilder b = new StringBuilder(); + b.append("circle1: " + circle1 + "\n"); + b.append("circle2: " + circle2); + //It cannot be disjoint, same center! + assertTrue(b.toString(), circle1.getRelationship(circle2) != GeoArea.DISJOINT); + } + + @Test + public void testLUCENE8054(){ + GeoCircle circle1 = GeoCircleFactory.makeExactGeoCircle(PlanetModel.WGS84, -1.0394053553992673, -1.9037325881389144, 1.1546166170607672, 4.231100485201301E-4); + GeoCircle circle2 = GeoCircleFactory.makeExactGeoCircle(PlanetModel.WGS84, -1.3165961602008989, -1.887137823746273, 1.432516663588956, 3.172052880854355E-4); + // Relationship between circles must be different than DISJOINT as centers are closer than the radius. + int rel = circle1.getRelationship(circle2); + assertTrue(rel != GeoArea.DISJOINT); + } + + @Test + public void testLUCENE8056(){ + GeoCircle circle = GeoCircleFactory.makeExactGeoCircle(PlanetModel.WGS84, 0.647941905154693, 0.8542472362428436, 0.8917883700569315, 1.2173787103955335E-8); + GeoBBox bBox = GeoBBoxFactory.makeGeoBBox(PlanetModel.WGS84, 0.5890486225480862, 0.4908738521234052, 1.9634954084936207, 2.159844949342983); + //Center iis out of the shape + assertFalse(circle.isWithin(bBox.getCenter())); + //Edge point is in the shape + assertTrue(circle.isWithin(bBox.getEdgePoints()[0])); + //Shape should intersect!!! + assertTrue(bBox.getRelationship(circle) == GeoArea.OVERLAPS); + } + + @Test + public void testExactCircleLUCENE8054() { + // [junit4] > Throwable #1: java.lang.AssertionError: circle1: GeoExactCircle: + // {planetmodel=PlanetModel.WGS84, center=[lat=-1.2097332228999564, lon=0.749061883738567([X=0.25823775418663625, Y=0.2401212674846636, Z=-0.9338185278804293])], + // radius=0.20785254459485322(11.909073566339822), accuracy=6.710701666727661E-9} + // [junit4] > circle2: GeoExactCircle: {planetmodel=PlanetModel.WGS84, center=[lat=-1.2097332228999564, lon=0.749061883738567([X=0.25823775418663625, Y=0.2401212674846636, Z=-0.9338185278804293])], + // radius=0.20701584142315682(11.861134005896407), accuracy=1.0E-5} + final GeoCircle c1 = new GeoExactCircle(PlanetModel.WGS84, -1.2097332228999564, 0.749061883738567, 0.20785254459485322, 6.710701666727661E-9); + final GeoCircle c2 = new GeoExactCircle(PlanetModel.WGS84, -1.2097332228999564, 0.749061883738567, 0.20701584142315682, 1.0E-5); + assertTrue("cannot be disjoint", c1.getRelationship(c2) != GeoArea.DISJOINT); + } + + @Test + public void testLUCENE8065(){ + //Circle planes are convex + GeoCircle circle1 = GeoCircleFactory.makeExactGeoCircle(PlanetModel.WGS84, 0.03186456479560385, -2.2254294002683617, 1.5702573535090856, 8.184299676008562E-6); + GeoCircle circle2 = GeoCircleFactory.makeExactGeoCircle(PlanetModel.WGS84, 0.03186456479560385, -2.2254294002683617 , 1.5698163157923914, 1.0E-5); + assertTrue(circle1.getRelationship(circle2) != GeoArea.DISJOINT); + } + +} http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/cabaafa1/lucene/spatial3d/src/test/org/apache/lucene/spatial3d/geom/RandomGeoShapeRelationshipTest.java ---------------------------------------------------------------------- diff --git a/lucene/spatial3d/src/test/org/apache/lucene/spatial3d/geom/RandomGeoShapeRelationshipTest.java b/lucene/spatial3d/src/test/org/apache/lucene/spatial3d/geom/RandomGeoShapeRelationshipTest.java index 48de9fd..9c791b7 100644 --- a/lucene/spatial3d/src/test/org/apache/lucene/spatial3d/geom/RandomGeoShapeRelationshipTest.java +++ b/lucene/spatial3d/src/test/org/apache/lucene/spatial3d/geom/RandomGeoShapeRelationshipTest.java @@ -285,29 +285,4 @@ public class RandomGeoShapeRelationshipTest extends RandomGeo3dShapeGenerator { assertEquals(b.toString(), GeoArea.OVERLAPS, rel); } } - - /** - * in LUCENE-8054 we have problems with exact circles that have - * edges that are close together. This test creates those circles with the same - * center and slightly different radius. It is able to reproduce - * the problem. - */ - @Test - @Repeat(iterations = 100) - public void testRandom_LUCENE8054() { - PlanetModel planetModel = PlanetModel.WGS84; - GeoCircle circle1 = (GeoCircle) randomGeoAreaShape(EXACT_CIRCLE, planetModel); - // new radius, a bit smaller than the generated one! - double radius = circle1.getRadius() * (1 - 0.01 * random().nextDouble()); - //circle with same center and new radius - GeoCircle circle2 = GeoCircleFactory.makeExactGeoCircle(planetModel, - circle1.getCenter().getLatitude(), - circle1.getCenter().getLongitude(), - radius, 1e-5 ); - StringBuilder b = new StringBuilder(); - b.append("circle1: " + circle1 + "\n"); - b.append("circle2: " + circle2); - //It cannot be disjoint, same center! - assertTrue(b.toString(), circle1.getRelationship(circle2) != GeoArea.DISJOINT); - } }