Ejemplo n.º 1
0
 public long findBetween(GeoPoint pointA, GeoPoint pointB) {
   Point a = pointA.toPoint(1000.0);
   Point b = pointB.toPoint(1000.0);
   double x = (a.x + b.x) * 0.5;
   double y = (a.y + b.y) * 0.5;
   double z = (a.z + b.z) * 0.5;
   double l = 1000.0 / Vector.computeDistance(x, y, z);
   x *= l;
   y *= l;
   z *= l;
   assert Math.abs(
           Vector.computeDistance(a.x - x, a.y - y, a.z - z)
               - Vector.computeDistance(b.x - x, b.y - y, b.z - z))
       < 0.0005;
   globalPointMap.intersect(bounds.load(x, y, z), this.reset());
   assert found;
   assert globalPointEntry.getSeq() >= 0;
   return globalPointEntry.getSeq();
 }
Ejemplo n.º 2
0
 public long find(Point point) {
   globalPointMap.intersect(bounds.load(point), this.reset());
   assert found;
   assert globalPointEntry.getSeq() >= 0;
   return globalPointEntry.getSeq();
 }