lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sha...@apache.org
Subject [03/11] lucene-solr:feature/autoscaling_72: LUCENE-7934: Add planet model interface.
Date Mon, 21 Aug 2017 06:48:19 GMT
LUCENE-7934: Add planet model interface.


Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/94b695e6
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/94b695e6
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/94b695e6

Branch: refs/heads/feature/autoscaling_72
Commit: 94b695e672b88adf74f02ecc083925ceb7b772e9
Parents: a4374e8
Author: Karl Wright <DaddyWri@gmail.com>
Authored: Sun Aug 20 08:01:19 2017 -0400
Committer: Karl Wright <DaddyWri@gmail.com>
Committed: Sun Aug 20 08:01:19 2017 -0400

----------------------------------------------------------------------
 .../org/apache/lucene/spatial3d/Geo3DUtil.java  |  4 +--
 .../lucene/spatial3d/geom/BasePlanetObject.java |  4 +--
 .../lucene/spatial3d/geom/GeoBaseAreaShape.java |  3 ++
 .../geom/GeoBaseCompositeAreaShape.java         |  6 +++-
 .../geom/GeoBaseCompositeMembershipShape.java   |  3 +-
 .../spatial3d/geom/GeoBaseCompositeShape.java   | 12 +++++---
 .../spatial3d/geom/GeoCompositeAreaShape.java   | 10 ++++++-
 .../geom/GeoCompositeMembershipShape.java       | 10 ++++++-
 .../spatial3d/geom/GeoCompositePolygon.java     | 10 ++++++-
 .../spatial3d/geom/GeoDegeneratePoint.java      |  5 ++++
 .../spatial3d/geom/GeoPolygonFactory.java       |  8 +++---
 .../apache/lucene/spatial3d/geom/GeoShape.java  |  2 +-
 .../lucene/spatial3d/geom/PlanetObject.java     | 29 ++++++++++++++++++++
 .../apache/lucene/spatial3d/geom/XYZSolid.java  |  2 +-
 .../CompositeGeoPolygonRelationshipsTest.java   |  2 +-
 .../apache/lucene/spatial3d/geom/Geo3DUtil.java |  4 +--
 .../lucene/spatial3d/geom/GeoPolygonTest.java   |  6 ++--
 .../spatial3d/geom/RandomGeoShapeGenerator.java |  2 +-
 .../geom/SimpleGeoPolygonRelationshipsTest.java |  2 +-
 19 files changed, 97 insertions(+), 27 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/94b695e6/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/Geo3DUtil.java
