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 2020/01/22 19:21:44 UTC

[lucene-solr] 01/02: LUCENE-8621: Refactor LatLonShape, XYShape, and all query and utility classes from sandbox to core

This is an automated email from the ASF dual-hosted git repository.

nknize pushed a commit to branch branch_8x
in repository https://gitbox.apache.org/repos/asf/lucene-solr.git

commit bd1bf55b1875a223f9df9943545143af2291f099
Author: Nicholas Knize <nk...@gmail.com>
AuthorDate: Wed Jan 15 13:19:43 2020 -0600

    LUCENE-8621: Refactor LatLonShape, XYShape, and all query and utility classes from sandbox to core
---
 lucene/CHANGES.txt                                 |  2 ++
 .../org/apache/lucene/document/LatLonShape.java    |  2 --
 .../document/LatLonShapeBoundingBoxQuery.java      |  2 --
 .../lucene/document/LatLonShapeLineQuery.java      |  2 --
 .../lucene/document/LatLonShapePointQuery.java     |  2 --
 .../lucene/document/LatLonShapePolygonQuery.java   |  2 --
 .../org/apache/lucene/document/ShapeField.java     | 39 +++++++++++++++++-----
 .../org/apache/lucene/document/ShapeQuery.java     |  4 +--
 .../java/org/apache/lucene/document/XYShape.java   |  2 --
 .../lucene/document/XYShapeBoundingBoxQuery.java   | 32 +++++++++---------
 .../apache/lucene/document/XYShapeLineQuery.java   |  3 +-
 .../apache/lucene/document/XYShapePointQuery.java  |  3 +-
 .../lucene/document/XYShapePolygonQuery.java       |  2 --
 .../src/java/org/apache/lucene/geo/Line.java       |  1 -
 .../src/java/org/apache/lucene/geo/Line2D.java     |  0
 .../src/java/org/apache/lucene/geo/Point2D.java    |  0
 .../java/org/apache/lucene/geo/Rectangle2D.java    |  0
 .../apache/lucene/geo/SimpleWKTShapeParser.java    |  0
 .../java/org/apache/lucene/geo/Tessellator.java    |  2 +-
 .../org/apache/lucene/geo/XYEncodingUtils.java     |  2 +-
 .../src/java/org/apache/lucene/geo/XYLine.java     |  2 --
 .../src/java/org/apache/lucene/geo/XYPolygon.java  |  2 --
 .../java/org/apache/lucene/geo/XYPolygon2D.java    |  0
 .../java/org/apache/lucene/geo/XYRectangle.java    |  0
 .../java/org/apache/lucene/geo/XYRectangle2D.java  |  0
 .../lucene/document/BaseLatLonShapeTestCase.java   |  0
 .../lucene/document/BaseShapeEncodingTestCase.java |  0
 .../apache/lucene/document/BaseShapeTestCase.java  |  0
 .../lucene/document/BaseXYShapeTestCase.java       |  0
 .../document/TestLatLonLineShapeQueries.java       |  0
 .../document/TestLatLonMultiLineShapeQueries.java  |  0
 .../document/TestLatLonMultiPointShapeQueries.java |  0
 .../TestLatLonMultiPolygonShapeQueries.java        |  0
 .../document/TestLatLonPointShapeQueries.java      |  0
 .../document/TestLatLonPolygonShapeQueries.java    |  0
 .../apache/lucene/document/TestLatLonShape.java    |  0
 .../lucene/document/TestLatLonShapeEncoding.java   |  0
 .../lucene/document/TestXYLineShapeQueries.java    |  0
 .../document/TestXYMultiLineShapeQueries.java      |  0
 .../document/TestXYMultiPointShapeQueries.java     |  0
 .../document/TestXYMultiPolygonShapeQueries.java   |  0
 .../lucene/document/TestXYPointShapeQueries.java   |  0
 .../lucene/document/TestXYPolygonShapeQueries.java |  0
 .../org/apache/lucene/document/TestXYShape.java    |  0
 .../lucene/document/TestXYShapeEncoding.java       |  0
 .../test/org/apache/lucene/geo/ShapeTestUtil.java  |  0
 .../src/test/org/apache/lucene/geo/TestLine2D.java |  0
 .../test/org/apache/lucene/geo/TestPoint2D.java    |  0
 .../org/apache/lucene/geo/TestRectangle2D.java     |  0
 .../lucene/geo/TestSimpleWKTShapeParsing.java      |  0
 .../org/apache/lucene/geo/TestTessellator.java     |  0
 .../org/apache/lucene/geo/TestXYRectangle2D.java   |  0
 .../src/java/org/apache/lucene/geo/package.html    | 31 -----------------
 53 files changed, 53 insertions(+), 84 deletions(-)

diff --git a/lucene/CHANGES.txt b/lucene/CHANGES.txt
index af0ba5a..4928832 100644
--- a/lucene/CHANGES.txt
+++ b/lucene/CHANGES.txt
@@ -14,6 +14,8 @@ API Changes
 
 * LUCENE-8369: Remove obsolete spatial module. (Nick Knize, David Smiley)
 
+* LUCENE-8621: Refactor LatLonShape, XYShape, and all query and utility classes to core. (Nick Knize)
+
 New Features
 ---------------------
 
diff --git a/lucene/sandbox/src/java/org/apache/lucene/document/LatLonShape.java b/lucene/core/src/java/org/apache/lucene/document/LatLonShape.java
similarity index 99%
rename from lucene/sandbox/src/java/org/apache/lucene/document/LatLonShape.java
rename to lucene/core/src/java/org/apache/lucene/document/LatLonShape.java
index 8bcb49f..d20f7cf 100644
--- a/lucene/sandbox/src/java/org/apache/lucene/document/LatLonShape.java
+++ b/lucene/core/src/java/org/apache/lucene/document/LatLonShape.java
@@ -52,8 +52,6 @@ import static org.apache.lucene.geo.GeoEncodingUtils.encodeLongitude;
  * and 8.381903171539307E-8 for longitude).
  * @see PointValues
  * @see LatLonDocValuesField
