lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mikemcc...@apache.org
Subject svn commit: r1696659 - in /lucene/dev/branches/lucene6699/lucene/spatial3d/src: java/org/apache/lucene/geo3d/GeoPoint.java java/org/apache/lucene/geo3d/Vector.java test/org/apache/lucene/geo3d/GeoCircleTest.java
Date Wed, 19 Aug 2015 20:02:03 GMT
Author: mikemccand
Date: Wed Aug 19 20:02:03 2015
New Revision: 1696659

URL: http://svn.apache.org/r1696659
Log:
LUCENE-6699: increase MINIMUM_RESOLUTION

Modified:
    lucene/dev/branches/lucene6699/lucene/spatial3d/src/java/org/apache/lucene/geo3d/GeoPoint.java
    lucene/dev/branches/lucene6699/lucene/spatial3d/src/java/org/apache/lucene/geo3d/Vector.java
    lucene/dev/branches/lucene6699/lucene/spatial3d/src/test/org/apache/lucene/geo3d/GeoCircleTest.java

Modified: lucene/dev/branches/lucene6699/lucene/spatial3d/src/java/org/apache/lucene/geo3d/GeoPoint.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6699/lucene/spatial3d/src/java/org/apache/lucene/geo3d/GeoPoint.java?rev=1696659&r1=1696658&r2=1696659&view=diff
==============================================================================
--- lucene/dev/branches/lucene6699/lucene/spatial3d/src/java/org/apache/lucene/geo3d/GeoPoint.java
(original)
+++ lucene/dev/branches/lucene6699/lucene/spatial3d/src/java/org/apache/lucene/geo3d/GeoPoint.java
Wed Aug 19 20:02:03 2015
@@ -183,4 +183,12 @@ public class GeoPoint extends Vector {
       Math.abs(this.y - y) < MINIMUM_RESOLUTION &&
       Math.abs(this.z - z) < MINIMUM_RESOLUTION;
   }
+  
+  @Override
+  public String toString() {
+    if (this.longitude == Double.NEGATIVE_INFINITY) {
+      return super.toString();
+    }
+    return "[lat="+getLatitude()+", lon="+getLongitude()+"]";
+  }
 }

Modified: lucene/dev/branches/lucene6699/lucene/spatial3d/src/java/org/apache/lucene/geo3d/Vector.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6699/lucene/spatial3d/src/java/org/apache/lucene/geo3d/Vector.java?rev=1696659&r1=1696658&r2=1696659&view=diff
==============================================================================
--- lucene/dev/branches/lucene6699/lucene/spatial3d/src/java/org/apache/lucene/geo3d/Vector.java
(original)
+++ lucene/dev/branches/lucene6699/lucene/spatial3d/src/java/org/apache/lucene/geo3d/Vector.java
Wed Aug 19 20:02:03 2015
@@ -28,7 +28,7 @@ public class Vector {
    * Values that are all considered to be essentially zero have a magnitude
    * less than this.
    */
-  public static final double MINIMUM_RESOLUTION = 1e-12;
+  public static final double MINIMUM_RESOLUTION = 5e-12;
   /**
    * For squared quantities, the bound is squared too.
    */

Modified: lucene/dev/branches/lucene6699/lucene/spatial3d/src/test/org/apache/lucene/geo3d/GeoCircleTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6699/lucene/spatial3d/src/test/org/apache/lucene/geo3d/GeoCircleTest.java?rev=1696659&r1=1696658&r2=1696659&view=diff
==============================================================================
--- lucene/dev/branches/lucene6699/lucene/spatial3d/src/test/org/apache/lucene/geo3d/GeoCircleTest.java
(original)
+++ lucene/dev/branches/lucene6699/lucene/spatial3d/src/test/org/apache/lucene/geo3d/GeoCircleTest.java
Wed Aug 19 20:02:03 2015
@@ -96,6 +96,17 @@ public class GeoCircleTest {
     LatLonBounds b;
     XYZBounds xyzb;
     
+    // Another test case from BKD
+    c = new GeoCircle(PlanetModel.SPHERE, -0.005955031040627789, -0.0029274772647399153,
1.601488279374338E-5);
+    xyzb = new XYZBounds();
+    c.getBounds(xyzb);
+    GeoArea area = GeoAreaFactory.makeGeoArea(PlanetModel.SPHERE,
+      xyzb.getMinimumX(), xyzb.getMaximumX(), xyzb.getMinimumY(), xyzb.getMaximumY(), xyzb.getMinimumZ(),
xyzb.getMaximumZ());
+    
+    int relationship = area.getRelationship(c);
+    System.err.println("relationship = "+relationship);
+    assertTrue(relationship == GeoArea.WITHIN || relationship == GeoArea.OVERLAPS);
+
     // Test case from BKD
     c = new GeoCircle(PlanetModel.SPHERE, -0.765816119338, 0.991848766844, 0.8153163226330487);
     GeoPoint p1 = new GeoPoint(0.7692262265236023, -0.055089298115534646, -0.6365973465711254);



Mime
View raw message