----------------------------------------------------------------------
diff --git a/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/Geo3DUtil.java b/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/Geo3DUtil.java
index 6d73210..88537f4 100644
--- a/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/Geo3DUtil.java
+++ b/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/Geo3DUtil.java
@@ -134,12 +134,12 @@ class Geo3DUtil {
       final GeoPolygon component = fromPolygon(polygons[0]);
       if (component == null) {
         // Polygon is degenerate
-        shape = new GeoCompositePolygon();
+        shape = new GeoCompositePolygon(PlanetModel.WGS84);
       } else {
         shape = component;
       }
     } else {
-      final GeoCompositePolygon poly = new GeoCompositePolygon();
+      final GeoCompositePolygon poly = new GeoCompositePolygon(PlanetModel.WGS84);
       for (final Polygon p : polygons) {
         final GeoPolygon component = fromPolygon(p);
         if (component != null) {

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/94b695e6/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/BasePlanetObject.java
----------------------------------------------------------------------
diff --git a/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/BasePlanetObject.java
b/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/BasePlanetObject.java
index 5cd5acc..13072fe 100644
--- a/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/BasePlanetObject.java
+++ b/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/BasePlanetObject.java
@@ -22,7 +22,7 @@ package org.apache.lucene.spatial3d.geom;
  *
  * @lucene.internal
  */
-public abstract class BasePlanetObject {
+public abstract class BasePlanetObject implements PlanetObject {
 
   /** This is the planet model embedded in all objects derived from this
    * class. */
@@ -35,7 +35,7 @@ public abstract class BasePlanetObject {
     this.planetModel = planetModel;
   }
 
-  /** Returns the {@link PlanetModel} provided when this shape was created. */
+  @Override
   public PlanetModel getPlanetModel() {
     return planetModel;
   }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/94b695e6/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoBaseAreaShape.java
----------------------------------------------------------------------
diff --git a/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoBaseAreaShape.java
b/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoBaseAreaShape.java
index 5bd8ab3..a2b2fa1 100644
--- a/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoBaseAreaShape.java
+++ b/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoBaseAreaShape.java
@@ -94,6 +94,9 @@ abstract class GeoBaseAreaShape extends GeoBaseMembershipShape implements
GeoAre
 
   @Override
   public int getRelationship(GeoShape geoShape) {
+    if (!geoShape.getPlanetModel().equals(planetModel)) {
+      throw new IllegalArgumentException("Cannot relate shapes with different planet models.");
+    }
     final int insideGeoAreaShape = isShapeInsideGeoAreaShape(geoShape);
     if (insideGeoAreaShape == SOME_INSIDE) {
       return GeoArea.OVERLAPS;

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/94b695e6/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoBaseCompositeAreaShape.java
----------------------------------------------------------------------
diff --git a/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoBaseCompositeAreaShape.java
b/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoBaseCompositeAreaShape.java
index fea4eab..164d458 100644
--- a/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoBaseCompositeAreaShape.java
+++ b/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoBaseCompositeAreaShape.java
@@ -35,7 +35,8 @@ abstract class GeoBaseCompositeAreaShape<T extends GeoAreaShape> extends
GeoBase
   /**
    * Constructor.
    */
-  public GeoBaseCompositeAreaShape() {
+  public GeoBaseCompositeAreaShape(PlanetModel planetModel) {
+    super(planetModel);
   }
 
   @Override
@@ -50,6 +51,9 @@ abstract class GeoBaseCompositeAreaShape<T extends GeoAreaShape> extends
GeoBase
 
   @Override
   public int getRelationship(GeoShape geoShape) {
+    if (!geoShape.getPlanetModel().equals(planetModel)) {
+      throw new IllegalArgumentException("Cannot relate shapes with different planet models.");
+    }
     final int insideGeoAreaShape = isShapeInsideGeoAreaShape(geoShape);
     if (insideGeoAreaShape == SOME_INSIDE) {
       return GeoArea.OVERLAPS;

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/94b695e6/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoBaseCompositeMembershipShape.java
----------------------------------------------------------------------
diff --git a/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoBaseCompositeMembershipShape.java
b/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoBaseCompositeMembershipShape.java
index 0ebc8e2..0f19a7c 100644
--- a/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoBaseCompositeMembershipShape.java
+++ b/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoBaseCompositeMembershipShape.java
@@ -29,7 +29,8 @@ abstract class GeoBaseCompositeMembershipShape<T extends GeoMembershipShape>
   /**
    * Constructor.
    */
-  GeoBaseCompositeMembershipShape() {
+  GeoBaseCompositeMembershipShape(PlanetModel planetModel) {
+    super(planetModel);
   }
 
   @Override

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/94b695e6/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoBaseCompositeShape.java
----------------------------------------------------------------------
diff --git a/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoBaseCompositeShape.java
b/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoBaseCompositeShape.java
index 5fe8af1..32f6e9a 100644
--- a/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoBaseCompositeShape.java
+++ b/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoBaseCompositeShape.java
@@ -27,7 +27,7 @@ import java.util.List;
  * @param <T> is the type of GeoShapes of the composite.
  * @lucene.experimental
  */
-public abstract class GeoBaseCompositeShape<T extends GeoShape> implements GeoShape
{
+public abstract class GeoBaseCompositeShape<T extends GeoShape> extends BasePlanetObject
implements GeoShape {
 
   /**
    * Shape's container
@@ -37,7 +37,8 @@ public abstract class GeoBaseCompositeShape<T extends GeoShape> implements
GeoSh
   /**
    * Constructor.
    */
-  public GeoBaseCompositeShape() {
+  public GeoBaseCompositeShape(PlanetModel planetModel) {
+    super(planetModel);
   }
 
   /**
@@ -46,6 +47,9 @@ public abstract class GeoBaseCompositeShape<T extends GeoShape> implements
GeoSh
    * @param shape is the shape to add.
    */
   public void addShape(final T shape) {
+    if (!shape.getPlanetModel().equals(planetModel)) {
+      throw new IllegalArgumentException("Cannot add a shape into a composite with different
planet models.");
+    }
     shapes.add(shape);
   }
 
@@ -108,7 +112,7 @@ public abstract class GeoBaseCompositeShape<T extends GeoShape>
implements GeoSh
 
   @Override
   public int hashCode() {
-    return shapes.hashCode();
+    return super.hashCode() + shapes.hashCode();
   }
 
   @Override
@@ -116,6 +120,6 @@ public abstract class GeoBaseCompositeShape<T extends GeoShape>
implements GeoSh
     if (!(o instanceof GeoBaseCompositeShape<?>))
       return false;
     GeoBaseCompositeShape<?> other = (GeoBaseCompositeShape<?>) o;
-    return shapes.equals(other.shapes);
+    return super.equals(other) && shapes.equals(other.shapes);
   }
 }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/94b695e6/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoCompositeAreaShape.java
----------------------------------------------------------------------
diff --git a/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoCompositeAreaShape.java
b/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoCompositeAreaShape.java
index 695b3ea..085dbb3 100644
--- a/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoCompositeAreaShape.java
+++ b/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoCompositeAreaShape.java
@@ -27,7 +27,15 @@ public class GeoCompositeAreaShape extends GeoBaseCompositeAreaShape<GeoAreaShap
   /**
    * Constructor.
    */
-  public GeoCompositeAreaShape() {
+  public GeoCompositeAreaShape(PlanetModel planetModel) {
+    super(planetModel);
+  }
+
+  @Override
+  public boolean equals(Object o) {
+    if (!(o instanceof GeoCompositeAreaShape))
+      return false;
+    return super.equals(o);
   }
 
   @Override

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/94b695e6/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoCompositeMembershipShape.java
----------------------------------------------------------------------
diff --git a/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoCompositeMembershipShape.java
b/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoCompositeMembershipShape.java
index 7aa4007..55ce75a 100755
--- a/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoCompositeMembershipShape.java
+++ b/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoCompositeMembershipShape.java
@@ -26,7 +26,15 @@ public class GeoCompositeMembershipShape extends GeoBaseCompositeMembershipShape
   /**
    * Constructor.
    */
-  public GeoCompositeMembershipShape() {
+  public GeoCompositeMembershipShape(PlanetModel planetModel) {
+    super(planetModel);
+  }
+
+  @Override
+  public boolean equals(Object o) {
+    if (!(o instanceof GeoCompositeMembershipShape))
+      return false;
+    return super.equals(o);
   }
 
   @Override

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/94b695e6/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoCompositePolygon.java
----------------------------------------------------------------------
diff --git a/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoCompositePolygon.java
b/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoCompositePolygon.java
index b16d76d..3e62177 100644
--- a/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoCompositePolygon.java
+++ b/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoCompositePolygon.java
@@ -25,7 +25,15 @@ public class GeoCompositePolygon extends GeoBaseCompositeAreaShape<GeoPolygon>
i
   /**
    * Constructor.
    */
-  public GeoCompositePolygon() {
+  public GeoCompositePolygon(PlanetModel planetModel) {
+    super(planetModel);
+  }
+
+  @Override
+  public boolean equals(Object o) {
+    if (!(o instanceof GeoCompositePolygon))
+      return false;
+    return super.equals(o);
   }
 
   @Override

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/94b695e6/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoDegeneratePoint.java
----------------------------------------------------------------------
diff --git a/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoDegeneratePoint.java
b/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoDegeneratePoint.java
index 2860757..93d4708 100644
--- a/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoDegeneratePoint.java
+++ b/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoDegeneratePoint.java
@@ -40,6 +40,11 @@ class GeoDegeneratePoint extends GeoPoint implements GeoBBox, GeoCircle
{
   }
 
   @Override
+  public PlanetModel getPlanetModel() {
+    return planetModel;
+  }
+
+  @Override
   public GeoBBox expand(final double angle) {
     final double newTopLat = latitude + angle;
     final double newBottomLat = latitude - angle;

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/94b695e6/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoPolygonFactory.java
----------------------------------------------------------------------
diff --git a/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoPolygonFactory.java
b/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoPolygonFactory.java
index 7cabe32..f599716 100755
--- a/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoPolygonFactory.java
+++ b/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoPolygonFactory.java
@@ -336,19 +336,19 @@ public class GeoPolygonFactory {
     final SidedPlane initialPlane = new SidedPlane(testPoint, filteredPointList.get(0), filteredPointList.get(1));
     // We don't know if this is the correct siding choice.  We will only know as we build
the complex polygon.
     // So we need to be prepared to try both possibilities.
-    GeoCompositePolygon rval = new GeoCompositePolygon();
+    GeoCompositePolygon rval = new GeoCompositePolygon(planetModel);
     MutableBoolean seenConcave = new MutableBoolean();
     if (buildPolygonShape(rval, seenConcave, planetModel, filteredPointList, new BitSet(),
0, 1, initialPlane, holes, testPoint) == false) {
       // The testPoint was within the shape.  Was that intended?
       if (testPointInside) {
         // Yes: build it for real
-        rval = new GeoCompositePolygon();
+        rval = new GeoCompositePolygon(planetModel);
         seenConcave = new MutableBoolean();
         buildPolygonShape(rval, seenConcave, planetModel, filteredPointList, new BitSet(),
0, 1, initialPlane, holes, null);
         return rval;
       }
       // No: do the complement and return that.
-      rval = new GeoCompositePolygon();
+      rval = new GeoCompositePolygon(planetModel);
       seenConcave = new MutableBoolean();
       buildPolygonShape(rval, seenConcave, planetModel, filteredPointList, new BitSet(),
0, 1, new SidedPlane(initialPlane), holes, null);
       return rval;
@@ -359,7 +359,7 @@ public class GeoPolygonFactory {
         return rval;
       }
       // No: return the complement
-      rval = new GeoCompositePolygon();
+      rval = new GeoCompositePolygon(planetModel);
       seenConcave = new MutableBoolean();
       buildPolygonShape(rval, seenConcave, planetModel, filteredPointList, new BitSet(),
0, 1, new SidedPlane(initialPlane), holes, null);
       return rval;

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/94b695e6/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoShape.java
----------------------------------------------------------------------
diff --git a/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoShape.java b/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoShape.java
index a2d3947..98283cd 100755
--- a/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoShape.java
+++ b/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoShape.java
@@ -23,7 +23,7 @@ package org.apache.lucene.spatial3d.geom;
  *
  * @lucene.experimental
  */
-public interface GeoShape extends Membership {
+public interface GeoShape extends Membership, PlanetObject {
 
   /**
    * Return a sample point that is on the outside edge/boundary of the shape.

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/94b695e6/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/PlanetObject.java
----------------------------------------------------------------------
diff --git a/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/PlanetObject.java
b/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/PlanetObject.java
new file mode 100644
index 0000000..05ed7b1
--- /dev/null
+++ b/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/PlanetObject.java
@@ -0,0 +1,29 @@
+/*
+ * 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;
+
+/**
+ * Relates all Geo3d shape with a specific {@link PlanetModel}.
+ *
+ * @lucene.experimental
+ */
+public interface PlanetObject {
+
+  /** Returns the {@link PlanetModel} provided when this shape was created. */
+  PlanetModel getPlanetModel();
+}

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/94b695e6/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/XYZSolid.java
----------------------------------------------------------------------
diff --git a/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/XYZSolid.java b/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/XYZSolid.java
index 9298079..cceb110 100644
--- a/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/XYZSolid.java
+++ b/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/XYZSolid.java
@@ -21,6 +21,6 @@ package org.apache.lucene.spatial3d.geom;
  *
  * @lucene.internal
  */
-public interface XYZSolid extends GeoArea {
+public interface XYZSolid extends GeoArea, PlanetObject {
 }
   

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/94b695e6/lucene/spatial3d/src/test/org/apache/lucene/spatial3d/geom/CompositeGeoPolygonRelationshipsTest.java
----------------------------------------------------------------------
diff --git a/lucene/spatial3d/src/test/org/apache/lucene/spatial3d/geom/CompositeGeoPolygonRelationshipsTest.java
b/lucene/spatial3d/src/test/org/apache/lucene/spatial3d/geom/CompositeGeoPolygonRelationshipsTest.java
index ffcb5e3..1d5ffbe 100644
--- a/lucene/spatial3d/src/test/org/apache/lucene/spatial3d/geom/CompositeGeoPolygonRelationshipsTest.java
+++ b/lucene/spatial3d/src/test/org/apache/lucene/spatial3d/geom/CompositeGeoPolygonRelationshipsTest.java
@@ -833,7 +833,7 @@ public class CompositeGeoPolygonRelationshipsTest {
     points2.add(point8);
     GeoPolygon p1 = GeoPolygonFactory.makeGeoPolygon(PlanetModel.SPHERE, points1);
     GeoPolygon p2 = GeoPolygonFactory.makeGeoPolygon(PlanetModel.SPHERE, points2);
-    GeoCompositeMembershipShape compositeMembershipShape = new GeoCompositeMembershipShape();
+    GeoCompositeMembershipShape compositeMembershipShape = new GeoCompositeMembershipShape(PlanetModel.SPHERE);
     compositeMembershipShape.addShape(p1);
     compositeMembershipShape.addShape(p2);
     return compositeMembershipShape;

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/94b695e6/lucene/spatial3d/src/test/org/apache/lucene/spatial3d/geom/Geo3DUtil.java
----------------------------------------------------------------------
diff --git a/lucene/spatial3d/src/test/org/apache/lucene/spatial3d/geom/Geo3DUtil.java b/lucene/spatial3d/src/test/org/apache/lucene/spatial3d/geom/Geo3DUtil.java
index e9b7ebc..add46e4 100644
--- a/lucene/spatial3d/src/test/org/apache/lucene/spatial3d/geom/Geo3DUtil.java
+++ b/lucene/spatial3d/src/test/org/apache/lucene/spatial3d/geom/Geo3DUtil.java
@@ -134,12 +134,12 @@ class Geo3DUtil {
       final GeoPolygon component = fromPolygon(polygons[0]);
       if (component == null) {
         // Polygon is degenerate
-        shape = new GeoCompositePolygon();
+        shape = new GeoCompositePolygon(PlanetModel.WGS84);
       } else {
         shape = component;
       }
     } else {
-      final GeoCompositePolygon poly = new GeoCompositePolygon();
+      final GeoCompositePolygon poly = new GeoCompositePolygon(PlanetModel.WGS84);
       for (final Polygon p : polygons) {
         final GeoPolygon component = fromPolygon(p);
         if (component != null) {

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/94b695e6/lucene/spatial3d/src/test/org/apache/lucene/spatial3d/geom/GeoPolygonTest.java
----------------------------------------------------------------------
diff --git a/lucene/spatial3d/src/test/org/apache/lucene/spatial3d/geom/GeoPolygonTest.java
b/lucene/spatial3d/src/test/org/apache/lucene/spatial3d/geom/GeoPolygonTest.java
index 3602e81..00d7899 100755
--- a/lucene/spatial3d/src/test/org/apache/lucene/spatial3d/geom/GeoPolygonTest.java
+++ b/lucene/spatial3d/src/test/org/apache/lucene/spatial3d/geom/GeoPolygonTest.java
@@ -441,7 +441,7 @@ public class GeoPolygonTest {
 
     PlanetModel pm = new PlanetModel(0.7563871189161702, 1.2436128810838298);
     // Build the polygon
-    GeoCompositeMembershipShape c = new GeoCompositeMembershipShape();
+    GeoCompositeMembershipShape c = new GeoCompositeMembershipShape(pm);
     List<GeoPoint> points1 = new ArrayList<>();
     points1.add(new GeoPoint(pm, 0.014071770744627236, 0.011030818292803128));
     points1.add(new GeoPoint(pm, 0.006772117088906782, -0.0012531892445234592));
@@ -500,7 +500,7 @@ shape:
     */
     PlanetModel pm = new PlanetModel(0.8568069516722363, 1.1431930483277637);
     // Build the polygon
-    GeoCompositeMembershipShape c = new GeoCompositeMembershipShape();
+    GeoCompositeMembershipShape c = new GeoCompositeMembershipShape(pm);
     List<GeoPoint> points1 = new ArrayList<>();
     points1.add(new GeoPoint(pm, 1.1577814487635816, 1.6283601832010004));
     points1.add(new GeoPoint(pm, 0.6664570999069251, 2.0855825542851574));
@@ -626,7 +626,7 @@ shape:
     points.add(p1);
 
     final BitSet internal = new BitSet();
-    final GeoCompositePolygon rval = new GeoCompositePolygon();
+    final GeoCompositePolygon rval = new GeoCompositePolygon(PlanetModel.WGS84);
     final GeoPolygonFactory.MutableBoolean mutableBoolean = new GeoPolygonFactory.MutableBoolean();
     
     boolean result = GeoPolygonFactory.buildPolygonShape(rval, mutableBoolean, PlanetModel.WGS84,
points, internal, 0, 1,

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/94b695e6/lucene/spatial3d/src/test/org/apache/lucene/spatial3d/geom/RandomGeoShapeGenerator.java
----------------------------------------------------------------------
diff --git a/lucene/spatial3d/src/test/org/apache/lucene/spatial3d/geom/RandomGeoShapeGenerator.java
b/lucene/spatial3d/src/test/org/apache/lucene/spatial3d/geom/RandomGeoShapeGenerator.java
index f8b6629..ca7aecd 100644
--- a/lucene/spatial3d/src/test/org/apache/lucene/spatial3d/geom/RandomGeoShapeGenerator.java
+++ b/lucene/spatial3d/src/test/org/apache/lucene/spatial3d/geom/RandomGeoShapeGenerator.java
@@ -380,7 +380,7 @@ public class RandomGeoShapeGenerator extends LuceneTestCase {
     while (iterations < MAX_SHAPE_ITERATIONS) {
       iterations++;
       int numberShapes =  random().nextInt(3) + 2;
-      GeoCompositeAreaShape collection = new GeoCompositeAreaShape();
+      GeoCompositeAreaShape collection = new GeoCompositeAreaShape(planetModel);
       for(int i=0; i<numberShapes;i++){
         GeoPolygon member = convexPolygon(planetModel, constraints);
         if (member != null){

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/94b695e6/lucene/spatial3d/src/test/org/apache/lucene/spatial3d/geom/SimpleGeoPolygonRelationshipsTest.java
----------------------------------------------------------------------
diff --git a/lucene/spatial3d/src/test/org/apache/lucene/spatial3d/geom/SimpleGeoPolygonRelationshipsTest.java
b/lucene/spatial3d/src/test/org/apache/lucene/spatial3d/geom/SimpleGeoPolygonRelationshipsTest.java
index 59a52b4..973483e 100644
--- a/lucene/spatial3d/src/test/org/apache/lucene/spatial3d/geom/SimpleGeoPolygonRelationshipsTest.java
+++ b/lucene/spatial3d/src/test/org/apache/lucene/spatial3d/geom/SimpleGeoPolygonRelationshipsTest.java
@@ -829,7 +829,7 @@ public class SimpleGeoPolygonRelationshipsTest {
     points2.add(point7);
     points2.add(point8);
     GeoPolygon pol2 = GeoPolygonFactory.makeGeoPolygon(PlanetModel.SPHERE, points2);
-    GeoCompositeMembershipShape composite = new GeoCompositeMembershipShape();
+    GeoCompositeMembershipShape composite = new GeoCompositeMembershipShape(PlanetModel.SPHERE);
     composite.addShape(pol1);
     composite.addShape(pol2);
     return composite;


Mime
View raw message