- *
- * @lucene.experimental
  */
 public class LatLonShape {
 
diff --git a/lucene/sandbox/src/java/org/apache/lucene/document/LatLonShapeBoundingBoxQuery.java b/lucene/core/src/java/org/apache/lucene/document/LatLonShapeBoundingBoxQuery.java
similarity index 99%
rename from lucene/sandbox/src/java/org/apache/lucene/document/LatLonShapeBoundingBoxQuery.java
rename to lucene/core/src/java/org/apache/lucene/document/LatLonShapeBoundingBoxQuery.java
index 71f909a..e357816 100644
--- a/lucene/sandbox/src/java/org/apache/lucene/document/LatLonShapeBoundingBoxQuery.java
+++ b/lucene/core/src/java/org/apache/lucene/document/LatLonShapeBoundingBoxQuery.java
@@ -27,8 +27,6 @@ import org.apache.lucene.index.PointValues.Relation;
  *
  * <p>The field must be indexed using
  * {@link org.apache.lucene.document.LatLonShape#createIndexableFields} added per document.
- *
- *  @lucene.experimental
  **/
 final class LatLonShapeBoundingBoxQuery extends ShapeQuery {
   final Rectangle rectangle;
diff --git a/lucene/sandbox/src/java/org/apache/lucene/document/LatLonShapeLineQuery.java b/lucene/core/src/java/org/apache/lucene/document/LatLonShapeLineQuery.java
similarity index 99%
rename from lucene/sandbox/src/java/org/apache/lucene/document/LatLonShapeLineQuery.java
rename to lucene/core/src/java/org/apache/lucene/document/LatLonShapeLineQuery.java
index b8756361..f92339e 100644
--- a/lucene/sandbox/src/java/org/apache/lucene/document/LatLonShapeLineQuery.java
+++ b/lucene/core/src/java/org/apache/lucene/document/LatLonShapeLineQuery.java
@@ -41,8 +41,6 @@ import org.apache.lucene.util.NumericUtils;
  * </ul>
  * <p>The field must be indexed using
  * {@link org.apache.lucene.document.LatLonShape#createIndexableFields} added per document.
- *
- *  @lucene.experimental
  **/
 final class LatLonShapeLineQuery extends ShapeQuery {
   final Line[] lines;
diff --git a/lucene/sandbox/src/java/org/apache/lucene/document/LatLonShapePointQuery.java b/lucene/core/src/java/org/apache/lucene/document/LatLonShapePointQuery.java
similarity index 99%
rename from lucene/sandbox/src/java/org/apache/lucene/document/LatLonShapePointQuery.java
rename to lucene/core/src/java/org/apache/lucene/document/LatLonShapePointQuery.java
index 8c55ec6..3fef111 100644
--- a/lucene/sandbox/src/java/org/apache/lucene/document/LatLonShapePointQuery.java
+++ b/lucene/core/src/java/org/apache/lucene/document/LatLonShapePointQuery.java
@@ -29,8 +29,6 @@ import org.apache.lucene.util.NumericUtils;
  *
  * <p>The field must be indexed using
  * {@link LatLonShape#createIndexableFields} added per document.
- *
- *  @lucene.experimental
  **/
 final class LatLonShapePointQuery extends ShapeQuery {
   final Component2D point2D;
diff --git a/lucene/sandbox/src/java/org/apache/lucene/document/LatLonShapePolygonQuery.java b/lucene/core/src/java/org/apache/lucene/document/LatLonShapePolygonQuery.java
similarity index 99%
rename from lucene/sandbox/src/java/org/apache/lucene/document/LatLonShapePolygonQuery.java
rename to lucene/core/src/java/org/apache/lucene/document/LatLonShapePolygonQuery.java
index 38eee1d..8ca4c26 100644
--- a/lucene/sandbox/src/java/org/apache/lucene/document/LatLonShapePolygonQuery.java
+++ b/lucene/core/src/java/org/apache/lucene/document/LatLonShapePolygonQuery.java
@@ -36,8 +36,6 @@ import org.apache.lucene.util.NumericUtils;
  *
  * <p>The field must be indexed using
  * {@link org.apache.lucene.document.LatLonShape#createIndexableFields} added per document.
- *
- *  @lucene.experimental
  **/
 final class LatLonShapePolygonQuery extends ShapeQuery {
   final Polygon[] polygons;
diff --git a/lucene/sandbox/src/java/org/apache/lucene/document/ShapeField.java b/lucene/core/src/java/org/apache/lucene/document/ShapeField.java
similarity index 93%
rename from lucene/sandbox/src/java/org/apache/lucene/document/ShapeField.java
rename to lucene/core/src/java/org/apache/lucene/document/ShapeField.java
index fee0862..724feb8 100644
--- a/lucene/sandbox/src/java/org/apache/lucene/document/ShapeField.java
+++ b/lucene/core/src/java/org/apache/lucene/document/ShapeField.java
@@ -35,8 +35,7 @@ import org.apache.lucene.util.NumericUtils;
  * <p>
  * This class defines the static methods for encoding the three vertices of a tessellated triangles as a seven dimension point.
  * The coordinates are converted from double precision values into 32 bit integers so they are sortable at index time.
- *
- * @lucene.experimental
+ * <p>
  */
 public final class ShapeField {
   /** vertex coordinates are encoded as 4 byte integers */
@@ -58,13 +57,13 @@ public final class ShapeField {
    */
   public static class Triangle extends Field {
 
-    // constructor for points and lines
+    /** constructor for points and lines */
     Triangle(String name, int aXencoded, int aYencoded, int bXencoded, int bYencoded, int cXencoded, int cYencoded) {
       super(name, TYPE);
       setTriangleValue(aXencoded, aYencoded, true, bXencoded, bYencoded, true, cXencoded, cYencoded, true);
     }
 
-
+    /** xtor from a given Tessellated Triangle object */
     Triangle(String name, Tessellator.Triangle t) {
       super(name, TYPE);
       setTriangleValue(t.getEncodedX(0), t.getEncodedY(0), t.isEdgefromPolygon(0),
@@ -88,7 +87,14 @@ public final class ShapeField {
 
   /** Query Relation Types **/
   public enum QueryRelation {
-    INTERSECTS, WITHIN, DISJOINT, CONTAINS
+    /** used for INTERSECT Queries */
+    INTERSECTS,
+    /** used for WITHIN Queries */
+    WITHIN,
+    /** used for DISJOINT Queries */
+    DISJOINT,
+    /** used for CONTAINS Queries */
+    CONTAINS
   }
 
   private static final int MINY_MINX_MAXY_MAXX_Y_X = 0;
@@ -344,11 +350,26 @@ public final class ShapeField {
    * Represents a encoded triangle using {@link ShapeField#decodeTriangle(byte[], DecodedTriangle)}.
    */
   public static class DecodedTriangle {
-    //Triangle vertices
-    public int aX, aY, bX, bY, cX, cY;
-    //Represent if edges belongs to original shape
-    public boolean ab, bc, ca;
+    /** x coordinate, vertex one */
+    public int aX;
+    /** y coordinate, vertex one */
+    public int aY;
+    /** x coordinate, vertex two */
+    public int bX;
+    /** y coordinate, vertex two */
+    public int bY;
+    /** x coordinate, vertex three */
+    public int cX;
+    /** y coordinate, vertex three */
+    public int cY;
+    /** represent if edge ab belongs to original shape */
+    public boolean ab;
+    /** represent if edge bc belongs to original shape */
+    public boolean bc;
+    /** represent if edge ca belongs to original shape */
+    public boolean ca;
 
+    /** default xtor */
     public DecodedTriangle() {
     }
 
diff --git a/lucene/sandbox/src/java/org/apache/lucene/document/ShapeQuery.java b/lucene/core/src/java/org/apache/lucene/document/ShapeQuery.java
similarity index 99%
rename from lucene/sandbox/src/java/org/apache/lucene/document/ShapeQuery.java
rename to lucene/core/src/java/org/apache/lucene/document/ShapeQuery.java
index ba7151a..a4e4ce4 100644
--- a/lucene/sandbox/src/java/org/apache/lucene/document/ShapeQuery.java
+++ b/lucene/core/src/java/org/apache/lucene/document/ShapeQuery.java
@@ -55,8 +55,7 @@ import org.apache.lucene.util.FixedBitSet;
  *   <li>{@link XYShape#newLineQuery newLineQuery()} for matching cartesian shapes that have some {@link QueryRelation} with a linestring.
  *   <li>{@link XYShape#newPolygonQuery newPolygonQuery()} for matching cartesian shapes that have some {@link QueryRelation} with a polygon.
  * </ul>
- *
- *  @lucene.experimental
+ * <p>
  **/
 abstract class ShapeQuery extends Query {
   /** field name */
@@ -202,6 +201,7 @@ abstract class ShapeQuery extends Query {
     return sameClassAs(o) && equalsTo(o);
   }
 
+  /** class specific equals check */
   protected boolean equalsTo(Object o) {
     return Objects.equals(field, ((ShapeQuery)o).field) && this.queryRelation == ((ShapeQuery)o).queryRelation;
   }
diff --git a/lucene/sandbox/src/java/org/apache/lucene/document/XYShape.java b/lucene/core/src/java/org/apache/lucene/document/XYShape.java
similarity index 99%
rename from lucene/sandbox/src/java/org/apache/lucene/document/XYShape.java
rename to lucene/core/src/java/org/apache/lucene/document/XYShape.java
index 395c7f8..387d048 100644
--- a/lucene/sandbox/src/java/org/apache/lucene/document/XYShape.java
+++ b/lucene/core/src/java/org/apache/lucene/document/XYShape.java
@@ -48,8 +48,6 @@ import static org.apache.lucene.geo.XYEncodingUtils.encode;
  * original {@code double} values.
  * @see PointValues
  * @see LatLonDocValuesField
- *
- * @lucene.experimental
  */
 public class XYShape {
 
diff --git a/lucene/sandbox/src/java/org/apache/lucene/document/XYShapeBoundingBoxQuery.java b/lucene/core/src/java/org/apache/lucene/document/XYShapeBoundingBoxQuery.java
similarity index 82%
rename from lucene/sandbox/src/java/org/apache/lucene/document/XYShapeBoundingBoxQuery.java
rename to lucene/core/src/java/org/apache/lucene/document/XYShapeBoundingBoxQuery.java
index f1d9f82..7f977b9 100644
--- a/lucene/sandbox/src/java/org/apache/lucene/document/XYShapeBoundingBoxQuery.java
+++ b/lucene/core/src/java/org/apache/lucene/document/XYShapeBoundingBoxQuery.java
@@ -20,7 +20,7 @@ import org.apache.lucene.document.ShapeField.QueryRelation;
 import org.apache.lucene.geo.Component2D;
 import org.apache.lucene.geo.XYRectangle;
 import org.apache.lucene.geo.XYRectangle2D;
-import org.apache.lucene.index.PointValues;
+import org.apache.lucene.index.PointValues.Relation;
 import org.apache.lucene.util.NumericUtils;
 
 import static org.apache.lucene.geo.XYEncodingUtils.decode;
@@ -30,14 +30,12 @@ import static org.apache.lucene.geo.XYEncodingUtils.decode;
  *
  * <p>The field must be indexed using
  * {@link org.apache.lucene.document.XYShape#createIndexableFields} added per document.
- *
- *  @lucene.experimental
  **/
 public class XYShapeBoundingBoxQuery extends ShapeQuery {
   final Component2D rectangle2D;
   final private XYRectangle rectangle;
 
-
+  /** construct a Bounding Box Query over cartesian geometries from the given ranges */
   public XYShapeBoundingBoxQuery(String field, QueryRelation queryRelation, double minX, double maxX, double minY, double maxY) {
     super(field, queryRelation);
     this.rectangle = new XYRectangle(minX, maxX, minY, maxY);
@@ -45,32 +43,32 @@ public class XYShapeBoundingBoxQuery extends ShapeQuery {
   }
 
   @Override
-  protected PointValues.Relation relateRangeBBoxToQuery(int minXOffset, int minYOffset, byte[] minTriangle,
+  protected Relation relateRangeBBoxToQuery(int minXOffset, int minYOffset, byte[] minTriangle,
                                                         int maxXOffset, int maxYOffset, byte[] maxTriangle) {
     double minY = decode(NumericUtils.sortableBytesToInt(minTriangle, minYOffset));
     double minX = decode(NumericUtils.sortableBytesToInt(minTriangle, minXOffset));
     double maxY = decode(NumericUtils.sortableBytesToInt(maxTriangle, maxYOffset));
     double maxX = decode(NumericUtils.sortableBytesToInt(maxTriangle, maxXOffset));
     // check internal node against query
-    PointValues.Relation rel = rectangle2D.relate(minX, maxX, minY, maxY);
+    Relation rel = rectangle2D.relate(minX, maxX, minY, maxY);
     // TODO: Check if this really helps
-    if (queryRelation == QueryRelation.INTERSECTS && rel == PointValues.Relation.CELL_CROSSES_QUERY) {
+    if (queryRelation == QueryRelation.INTERSECTS && rel == Relation.CELL_CROSSES_QUERY) {
       // for intersects we can restrict the conditions by using the inner box
       double innerMaxY = decode(NumericUtils.sortableBytesToInt(maxTriangle, minYOffset));
-      if (rectangle2D.relate(minX, maxX, minY, innerMaxY) == PointValues.Relation.CELL_INSIDE_QUERY) {
-        return PointValues.Relation.CELL_INSIDE_QUERY;
+      if (rectangle2D.relate(minX, maxX, minY, innerMaxY) == Relation.CELL_INSIDE_QUERY) {
+        return Relation.CELL_INSIDE_QUERY;
       }
       double innerMaX = decode(NumericUtils.sortableBytesToInt(maxTriangle, minXOffset));
-      if (rectangle2D.relate(minX, innerMaX, minY, maxY) == PointValues.Relation.CELL_INSIDE_QUERY) {
-        return PointValues.Relation.CELL_INSIDE_QUERY;
+      if (rectangle2D.relate(minX, innerMaX, minY, maxY) == Relation.CELL_INSIDE_QUERY) {
+        return Relation.CELL_INSIDE_QUERY;
       }
       double innerMinY = decode(NumericUtils.sortableBytesToInt(minTriangle, maxYOffset));
-      if (rectangle2D.relate(minX, maxX, innerMinY, maxY) == PointValues.Relation.CELL_INSIDE_QUERY) {
-        return PointValues.Relation.CELL_INSIDE_QUERY;
+      if (rectangle2D.relate(minX, maxX, innerMinY, maxY) == Relation.CELL_INSIDE_QUERY) {
+        return Relation.CELL_INSIDE_QUERY;
       }
       double innerMinX = decode(NumericUtils.sortableBytesToInt(minTriangle, maxXOffset));
-      if (rectangle2D.relate(innerMinX, maxX, minY, maxY) == PointValues.Relation.CELL_INSIDE_QUERY) {
-        return PointValues.Relation.CELL_INSIDE_QUERY;
+      if (rectangle2D.relate(innerMinX, maxX, minY, maxY) == Relation.CELL_INSIDE_QUERY) {
+        return Relation.CELL_INSIDE_QUERY;
       }
     }
     return rel;
@@ -90,9 +88,9 @@ public class XYShapeBoundingBoxQuery extends ShapeQuery {
     double cX = decode(scratchTriangle.cX);
 
     switch (queryRelation) {
-      case INTERSECTS: return rectangle2D.relateTriangle(aX, aY, bX, bY, cX, cY) != PointValues.Relation.CELL_OUTSIDE_QUERY;
+      case INTERSECTS: return rectangle2D.relateTriangle(aX, aY, bX, bY, cX, cY) != Relation.CELL_OUTSIDE_QUERY;
       case WITHIN: return rectangle2D.contains(aX, aY) && rectangle2D.contains(bX, bY) && rectangle2D.contains(cX, cY);
-      case DISJOINT: return rectangle2D.relateTriangle(aX, aY, bX, bY, cX, cY) == PointValues.Relation.CELL_OUTSIDE_QUERY;
+      case DISJOINT: return rectangle2D.relateTriangle(aX, aY, bX, bY, cX, cY) == Relation.CELL_OUTSIDE_QUERY;
       default: throw new IllegalArgumentException("Unsupported query type :[" + queryRelation + "]");
     }
   }
diff --git a/lucene/sandbox/src/java/org/apache/lucene/document/XYShapeLineQuery.java b/lucene/core/src/java/org/apache/lucene/document/XYShapeLineQuery.java
similarity index 98%
rename from lucene/sandbox/src/java/org/apache/lucene/document/XYShapeLineQuery.java
rename to lucene/core/src/java/org/apache/lucene/document/XYShapeLineQuery.java
index 0fd9750..1a61bdd 100644
--- a/lucene/sandbox/src/java/org/apache/lucene/document/XYShapeLineQuery.java
+++ b/lucene/core/src/java/org/apache/lucene/document/XYShapeLineQuery.java
@@ -41,13 +41,12 @@ import static org.apache.lucene.geo.XYEncodingUtils.decode;
  * </ul>
  * <p>The field must be indexed using
  * {@link org.apache.lucene.document.XYShape#createIndexableFields} added per document.
- *
- *  @lucene.experimental
  **/
 final class XYShapeLineQuery extends ShapeQuery {
   final XYLine[] lines;
   final private Component2D line2D;
 
+  /** construct a Line Query over cartesian geometries from the given line objects */
   public XYShapeLineQuery(String field, QueryRelation queryRelation, XYLine... lines) {
     super(field, queryRelation);
     /** line queries do not support within relations, only intersects and disjoint */
diff --git a/lucene/sandbox/src/java/org/apache/lucene/document/XYShapePointQuery.java b/lucene/core/src/java/org/apache/lucene/document/XYShapePointQuery.java
similarity index 97%
rename from lucene/sandbox/src/java/org/apache/lucene/document/XYShapePointQuery.java
rename to lucene/core/src/java/org/apache/lucene/document/XYShapePointQuery.java
index 10bf296..dee7869 100644
--- a/lucene/sandbox/src/java/org/apache/lucene/document/XYShapePointQuery.java
+++ b/lucene/core/src/java/org/apache/lucene/document/XYShapePointQuery.java
@@ -31,13 +31,12 @@ import static org.apache.lucene.geo.XYEncodingUtils.decode;
  *
  * <p>The field must be indexed using
  * {@link XYShape#createIndexableFields} added per document.
- *
- *  @lucene.experimental
  **/
 final class XYShapePointQuery extends ShapeQuery {
   final Component2D point2D;
   final float[][] points;
 
+  /** construct a Point or MultiPoint Query over cartesian geometries from the given point values */
   public XYShapePointQuery(String field, ShapeField.QueryRelation queryRelation, float[][] points) {
     super(field, queryRelation);
     this.points = points;
diff --git a/lucene/sandbox/src/java/org/apache/lucene/document/XYShapePolygonQuery.java b/lucene/core/src/java/org/apache/lucene/document/XYShapePolygonQuery.java
similarity index 99%
rename from lucene/sandbox/src/java/org/apache/lucene/document/XYShapePolygonQuery.java
rename to lucene/core/src/java/org/apache/lucene/document/XYShapePolygonQuery.java
index 47fba09..11639c0 100644
--- a/lucene/sandbox/src/java/org/apache/lucene/document/XYShapePolygonQuery.java
+++ b/lucene/core/src/java/org/apache/lucene/document/XYShapePolygonQuery.java
@@ -33,8 +33,6 @@ import static org.apache.lucene.geo.XYEncodingUtils.decode;
  *
  * <p>The field must be indexed using
  * {@link org.apache.lucene.document.XYShape#createIndexableFields} added per document.
- *
- *  @lucene.experimental
  **/
 final class XYShapePolygonQuery extends ShapeQuery {
   final XYPolygon[] polygons;
diff --git a/lucene/sandbox/src/java/org/apache/lucene/geo/Line.java b/lucene/core/src/java/org/apache/lucene/geo/Line.java
similarity index 99%
rename from lucene/sandbox/src/java/org/apache/lucene/geo/Line.java
rename to lucene/core/src/java/org/apache/lucene/geo/Line.java
index 3c28607..290c993 100644
--- a/lucene/sandbox/src/java/org/apache/lucene/geo/Line.java
+++ b/lucene/core/src/java/org/apache/lucene/geo/Line.java
@@ -27,7 +27,6 @@ import java.util.Arrays;
  *   <li>All latitude/longitude values must be in decimal degrees.
  *   <li>For more advanced GeoSpatial indexing and query operations see the {@code spatial-extras} module
  * </ol>
- * @lucene.experimental
  */
 public class Line {
   /** array of latitude coordinates */
diff --git a/lucene/sandbox/src/java/org/apache/lucene/geo/Line2D.java b/lucene/core/src/java/org/apache/lucene/geo/Line2D.java
similarity index 100%
rename from lucene/sandbox/src/java/org/apache/lucene/geo/Line2D.java
rename to lucene/core/src/java/org/apache/lucene/geo/Line2D.java
diff --git a/lucene/sandbox/src/java/org/apache/lucene/geo/Point2D.java b/lucene/core/src/java/org/apache/lucene/geo/Point2D.java
similarity index 100%
rename from lucene/sandbox/src/java/org/apache/lucene/geo/Point2D.java
rename to lucene/core/src/java/org/apache/lucene/geo/Point2D.java
diff --git a/lucene/sandbox/src/java/org/apache/lucene/geo/Rectangle2D.java b/lucene/core/src/java/org/apache/lucene/geo/Rectangle2D.java
similarity index 100%
rename from lucene/sandbox/src/java/org/apache/lucene/geo/Rectangle2D.java
rename to lucene/core/src/java/org/apache/lucene/geo/Rectangle2D.java
diff --git a/lucene/sandbox/src/java/org/apache/lucene/geo/SimpleWKTShapeParser.java b/lucene/core/src/java/org/apache/lucene/geo/SimpleWKTShapeParser.java
similarity index 100%
rename from lucene/sandbox/src/java/org/apache/lucene/geo/SimpleWKTShapeParser.java
rename to lucene/core/src/java/org/apache/lucene/geo/SimpleWKTShapeParser.java
diff --git a/lucene/sandbox/src/java/org/apache/lucene/geo/Tessellator.java b/lucene/core/src/java/org/apache/lucene/geo/Tessellator.java
similarity index 99%
rename from lucene/sandbox/src/java/org/apache/lucene/geo/Tessellator.java
rename to lucene/core/src/java/org/apache/lucene/geo/Tessellator.java
index bd95475..12695d8 100644
--- a/lucene/sandbox/src/java/org/apache/lucene/geo/Tessellator.java
+++ b/lucene/core/src/java/org/apache/lucene/geo/Tessellator.java
@@ -66,7 +66,7 @@ import static org.apache.lucene.geo.GeoUtils.orient;
  * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
  * THIS SOFTWARE.
  *
- * @lucene.experimental
+ * @lucene.internal
  */
 final public class Tessellator {
   // this is a dumb heuristic to control whether we cut over to sorted morton values
diff --git a/lucene/sandbox/src/java/org/apache/lucene/geo/XYEncodingUtils.java b/lucene/core/src/java/org/apache/lucene/geo/XYEncodingUtils.java
similarity index 99%
rename from lucene/sandbox/src/java/org/apache/lucene/geo/XYEncodingUtils.java
rename to lucene/core/src/java/org/apache/lucene/geo/XYEncodingUtils.java
index 025504f..b2c1d01 100644
--- a/lucene/sandbox/src/java/org/apache/lucene/geo/XYEncodingUtils.java
+++ b/lucene/core/src/java/org/apache/lucene/geo/XYEncodingUtils.java
@@ -22,7 +22,7 @@ import org.apache.lucene.util.NumericUtils;
 /**
  * reusable cartesian geometry encoding methods
  *
- * @lucene.experimental
+ * @lucene.internal
  */
 public final class XYEncodingUtils {
 
diff --git a/lucene/sandbox/src/java/org/apache/lucene/geo/XYLine.java b/lucene/core/src/java/org/apache/lucene/geo/XYLine.java
similarity index 99%
rename from lucene/sandbox/src/java/org/apache/lucene/geo/XYLine.java
rename to lucene/core/src/java/org/apache/lucene/geo/XYLine.java
index 9ece659..02b957a 100644
--- a/lucene/sandbox/src/java/org/apache/lucene/geo/XYLine.java
+++ b/lucene/core/src/java/org/apache/lucene/geo/XYLine.java
@@ -21,8 +21,6 @@ import java.util.Arrays;
 /**
  * Represents a line in cartesian space. You can construct the Line directly with {@code double[]}, {@code double[]} x, y arrays
  * coordinates.
- *
- * @lucene.experimental
  */
 public class XYLine {
   /** array of x coordinates */
diff --git a/lucene/sandbox/src/java/org/apache/lucene/geo/XYPolygon.java b/lucene/core/src/java/org/apache/lucene/geo/XYPolygon.java
similarity index 99%
rename from lucene/sandbox/src/java/org/apache/lucene/geo/XYPolygon.java
rename to lucene/core/src/java/org/apache/lucene/geo/XYPolygon.java
index 585283d..f44fe9c 100644
--- a/lucene/sandbox/src/java/org/apache/lucene/geo/XYPolygon.java
+++ b/lucene/core/src/java/org/apache/lucene/geo/XYPolygon.java
@@ -21,8 +21,6 @@ import java.util.Arrays;
 /**
  * Represents a polygon in cartesian space. You can construct the Polygon directly with {@code double[]}, {@code double[]} x, y arrays
  * coordinates.
- *
- * @lucene.experimental
  */
 public class XYPolygon {
   private final double[] x;
diff --git a/lucene/sandbox/src/java/org/apache/lucene/geo/XYPolygon2D.java b/lucene/core/src/java/org/apache/lucene/geo/XYPolygon2D.java
similarity index 100%
rename from lucene/sandbox/src/java/org/apache/lucene/geo/XYPolygon2D.java
rename to lucene/core/src/java/org/apache/lucene/geo/XYPolygon2D.java
diff --git a/lucene/sandbox/src/java/org/apache/lucene/geo/XYRectangle.java b/lucene/core/src/java/org/apache/lucene/geo/XYRectangle.java
similarity index 100%
rename from lucene/sandbox/src/java/org/apache/lucene/geo/XYRectangle.java
rename to lucene/core/src/java/org/apache/lucene/geo/XYRectangle.java
diff --git a/lucene/sandbox/src/java/org/apache/lucene/geo/XYRectangle2D.java b/lucene/core/src/java/org/apache/lucene/geo/XYRectangle2D.java
similarity index 100%
rename from lucene/sandbox/src/java/org/apache/lucene/geo/XYRectangle2D.java
rename to lucene/core/src/java/org/apache/lucene/geo/XYRectangle2D.java
diff --git a/lucene/sandbox/src/test/org/apache/lucene/document/BaseLatLonShapeTestCase.java b/lucene/core/src/test/org/apache/lucene/document/BaseLatLonShapeTestCase.java
similarity index 100%
rename from lucene/sandbox/src/test/org/apache/lucene/document/BaseLatLonShapeTestCase.java
rename to lucene/core/src/test/org/apache/lucene/document/BaseLatLonShapeTestCase.java
diff --git a/lucene/sandbox/src/test/org/apache/lucene/document/BaseShapeEncodingTestCase.java b/lucene/core/src/test/org/apache/lucene/document/BaseShapeEncodingTestCase.java
similarity index 100%
rename from lucene/sandbox/src/test/org/apache/lucene/document/BaseShapeEncodingTestCase.java
rename to lucene/core/src/test/org/apache/lucene/document/BaseShapeEncodingTestCase.java
diff --git a/lucene/sandbox/src/test/org/apache/lucene/document/BaseShapeTestCase.java b/lucene/core/src/test/org/apache/lucene/document/BaseShapeTestCase.java
similarity index 100%
rename from lucene/sandbox/src/test/org/apache/lucene/document/BaseShapeTestCase.java
rename to lucene/core/src/test/org/apache/lucene/document/BaseShapeTestCase.java
diff --git a/lucene/sandbox/src/test/org/apache/lucene/document/BaseXYShapeTestCase.java b/lucene/core/src/test/org/apache/lucene/document/BaseXYShapeTestCase.java
similarity index 100%
rename from lucene/sandbox/src/test/org/apache/lucene/document/BaseXYShapeTestCase.java
rename to lucene/core/src/test/org/apache/lucene/document/BaseXYShapeTestCase.java
diff --git a/lucene/sandbox/src/test/org/apache/lucene/document/TestLatLonLineShapeQueries.java b/lucene/core/src/test/org/apache/lucene/document/TestLatLonLineShapeQueries.java
similarity index 100%
rename from lucene/sandbox/src/test/org/apache/lucene/document/TestLatLonLineShapeQueries.java
rename to lucene/core/src/test/org/apache/lucene/document/TestLatLonLineShapeQueries.java
diff --git a/lucene/sandbox/src/test/org/apache/lucene/document/TestLatLonMultiLineShapeQueries.java b/lucene/core/src/test/org/apache/lucene/document/TestLatLonMultiLineShapeQueries.java
similarity index 100%
rename from lucene/sandbox/src/test/org/apache/lucene/document/TestLatLonMultiLineShapeQueries.java
rename to lucene/core/src/test/org/apache/lucene/document/TestLatLonMultiLineShapeQueries.java
diff --git a/lucene/sandbox/src/test/org/apache/lucene/document/TestLatLonMultiPointShapeQueries.java b/lucene/core/src/test/org/apache/lucene/document/TestLatLonMultiPointShapeQueries.java
similarity index 100%
rename from lucene/sandbox/src/test/org/apache/lucene/document/TestLatLonMultiPointShapeQueries.java
rename to lucene/core/src/test/org/apache/lucene/document/TestLatLonMultiPointShapeQueries.java
diff --git a/lucene/sandbox/src/test/org/apache/lucene/document/TestLatLonMultiPolygonShapeQueries.java b/lucene/core/src/test/org/apache/lucene/document/TestLatLonMultiPolygonShapeQueries.java
similarity index 100%
rename from lucene/sandbox/src/test/org/apache/lucene/document/TestLatLonMultiPolygonShapeQueries.java
rename to lucene/core/src/test/org/apache/lucene/document/TestLatLonMultiPolygonShapeQueries.java
diff --git a/lucene/sandbox/src/test/org/apache/lucene/document/TestLatLonPointShapeQueries.java b/lucene/core/src/test/org/apache/lucene/document/TestLatLonPointShapeQueries.java
similarity index 100%
rename from lucene/sandbox/src/test/org/apache/lucene/document/TestLatLonPointShapeQueries.java
rename to lucene/core/src/test/org/apache/lucene/document/TestLatLonPointShapeQueries.java
diff --git a/lucene/sandbox/src/test/org/apache/lucene/document/TestLatLonPolygonShapeQueries.java b/lucene/core/src/test/org/apache/lucene/document/TestLatLonPolygonShapeQueries.java
similarity index 100%
rename from lucene/sandbox/src/test/org/apache/lucene/document/TestLatLonPolygonShapeQueries.java
rename to lucene/core/src/test/org/apache/lucene/document/TestLatLonPolygonShapeQueries.java
diff --git a/lucene/sandbox/src/test/org/apache/lucene/document/TestLatLonShape.java b/lucene/core/src/test/org/apache/lucene/document/TestLatLonShape.java
similarity index 100%
rename from lucene/sandbox/src/test/org/apache/lucene/document/TestLatLonShape.java
rename to lucene/core/src/test/org/apache/lucene/document/TestLatLonShape.java
diff --git a/lucene/sandbox/src/test/org/apache/lucene/document/TestLatLonShapeEncoding.java b/lucene/core/src/test/org/apache/lucene/document/TestLatLonShapeEncoding.java
similarity index 100%
rename from lucene/sandbox/src/test/org/apache/lucene/document/TestLatLonShapeEncoding.java
rename to lucene/core/src/test/org/apache/lucene/document/TestLatLonShapeEncoding.java
diff --git a/lucene/sandbox/src/test/org/apache/lucene/document/TestXYLineShapeQueries.java b/lucene/core/src/test/org/apache/lucene/document/TestXYLineShapeQueries.java
similarity index 100%
rename from lucene/sandbox/src/test/org/apache/lucene/document/TestXYLineShapeQueries.java
rename to lucene/core/src/test/org/apache/lucene/document/TestXYLineShapeQueries.java
diff --git a/lucene/sandbox/src/test/org/apache/lucene/document/TestXYMultiLineShapeQueries.java b/lucene/core/src/test/org/apache/lucene/document/TestXYMultiLineShapeQueries.java
similarity index 100%
rename from lucene/sandbox/src/test/org/apache/lucene/document/TestXYMultiLineShapeQueries.java
rename to lucene/core/src/test/org/apache/lucene/document/TestXYMultiLineShapeQueries.java
diff --git a/lucene/sandbox/src/test/org/apache/lucene/document/TestXYMultiPointShapeQueries.java b/lucene/core/src/test/org/apache/lucene/document/TestXYMultiPointShapeQueries.java
similarity index 100%
rename from lucene/sandbox/src/test/org/apache/lucene/document/TestXYMultiPointShapeQueries.java
rename to lucene/core/src/test/org/apache/lucene/document/TestXYMultiPointShapeQueries.java
diff --git a/lucene/sandbox/src/test/org/apache/lucene/document/TestXYMultiPolygonShapeQueries.java b/lucene/core/src/test/org/apache/lucene/document/TestXYMultiPolygonShapeQueries.java
similarity index 100%
rename from lucene/sandbox/src/test/org/apache/lucene/document/TestXYMultiPolygonShapeQueries.java
rename to lucene/core/src/test/org/apache/lucene/document/TestXYMultiPolygonShapeQueries.java
diff --git a/lucene/sandbox/src/test/org/apache/lucene/document/TestXYPointShapeQueries.java b/lucene/core/src/test/org/apache/lucene/document/TestXYPointShapeQueries.java
similarity index 100%
rename from lucene/sandbox/src/test/org/apache/lucene/document/TestXYPointShapeQueries.java
rename to lucene/core/src/test/org/apache/lucene/document/TestXYPointShapeQueries.java
diff --git a/lucene/sandbox/src/test/org/apache/lucene/document/TestXYPolygonShapeQueries.java b/lucene/core/src/test/org/apache/lucene/document/TestXYPolygonShapeQueries.java
similarity index 100%
rename from lucene/sandbox/src/test/org/apache/lucene/document/TestXYPolygonShapeQueries.java
rename to lucene/core/src/test/org/apache/lucene/document/TestXYPolygonShapeQueries.java
diff --git a/lucene/sandbox/src/test/org/apache/lucene/document/TestXYShape.java b/lucene/core/src/test/org/apache/lucene/document/TestXYShape.java
similarity index 100%
rename from lucene/sandbox/src/test/org/apache/lucene/document/TestXYShape.java
rename to lucene/core/src/test/org/apache/lucene/document/TestXYShape.java
diff --git a/lucene/sandbox/src/test/org/apache/lucene/document/TestXYShapeEncoding.java b/lucene/core/src/test/org/apache/lucene/document/TestXYShapeEncoding.java
similarity index 100%
rename from lucene/sandbox/src/test/org/apache/lucene/document/TestXYShapeEncoding.java
rename to lucene/core/src/test/org/apache/lucene/document/TestXYShapeEncoding.java
diff --git a/lucene/sandbox/src/test/org/apache/lucene/geo/ShapeTestUtil.java b/lucene/core/src/test/org/apache/lucene/geo/ShapeTestUtil.java
similarity index 100%
rename from lucene/sandbox/src/test/org/apache/lucene/geo/ShapeTestUtil.java
rename to lucene/core/src/test/org/apache/lucene/geo/ShapeTestUtil.java
diff --git a/lucene/sandbox/src/test/org/apache/lucene/geo/TestLine2D.java b/lucene/core/src/test/org/apache/lucene/geo/TestLine2D.java
similarity index 100%
rename from lucene/sandbox/src/test/org/apache/lucene/geo/TestLine2D.java
rename to lucene/core/src/test/org/apache/lucene/geo/TestLine2D.java
diff --git a/lucene/sandbox/src/test/org/apache/lucene/geo/TestPoint2D.java b/lucene/core/src/test/org/apache/lucene/geo/TestPoint2D.java
similarity index 100%
rename from lucene/sandbox/src/test/org/apache/lucene/geo/TestPoint2D.java
rename to lucene/core/src/test/org/apache/lucene/geo/TestPoint2D.java
diff --git a/lucene/sandbox/src/test/org/apache/lucene/geo/TestRectangle2D.java b/lucene/core/src/test/org/apache/lucene/geo/TestRectangle2D.java
similarity index 100%
rename from lucene/sandbox/src/test/org/apache/lucene/geo/TestRectangle2D.java
rename to lucene/core/src/test/org/apache/lucene/geo/TestRectangle2D.java
diff --git a/lucene/sandbox/src/test/org/apache/lucene/geo/TestSimpleWKTShapeParsing.java b/lucene/core/src/test/org/apache/lucene/geo/TestSimpleWKTShapeParsing.java
similarity index 100%
rename from lucene/sandbox/src/test/org/apache/lucene/geo/TestSimpleWKTShapeParsing.java
rename to lucene/core/src/test/org/apache/lucene/geo/TestSimpleWKTShapeParsing.java
diff --git a/lucene/sandbox/src/test/org/apache/lucene/geo/TestTessellator.java b/lucene/core/src/test/org/apache/lucene/geo/TestTessellator.java
similarity index 100%
rename from lucene/sandbox/src/test/org/apache/lucene/geo/TestTessellator.java
rename to lucene/core/src/test/org/apache/lucene/geo/TestTessellator.java
diff --git a/lucene/sandbox/src/test/org/apache/lucene/geo/TestXYRectangle2D.java b/lucene/core/src/test/org/apache/lucene/geo/TestXYRectangle2D.java
similarity index 100%
rename from lucene/sandbox/src/test/org/apache/lucene/geo/TestXYRectangle2D.java
rename to lucene/core/src/test/org/apache/lucene/geo/TestXYRectangle2D.java
diff --git a/lucene/sandbox/src/java/org/apache/lucene/geo/package.html b/lucene/sandbox/src/java/org/apache/lucene/geo/package.html
deleted file mode 100644
index e9859bd..0000000
--- a/lucene/sandbox/src/java/org/apache/lucene/geo/package.html
+++ /dev/null
@@ -1,31 +0,0 @@
-<!--
-  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.
-  -->
-
-<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
-<!-- not a package-info.java, because we already defined this package in core/ -->
-
-<html>
-<head>
-  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
-</head>
-<body>
-This package contains geo utility classes:
-<ul>
-  <li>{@link org.apache.lucene.geo.Tessellator Tessellator} for decomposing shapes into a triangular mesh</li>
-</ul>
-</body>
-</html>