@Override public Circle convert(Document source) { if (source == null) { return null; } Document center = (Document) source.get("center"); Number radius = (Number) source.get("radius"); Assert.notNull(center, "Center must not be null!"); Assert.notNull(radius, "Radius must not be null!"); Distance distance = new Distance(toPrimitiveDoubleValue(radius)); if (source.containsKey("metric")) { String metricString = (String) source.get("metric"); Assert.notNull(metricString, "Metric must not be null!"); distance = distance.in(Metrics.valueOf(metricString)); } return new Circle(DocumentToPointConverter.INSTANCE.convert(center), distance); } }
new Circle(criteria.getNear().getPoint(), criteria.getNear().getDistance())); for (GeoResult<GeoLocation<byte[]>> y : x) { allKeys.add(y.getContent().getName());
@Override public Circle convert(Document source) { if (source == null) { return null; } Document center = (Document) source.get("center"); Number radius = (Number) source.get("radius"); Assert.notNull(center, "Center must not be null!"); Assert.notNull(radius, "Radius must not be null!"); Distance distance = new Distance(toPrimitiveDoubleValue(radius)); if (source.containsKey("metric")) { String metricString = (String) source.get("metric"); Assert.notNull(metricString, "Metric must not be null!"); distance = distance.in(Metrics.valueOf(metricString)); } return new Circle(DocumentToPointConverter.INSTANCE.convert(center), distance); } }
private static void applyNear(JsonArray startRange, JsonArray endRange, Iterator<Object> iterator, List<AbstractFalsePositiveEvaluator> evaluators, PropertyPath path) { if (!iterator.hasNext()) { throw new IllegalArgumentException("Not enough parameters for near"); } Point near = checkedNext(iterator, Point.class, "Near queries need a Point as first argument"); Distance distance = checkedNext(iterator, Distance.class, "Near queries need a maximum Distance as second argument"); evaluators.add(new CircleFalsePositiveEvaluator(path, new Circle(near, distance))); double[] boundingBox = GeoUtils.getBoundingBoxForNear(near, distance); startRange.add(boundingBox[0]).add(boundingBox[1]); endRange.add(boundingBox[2]).add(boundingBox[3]); }
private static void applyNear(JsonArray startRange, JsonArray endRange, Iterator<Object> iterator, List<AbstractFalsePositiveEvaluator> evaluators, PropertyPath path) { if (!iterator.hasNext()) { throw new IllegalArgumentException("Not enough parameters for near"); } Point near = checkedNext(iterator, Point.class, "Near queries need a Point as first argument"); Distance distance = checkedNext(iterator, Distance.class, "Near queries need a maximum Distance as second argument"); evaluators.add(new CircleFalsePositiveEvaluator(path, new Circle(near, distance))); double[] boundingBox = GeoUtils.getBoundingBoxForNear(near, distance); startRange.add(boundingBox[0]).add(boundingBox[1]); endRange.add(boundingBox[2]).add(boundingBox[3]); }
new Circle(criteria.getNear().getPoint(), criteria.getNear().getDistance())); for (GeoResult<GeoLocation<byte[]>> y : x) { allKeys.add(y.getContent().getName());
new Circle(criteria.getNear().getPoint(), criteria.getNear().getDistance())); for (GeoResult<GeoLocation<byte[]>> y : x) { allKeys.add(y.getContent().getName());