增加一个基于地理位置的近似查询，当conversation的属性中有对应的地址位置与指定的地理位置间距不超过指定距离时返回

@param key
@param point       指定的地理位置
@param maxDistance 距离，以英里计算
@return
187371
public AVIMConversationsQuery whereWithinMiles(String key, AVGeoPoint point, double maxDistance) {
    conditions.whereWithinMiles(key, point, maxDistance);
    return this;
  }
1219453
function setMaxDistance(direction, distance) {
    		distance = Math.max(distance, getMaxDistance(direction) );
    		maximumsMap[direction].distance = distance;
		}
1010644
public void add(ESRIPoint point) {
		if (point.getX() < this.minx) {
			this.minx = point.getX();
		}
		if (point.getX() > this.maxx) {
			this.maxx = point.getX();
		}
		if (point.getY() < this.miny) {
			this.miny = point.getY();
		}
		if (point.getY() > this.maxy) {
			this.maxy = point.getY();
		}
		if (point.getZ() < this.minz) {
			this.minz = point.getZ();
		}
		if (point.getZ() > this.maxz) {
			this.maxz = point.getZ();
		}
		if (point.getM() < this.minm) {
			this.minm = point.getM();
		}
		if (point.getM() > this.maxm) {
			this.maxm = point.getM();
		}
	}
732706
private Pair<EnumFacing, Point> getClosest(List<Pair<EnumFacing, Point>> points)
	{
		double distance = Double.MAX_VALUE;
		Pair<EnumFacing, Point> ret = null;
		for (Pair<EnumFacing, Point> pair : points)
		{
			double d = Point.distanceSquared(src, pair.getRight());
			if (distance > d)
			{
				distance = d;
				ret = pair;
			}
		}

		return ret;
	}
952896
@Unit(NM)
    public static double radius(Location... location)
    {
        Location center = center(location);
        double max = 0;
        for (Location loc : location)
        {
            Distance distance = distance(loc, center);
            double miles = distance.getMiles();
            if (miles > max)
            {
                max = miles;
            }
        }
        return max;
    }
953626
public function geo_distance(string $key, $location, string $distance): GeoDistance
    {
        return new GeoDistance($key, $location, $distance);
    }
119158
@Override
	@Pure
	public double getDistance(Point2D<?, ?> point) {
		double dist = super.getDistance(point);
		dist -= this.radius;
		return dist;
	}
753529
@ExperimentalApi("https://github.com/grpc/grpc-java/issues/2563")
  public CallOptions withMaxOutboundMessageSize(int maxSize) {
    checkArgument(maxSize >= 0, "invalid maxsize %s", maxSize);
    CallOptions newOptions = new CallOptions(this);
    newOptions.maxOutboundMessageSize = maxSize;
    return newOptions;
  }
1052452
public Point getPoint(int position) {
        if (position<0 || position>=size()) throw new ArrayIndexOutOfBoundsException("Invalid position: " + position);
        return new Point(coordinates[0][position],coordinates[1][position]);
    }
535958
@NonNull
  public static Feature nearestPointOnLine(@NonNull Point pt, @NonNull List<Point> coords) {

    if (coords.size() < 2) {
      throw new TurfException("Turf nearestPointOnLine requires a List of Points "
        + "made up of at least 2 coordinates.");
    }

    Feature closestPt = Feature.fromGeometry(
      Point.fromLngLat(Double.POSITIVE_INFINITY, Double.POSITIVE_INFINITY));
    closestPt.addNumberProperty("dist", Double.POSITIVE_INFINITY);

    for (int i = 0; i < coords.size() - 1; i++) {
      Feature start = Feature.fromGeometry(coords.get(i));
      Feature stop = Feature.fromGeometry(coords.get(i + 1));
      //start
      start.addNumberProperty("dist", TurfMeasurement.distance(
        pt, (Point) start.geometry(), TurfConstants.UNIT_MILES));
      //stop
      stop.addNumberProperty("dist", TurfMeasurement.distance(
        pt, (Point) stop.geometry(), TurfConstants.UNIT_MILES));
      //perpendicular
      double heightDistance = Math.max(
        start.properties().get("dist").getAsDouble(),
        stop.properties().get("dist").getAsDouble()
      );
      double direction = TurfMeasurement.bearing((Point) start.geometry(),
        (Point) stop.geometry());
      Feature perpendicularPt1 = Feature.fromGeometry(
        TurfMeasurement.destination(pt, heightDistance, direction + 90,
          TurfConstants.UNIT_MILES));
      Feature perpendicularPt2 = Feature.fromGeometry(
        TurfMeasurement.destination(pt, heightDistance, direction - 90,
          TurfConstants.UNIT_MILES));
      LineIntersectsResult intersect = lineIntersects(
        ((Point) perpendicularPt1.geometry()).longitude(),
        ((Point) perpendicularPt1.geometry()).latitude(),
        ((Point) perpendicularPt2.geometry()).longitude(),
        ((Point) perpendicularPt2.geometry()).latitude(),
        ((Point) start.geometry()).longitude(),
        ((Point) start.geometry()).latitude(),
        ((Point) stop.geometry()).longitude(),
        ((Point) stop.geometry()).latitude()
      );

      Feature intersectPt = null;
      if (intersect != null) {
        intersectPt = Feature.fromGeometry(
          Point.fromLngLat(intersect.horizontalIntersection(), intersect.verticalIntersection()));
        intersectPt.addNumberProperty("dist", TurfMeasurement.distance(pt,
          (Point) intersectPt.geometry(), TurfConstants.UNIT_MILES));
      }

      if ((double) start.getNumberProperty("dist")
        < (double) closestPt.getNumberProperty("dist")) {
        closestPt = start;
        closestPt.addNumberProperty(INDEX_KEY, i);
      }
      if ((double) stop.getNumberProperty("dist")
        < (double) closestPt.getNumberProperty("dist")) {
        closestPt = stop;
        closestPt.addNumberProperty(INDEX_KEY, i);
      }
      if (intersectPt != null
        && (double) intersectPt.getNumberProperty("dist")
        < (double) closestPt.getNumberProperty("dist")) {
        closestPt = intersectPt;
        closestPt.addNumberProperty(INDEX_KEY, i);
      }
    }

    return closestPt;
  }
