You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by nk...@apache.org on 2018/09/20 15:44:14 UTC
lucene-solr:branch_7x: LUCENE-8454: Fix tessellator to use original
polygon vertices.
Repository: lucene-solr
Updated Branches:
refs/heads/branch_7x 99df2bd2f -> 0c7543387
LUCENE-8454: Fix tessellator to use original polygon vertices.
Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/0c754338
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/0c754338
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/0c754338
Branch: refs/heads/branch_7x
Commit: 0c7543387572eff9a52e733d03f8d95e352be0f8
Parents: 99df2bd
Author: Nicholas Knize <nk...@gmail.com>
Authored: Thu Sep 20 10:39:24 2018 -0500
Committer: Nicholas Knize <nk...@gmail.com>
Committed: Thu Sep 20 10:43:47 2018 -0500
----------------------------------------------------------------------
.../java/org/apache/lucene/geo/Tessellator.java | 4 ++--
.../document/TestLatLonPolygonShapeQueries.java | 6 -----
.../apache/lucene/document/TestLatLonShape.java | 23 ++++++++++++++++++++
3 files changed, 25 insertions(+), 8 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/0c754338/lucene/sandbox/src/java/org/apache/lucene/geo/Tessellator.java
----------------------------------------------------------------------
diff --git a/lucene/sandbox/src/java/org/apache/lucene/geo/Tessellator.java b/lucene/sandbox/src/java/org/apache/lucene/geo/Tessellator.java
index a03e57c..9a63ad2 100644
--- a/lucene/sandbox/src/java/org/apache/lucene/geo/Tessellator.java
+++ b/lucene/sandbox/src/java/org/apache/lucene/geo/Tessellator.java
@@ -800,12 +800,12 @@ final public class Tessellator {
/** get the x value */
public final double getX() {
- return x;
+ return polygon.getPolyLon(vrtxIdx);
}
/** get the y value */
public final double getY() {
- return y;
+ return polygon.getPolyLat(vrtxIdx);
}
/** get the longitude value */
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/0c754338/lucene/sandbox/src/test/org/apache/lucene/document/TestLatLonPolygonShapeQueries.java
----------------------------------------------------------------------
diff --git a/lucene/sandbox/src/test/org/apache/lucene/document/TestLatLonPolygonShapeQueries.java b/lucene/sandbox/src/test/org/apache/lucene/document/TestLatLonPolygonShapeQueries.java
index 9825e6a..ce76a82 100644
--- a/lucene/sandbox/src/test/org/apache/lucene/document/TestLatLonPolygonShapeQueries.java
+++ b/lucene/sandbox/src/test/org/apache/lucene/document/TestLatLonPolygonShapeQueries.java
@@ -99,10 +99,4 @@ public class TestLatLonPolygonShapeQueries extends BaseLatLonShapeTestCase {
return queryRelation == QueryRelation.INTERSECTS ? false : true;
}
}
-
- @Override
- @AwaitsFix(bugUrl = "https://issues.apache.org/jira/browse/LUCENE-8454")
- public void testRandomMedium() throws Exception {
- super.testRandomMedium();
- }
}
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/0c754338/lucene/sandbox/src/test/org/apache/lucene/document/TestLatLonShape.java
----------------------------------------------------------------------
diff --git a/lucene/sandbox/src/test/org/apache/lucene/document/TestLatLonShape.java b/lucene/sandbox/src/test/org/apache/lucene/document/TestLatLonShape.java
index 2f6e5e1..9a125ba 100644
--- a/lucene/sandbox/src/test/org/apache/lucene/document/TestLatLonShape.java
+++ b/lucene/sandbox/src/test/org/apache/lucene/document/TestLatLonShape.java
@@ -200,4 +200,27 @@ public class TestLatLonShape extends LuceneTestCase {
IOUtils.close(reader, dir);
}
+
+ public void testLUCENE8454() throws Exception {
+ Directory dir = newDirectory();
+ RandomIndexWriter writer = new RandomIndexWriter(random(), dir);
+
+ Polygon poly = new Polygon(new double[] {-1.490648725633769E-132d, 90d, 90d, -1.490648725633769E-132d},
+ new double[] {0d, 0d, 180d, 0d});
+
+ Document document = new Document();
+ addPolygonsToDoc(FIELDNAME, document, poly);
+ writer.addDocument(document);
+
+ ///// search //////
+ IndexReader reader = writer.getReader();
+ writer.close();
+ IndexSearcher searcher = newSearcher(reader);
+
+ // search a bbox in the hole
+ Query q = LatLonShape.newBoxQuery(FIELDNAME, QueryRelation.DISJOINT,-29.46555603761226d, 0.0d, 8.381903171539307E-8d, 0.9999999403953552d);
+ assertEquals(0, searcher.count(q));
+
+ IOUtils.close(reader, dir);
+ }
}