533043
@SuppressWarnings("unchecked")
	public <T> T get(String key) {
		Preconditions.checkArgument(key != null && !key.isEmpty(), "Parameter 'key' must not be [" + key + "]");
		Context context = factory.enterContext();
		
		try {
			if (values.containsKey(key)) {
				Object value = values.get(key);
				return (T) ((value instanceof Function) 
						? ((Function) value).call(context, scope, (Scriptable) value, null)
						: value);
			}
			
			synchronized (values) {
				if (values.containsKey(key)) {
					Object value = values.get(key);
					return (T) ((value instanceof Function) 
							? ((Function) value).call(context, scope, (Scriptable) value, null)
							: value);
				} else if (key.equals(ENDPOINTS)) {
					Object endpoints = scope.get(ENDPOINTS);
					
					if (endpoints == null && configuration != null) {
						endpoints = Collections2.filter((Collection<Class<?>>) get(COMPONENTS), new Predicate<Class<?>>() {

							@Override
							public boolean apply(Class<?> clazz) {
								return clazz.isAnnotationPresent(Endpoint.class);
							}
							
						});
					}
					
					values.put(ENDPOINTS, endpoints);
					return (T) ((endpoints instanceof Function) 
							? ((Function) endpoints).call(context, scope, (Scriptable) endpoints, null)
							: endpoints);
				} else if (key.equals(PIPELINE)) {
					Object pipeline = scope.get(PIPELINE);
					
					if (pipeline == null && configuration != null) {
						Pipeline<WebContext> p = configuration.pipeline();
						p.remove(2);
						p.set(2, "JaguarInvoke", new Invoke() {
							
							@Override
							protected <E> E instantiate(Class<E> endpoint) throws Exception {
								return component(endpoint);
							}
							
						});
						pipeline = p;
					}
					
					values.put(PIPELINE, pipeline);
					return (T) ((pipeline instanceof Function) 
							? ((Function) pipeline).call(context, scope, (Scriptable) pipeline, null)
							: pipeline);
				} else if (key.equals(REQUEST_TYPES)) {
					Object requestTypes = scope.get(REQUEST_TYPES);
					
					if (requestTypes == null && configuration != null) {
						requestTypes = configuration.requestTypes();
					}
					
					values.put(REQUEST_TYPES, requestTypes);
					return (T) ((requestTypes instanceof Function) 
							? ((Function) requestTypes).call(context, scope, (Scriptable) requestTypes, null)
							: requestTypes);
				} else if (key.equals(RESPONSE_TYPES)) {
					Object responseTypes = scope.get(RESPONSE_TYPES);
					
					if (responseTypes == null && configuration != null) {
						responseTypes = configuration.responseTypes();
					}
					
					values.put(RESPONSE_TYPES, responseTypes);
					return (T) ((responseTypes instanceof Function) 
							? ((Function) responseTypes).call(context, scope, (Scriptable) responseTypes, null)
							: responseTypes);
				} else if (key.equals(ROUTING)) {
					Object routing = scope.get(ROUTING);
					
					if (routing == null && configuration != null) {
						routing = configuration.routing();
					}
					
					values.put(ROUTING, routing);
					return (T) ((routing instanceof Function) 
							? ((Function) routing).call(context, scope, (Scriptable) routing, null)
							: routing);
				} else if (key.equals(DEPLOYMENT)) {
					Object deployment = scope.get(DEPLOYMENT);
					values.put(DEPLOYMENT, deployment);
					return (T) ((deployment instanceof Function) 
							? ((Function) deployment).call(context, scope, (Scriptable) deployment, null)
							: deployment);
				} else if (key.equals(COMPONENTS)) {
					Object components = scope.get(COMPONENTS);
					
					if (components == null) {
						components = components();
					}
					
					values.put(COMPONENTS, components);
					return (T) ((components instanceof Function) 
							? ((Function) components).call(context, scope, (Scriptable) components, null)
							: components);
				} else {
					Object value = scope.get(key);
					
					if (value == null) {
						return null;
					}
					
					values.put(key, value);
					return (T) ((value instanceof Function) 
							? ((Function) value).call(context, scope, (Scriptable) value, null)
							: value);
				}
			}
			
		} finally {
			Context.exit();
		}
	}
279488
public void removeLocation(final String key, final CompletionListener completionListener) {
        if (key == null) {
            throw new NullPointerException();
        }
        DatabaseReference keyRef = this.getDatabaseRefForKey(key);
        if (completionListener != null) {
            keyRef.setValue(null, new DatabaseReference.CompletionListener() {
                @Override
                public void onComplete(DatabaseError databaseError, DatabaseReference databaseReference) {
                    completionListener.onComplete(key, databaseError);
                }
            });
        } else {
            keyRef.setValue(null);
        }
    }
925603
@SuppressWarnings({ "cast", "unchecked" })
  public static <O extends SpatialComparable> RangeQuery<O> getRangeQuery(AbstractRStarTree<?, ?, ?> tree, SpatialDistanceQuery<O> distanceQuery, Object... hints) {
    // Can we support this distance function - spatial distances only!
    SpatialPrimitiveDistanceFunction<? super O> df = distanceQuery.getDistanceFunction();
    if(EuclideanDistanceFunction.STATIC.equals(df)) {
      return (RangeQuery<O>) new EuclideanRStarTreeRangeQuery<>(tree, (Relation<NumberVector>) distanceQuery.getRelation());
    }
    return new RStarTreeRangeQuery<>(tree, distanceQuery.getRelation(), df);
  }
882860
public static Location of(final Point point) {
		requireNonNull(point);
		return of(
			point.getLatitude(),
			point.getLongitude(),
			point.getElevation().orElse(null)
		);
	}
446284
public int distance(CLDR.Locale desired, CLDR.Locale supported, int threshold) {
    // Query the top level LANGUAGE
    boolean langEquals = desired.language().equals(supported.language());
    Node node = distanceMap.get(desired.language(), supported.language());
    if (node == null) {
      node = distanceMap.get(ANY, ANY);
    }
    int distance = node.wildcard() ? (langEquals ? 0 : node.distance()) : node.distance();
    
    if (distance >= threshold) {
      return MAX_DISTANCE;
    }
    
    // Go to the next level SCRIPT
    DistanceMap map = node.map();

    boolean scriptEquals = desired.script().equals(supported.script());
    node = map.get(desired.script(), supported.script());
    if (node == null) {
      node = map.get(ANY, ANY);
    }
    distance += node.wildcard() ? (scriptEquals ? 0 : node.distance()) : node.distance();
    
    if (distance >= threshold) {
      return MAX_DISTANCE;
    }

    // Go to the next level TERRITORY
    map = node.map();

    // If the territories happen to be equal, distance is 0 so we're done.
    if (desired.territory().equals(supported.territory())) {
      return distance;
    }

    // Check if the map contains a distance between these two regions.
    node = map.get(desired.territory(), supported.territory());
    if (node == null) {
      // Compare the desired region against supported partitions, and vice-versa.
      node = scanTerritory(map, desired.territory(), supported.territory());
    }
    if (node != null) {
      distance += node.distance();
      return distance < threshold ? distance : MAX_DISTANCE;
    }
    
    // Find the maximum distance between the partitions.
    int maxDistance = 0;

    // These partition sets are always guaranteed to exist and contain at least 1 member.
    boolean match = false;
    Set<String> desiredPartitions = PARTITION_TABLE.getRegionPartition(desired.territory());
    Set<String> supportedPartitions = PARTITION_TABLE.getRegionPartition(supported.territory());

    for (String desiredPartition : desiredPartitions) {
      for (String supportedPartition : supportedPartitions) {
        node = map.get(desiredPartition, supportedPartition);
        if (node != null) {
          maxDistance = Math.max(maxDistance, node.distance());
          match = true;
        }
      }
    }

    if (!match) {
      node = map.get(ANY, ANY);
      maxDistance = Math.max(maxDistance, node.distance());
    }
    
    distance += maxDistance;
    return distance < threshold ? distance : MAX_DISTANCE;
  }
1281864
public TriangulationPoint pointCCW( TriangulationPoint point )
    {
        if( point == points[0] )
        {
            return points[1];
        }
        else if( point == points[1] )
        {
            return points[2];
        }
        else if( point == points[2] )
        {
            return points[0];
        }
        logger.error( "point location error" );
        throw new RuntimeException("[FIXME] point location error");
    }
882168
@Override
    public C setLocation(final Point2D p)
    {
        setX(p.getX());

        setY(p.getY());

        return cast();
    }