Java Code Examples for org.springframework.data.geo.GeoResults

The following examples show how to use org.springframework.data.geo.GeoResults. These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source Project: flash-waimai   Source File: RestaurantController.java    License: MIT License 6 votes vote down vote up
@RequestMapping(value = "/v4/restaurants", method = RequestMethod.GET)
public Object restaurants(@RequestParam("geohash") String geoHash, @RequestParam("keyword") String keyWord) {
    String[] geoHashArr = geoHash.split(",");
    String longitude = geoHashArr[1];
    String latitude = geoHashArr[0];
    Map<String, Object> params = Maps.newHashMap("name", keyWord);
    System.out.println(Json.toJson(params));
    GeoResults<Map> geoResults = mongoRepository.near(Double.valueOf(longitude), Double.valueOf(latitude),
            "shops", params);
    List<GeoResult<Map>> geoResultList = geoResults.getContent();
    List<Map> list = Lists.newArrayList();
    for (int i = 0; i < geoResultList.size(); i++) {
        Map map = geoResultList.get(i).getContent();
        Distance distance = new Distance(Double.valueOf(longitude), Double.valueOf(latitude),
                Double.valueOf(map.get("longitude").toString()), Double.valueOf(map.get("latitude").toString()));
        map.put("distance", distance.getDistance());
        list.add(map);
    }
    return Rets.success(list);        
}
 
Example 2
/**
 * Test case to show the usage of the geo-spatial APIs to lookup people within a given distance of a reference point.
 */
@Test
public void exposesGeoSpatialFunctionality() {

	GeospatialIndex indexDefinition = new GeospatialIndex("address.location");
	indexDefinition.getIndexOptions().put("min", -180);
	indexDefinition.getIndexOptions().put("max", 180);

	operations.indexOps(Customer.class).ensureIndex(indexDefinition);

	Customer ollie = new Customer("Oliver", "Gierke");
	ollie.setAddress(new Address(new Point(52.52548, 13.41477)));
	ollie = repository.save(ollie);

	Point referenceLocation = new Point(52.51790, 13.41239);
	Distance oneKilometer = new Distance(1, Metrics.KILOMETERS);

	GeoResults<Customer> result = repository.findByAddressLocationNear(referenceLocation, oneKilometer);

	assertThat(result.getContent(), hasSize(1));

	Distance distanceToFirstStore = result.getContent().get(0).getDistance();
	assertThat(distanceToFirstStore.getMetric(), is(Metrics.KILOMETERS));
	assertThat(distanceToFirstStore.getValue(), closeTo(0.862, 0.001));
}
 
Example 3
Source Project: flash-waimai   Source File: MongoRepository.java    License: MIT License 5 votes vote down vote up
/**
 * 查询指定位置附近的商家
 * @param x
 * @param y
 * @param collectionName
 * @param params
 * @param miles 公里数
 * @return
 */
public GeoResults<Map> near(double x, double y, String collectionName, Map<String, Object> params,Integer miles) {
    Point location = new Point(x, y);
    NearQuery nearQuery = NearQuery.near(location).maxDistance(new Distance(miles, Metrics.MILES));
    if (params != null && !params.isEmpty()) {
        Query query = Query.query(criteria(params));
        nearQuery.query(query);
    }
    try {
        return mongoTemplate.geoNear(nearQuery, Map.class, collectionName);
    }catch (Exception e){
        System.out.println(e.getMessage());
    }
    return null;
}
 
Example 4
Source Project: spring-data   Source File: ArangoResultConverter.java    License: Apache License 2.0 5 votes vote down vote up
/**
 * Build a GeoResults object with the ArangoCursor returned by query execution
 *
 * @param cursor
 *            ArangoCursor containing query results
 * @return GeoResults object with all results
 */
@SuppressWarnings({ "rawtypes", "unchecked" })
private GeoResults<?> buildGeoResults(final ArangoCursor<?> cursor) {
	final List<GeoResult<?>> list = new LinkedList<>();
	cursor.forEachRemaining(o -> {
		final GeoResult<?> geoResult = buildGeoResult(o);
		if (geoResult != null) {
			list.add(geoResult);
		}
	});
	return new GeoResults(list);
}
 
Example 5
Source Project: spring-data   Source File: CustomerRepository.java    License: Apache License 2.0 5 votes vote down vote up
GeoResults<Customer> findByNameOrSurnameAndLocationWithinOrLocationWithin(
String name,
String surname,
Point location1,
Distance distance,
Point location2,
Range<Distance> distanceRange);
 
Example 6
Source Project: spring-data   Source File: DerivedQueryCreatorTest.java    License: Apache License 2.0 5 votes vote down vote up
@Test
public void geoResultsTest() {
	final List<Customer> toBeRetrieved = new LinkedList<>();
	final Customer customer1 = new Customer("", "", 0);
	customer1.setLocation(new int[] { 43, 21 });
	toBeRetrieved.add(customer1);
	final Customer customer2 = new Customer("", "", 0);
	customer2.setLocation(new int[] { 21, 43 });
	toBeRetrieved.add(customer2);
	repository.saveAll(toBeRetrieved);
	final Customer customer3 = new Customer("", "", 0);
	customer3.setLocation(new int[] { 70, 50 });
	repository.save(customer3);
	final Customer customer4 = new Customer("", "", 0);
	customer4.setLocation(new int[] { 3, 2 });
	repository.save(customer4);
	final Bound<Double> lowerBound = Bound.inclusive(convertAngleToDistance(30));
	final Bound<Double> upperBound = Bound.inclusive(convertAngleToDistance(50));
	final GeoResults<Customer> retrieved = repository.findByLocationWithin(new Point(1, 0),
		Range.of(lowerBound, upperBound));
	final List<GeoResult<Customer>> expectedGeoResults = new LinkedList<>();
	expectedGeoResults.add(new GeoResult<>(customer1,
			new Distance(getDistanceBetweenPoints(new Point(1, 0), new Point(21, 43)) / 1000, Metrics.KILOMETERS)));
	expectedGeoResults.add(new GeoResult<>(customer2,
			new Distance(getDistanceBetweenPoints(new Point(1, 0), new Point(43, 21)) / 1000, Metrics.KILOMETERS)));
	assertTrue(equals(expectedGeoResults, retrieved, geoCmp, geoEq, false));
}
 
Example 7
Source Project: spring-data   Source File: DerivedQueryCreatorTest.java    License: Apache License 2.0 5 votes vote down vote up
@Test
public void buildPredicateWithDistanceTest() {
	final List<Customer> toBeRetrieved = new LinkedList<>();
	final Customer customer1 = new Customer("+", "", 0);
	customer1.setLocation(new int[] { 89, 89 });
	toBeRetrieved.add(customer1);
	final Customer customer2 = new Customer("", "+", 0);
	customer2.setLocation(new int[] { 5, 0 });
	toBeRetrieved.add(customer2);
	final Customer customer3 = new Customer("", "", 0);
	customer3.setLocation(new int[] { 0, 25 });
	toBeRetrieved.add(customer3);
	repository.saveAll(toBeRetrieved);
	final Customer customer4 = new Customer("", "", 0);
	customer4.setLocation(new int[] { 15, 0 });
	repository.save(customer4);
	final Customer customer5 = new Customer("", "", 0);
	customer5.setLocation(new int[] { 0, 35 });
	repository.save(customer5);
	final double distanceInMeters = convertAngleToDistance(10);
	final Distance distance = new Distance(distanceInMeters / 1000, Metrics.KILOMETERS);
	final Range<Distance> distanceRange = Range.of(
		Bound.inclusive(new Distance(convertAngleToDistance(20) / 1000, Metrics.KILOMETERS)),
		Bound.inclusive(new Distance(convertAngleToDistance(30) / 1000, Metrics.KILOMETERS)));
	final Point location = new Point(0, 0);
	final GeoResults<Customer> retrieved = repository.findByNameOrSurnameAndLocationWithinOrLocationWithin("+", "+",
		location, distance, location, distanceRange);
	final List<GeoResult<Customer>> expectedGeoResults = new LinkedList<>();
	expectedGeoResults.add(new GeoResult<>(customer1,
			new Distance(getDistanceBetweenPoints(location, new Point(89, 89)) / 1000, Metrics.KILOMETERS)));
	expectedGeoResults.add(new GeoResult<>(customer2,
			new Distance(getDistanceBetweenPoints(location, new Point(0, 5)) / 1000, Metrics.KILOMETERS)));
	expectedGeoResults.add(new GeoResult<>(customer3,
			new Distance(getDistanceBetweenPoints(location, new Point(25, 0)) / 1000, Metrics.KILOMETERS)));
	assertTrue(equals(expectedGeoResults, retrieved, geoCmp, geoEq, false));
}
 
Example 8
Source Project: spring-data-examples   Source File: GeoOperationsTests.java    License: Apache License 2.0 5 votes vote down vote up
/**
 * Look up points using a geo-index member as reference.
 */
@Test
public void geoRadiusByMember() {

	GeoResults<GeoLocation<String>> byDistance = geoOperations.geoRadiusByMember("Sicily", "Palermo",
			new Distance(100, DistanceUnit.KILOMETERS));

	assertThat(byDistance).hasSize(2).extracting("content.name").contains("Arigento", "Palermo");

	GeoResults<GeoLocation<String>> greaterDistance = geoOperations.geoRadiusByMember("Sicily", "Palermo",
			new Distance(200, DistanceUnit.KILOMETERS));

	assertThat(greaterDistance).hasSize(3).extracting("content.name").contains("Arigento", "Catania", "Palermo");
}
 
Example 9
Source Project: spring-data-examples   Source File: GeoOperationsTests.java    License: Apache License 2.0 5 votes vote down vote up
/**
 * Lookup points within a circle around coordinates.
 */
@Test
public void geoRadius() {

	Circle circle = new Circle(new Point(13.583333, 37.316667), //
			new Distance(100, DistanceUnit.KILOMETERS));
	GeoResults<GeoLocation<String>> result = geoOperations.geoRadius("Sicily", circle);

	assertThat(result).hasSize(2).extracting("content.name").contains("Arigento", "Palermo");
}
 
Example 10
Source Project: redisson   Source File: RedissonConnection.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public GeoResults<GeoLocation<byte[]>> geoRadius(byte[] key, Circle within) {
    RedisCommand<GeoResults<GeoLocation<byte[]>>> command = new RedisCommand<GeoResults<GeoLocation<byte[]>>>("GEORADIUS", new GeoResultsDecoder());
    return read(key, ByteArrayCodec.INSTANCE, command, key, 
                    convert(within.getCenter().getX()), convert(within.getCenter().getY()), 
                    within.getRadius().getValue(), within.getRadius().getMetric().getAbbreviation());
}
 
Example 11
Source Project: redisson   Source File: RedissonConnection.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public GeoResults<GeoLocation<byte[]>> geoRadius(byte[] key, Circle within, GeoRadiusCommandArgs args) {
    List<Object> params = new ArrayList<Object>();
    params.add(key);
    params.add(convert(within.getCenter().getX()));
    params.add(convert(within.getCenter().getY()));
    params.add(within.getRadius().getValue());
    params.add(within.getRadius().getMetric().getAbbreviation());
    
    RedisCommand<GeoResults<GeoLocation<byte[]>>> command;
    if (args.getFlags().contains(GeoRadiusCommandArgs.Flag.WITHCOORD)) {
        command = new RedisCommand<GeoResults<GeoLocation<byte[]>>>("GEORADIUS", postitionDecoder);
        params.add("WITHCOORD");
    } else {
        MultiDecoder<GeoResults<GeoLocation<byte[]>>> distanceDecoder = new ListMultiDecoder2(new GeoResultsDecoder(within.getRadius().getMetric()), new GeoDistanceDecoder());
        command = new RedisCommand<GeoResults<GeoLocation<byte[]>>>("GEORADIUS", distanceDecoder);
        params.add("WITHDIST");
    }
    
    if (args.getLimit() != null) {
        params.add("COUNT");
        params.add(args.getLimit());
    }
    if (args.getSortDirection() != null) {
        params.add(args.getSortDirection().name());
    }
    
    return read(key, ByteArrayCodec.INSTANCE, command, params.toArray());
}
 
Example 12
Source Project: redisson   Source File: RedissonConnection.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public GeoResults<GeoLocation<byte[]>> geoRadiusByMember(byte[] key, byte[] member, Distance radius,
        GeoRadiusCommandArgs args) {
    List<Object> params = new ArrayList<Object>();
    params.add(key);
    params.add(member);
    params.add(radius.getValue());
    params.add(radius.getMetric().getAbbreviation());
    
    RedisCommand<GeoResults<GeoLocation<byte[]>>> command;
    if (args.getFlags().contains(GeoRadiusCommandArgs.Flag.WITHCOORD)) {
        command = new RedisCommand<GeoResults<GeoLocation<byte[]>>>("GEORADIUSBYMEMBER", postitionDecoder);
        params.add("WITHCOORD");
    } else {
        MultiDecoder<GeoResults<GeoLocation<byte[]>>> distanceDecoder = new ListMultiDecoder2(new GeoResultsDecoder(radius.getMetric()), new GeoDistanceDecoder());
        command = new RedisCommand<GeoResults<GeoLocation<byte[]>>>("GEORADIUSBYMEMBER", distanceDecoder);
        params.add("WITHDIST");
    }
    
    if (args.getLimit() != null) {
        params.add("COUNT");
        params.add(args.getLimit());
    }
    if (args.getSortDirection() != null) {
        params.add(args.getSortDirection().name());
    }
    
    return read(key, ByteArrayCodec.INSTANCE, command, params.toArray());
}
 
Example 13
Source Project: redisson   Source File: RedissonConnection.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public GeoResults<GeoLocation<byte[]>> geoRadius(byte[] key, Circle within) {
    RedisCommand<GeoResults<GeoLocation<byte[]>>> command = new RedisCommand<GeoResults<GeoLocation<byte[]>>>("GEORADIUS", new GeoResultsDecoder());
    return read(key, ByteArrayCodec.INSTANCE, command, key, 
                    convert(within.getCenter().getX()), convert(within.getCenter().getY()), 
                    within.getRadius().getValue(), within.getRadius().getMetric().getAbbreviation());
}
 
Example 14
Source Project: redisson   Source File: RedissonConnection.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public GeoResults<GeoLocation<byte[]>> geoRadius(byte[] key, Circle within, GeoRadiusCommandArgs args) {
    List<Object> params = new ArrayList<Object>();
    params.add(key);
    params.add(convert(within.getCenter().getX()));
    params.add(convert(within.getCenter().getY()));
    params.add(within.getRadius().getValue());
    params.add(within.getRadius().getMetric().getAbbreviation());
    
    RedisCommand<GeoResults<GeoLocation<byte[]>>> command;
    if (args.getFlags().contains(GeoRadiusCommandArgs.Flag.WITHCOORD)) {
        command = new RedisCommand<GeoResults<GeoLocation<byte[]>>>("GEORADIUS", postitionDecoder);
        params.add("WITHCOORD");
    } else {
        MultiDecoder<GeoResults<GeoLocation<byte[]>>> distanceDecoder = new ListMultiDecoder2(new GeoResultsDecoder(within.getRadius().getMetric()), new GeoDistanceDecoder());
        command = new RedisCommand<GeoResults<GeoLocation<byte[]>>>("GEORADIUS", distanceDecoder);
        params.add("WITHDIST");
    }
    
    if (args.getLimit() != null) {
        params.add("COUNT");
        params.add(args.getLimit());
    }
    if (args.getSortDirection() != null) {
        params.add(args.getSortDirection().name());
    }
    
    return read(key, ByteArrayCodec.INSTANCE, command, params.toArray());
}
 
Example 15
Source Project: redisson   Source File: RedissonConnection.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public GeoResults<GeoLocation<byte[]>> geoRadiusByMember(byte[] key, byte[] member, Distance radius,
        GeoRadiusCommandArgs args) {
    List<Object> params = new ArrayList<Object>();
    params.add(key);
    params.add(member);
    params.add(radius.getValue());
    params.add(radius.getMetric().getAbbreviation());
    
    RedisCommand<GeoResults<GeoLocation<byte[]>>> command;
    if (args.getFlags().contains(GeoRadiusCommandArgs.Flag.WITHCOORD)) {
        command = new RedisCommand<GeoResults<GeoLocation<byte[]>>>("GEORADIUSBYMEMBER", postitionDecoder);
        params.add("WITHCOORD");
    } else {
        MultiDecoder<GeoResults<GeoLocation<byte[]>>> distanceDecoder = new ListMultiDecoder2(new GeoResultsDecoder(radius.getMetric()), new GeoDistanceDecoder());
        command = new RedisCommand<GeoResults<GeoLocation<byte[]>>>("GEORADIUSBYMEMBER", distanceDecoder);
        params.add("WITHDIST");
    }
    
    if (args.getLimit() != null) {
        params.add("COUNT");
        params.add(args.getLimit());
    }
    if (args.getSortDirection() != null) {
        params.add(args.getSortDirection().name());
    }
    
    return read(key, ByteArrayCodec.INSTANCE, command, params.toArray());
}
 
Example 16
Source Project: redisson   Source File: RedissonConnection.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public GeoResults<GeoLocation<byte[]>> geoRadius(byte[] key, Circle within) {
    RedisCommand<GeoResults<GeoLocation<byte[]>>> command = new RedisCommand<GeoResults<GeoLocation<byte[]>>>("GEORADIUS", new GeoResultsDecoder());
    return read(key, ByteArrayCodec.INSTANCE, command, key, 
                    convert(within.getCenter().getX()), convert(within.getCenter().getY()), 
                    within.getRadius().getValue(), within.getRadius().getMetric().getAbbreviation());
}
 
Example 17
Source Project: redisson   Source File: RedissonConnection.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public GeoResults<GeoLocation<byte[]>> geoRadius(byte[] key, Circle within, GeoRadiusCommandArgs args) {
    List<Object> params = new ArrayList<Object>();
    params.add(key);
    params.add(convert(within.getCenter().getX()));
    params.add(convert(within.getCenter().getY()));
    params.add(within.getRadius().getValue());
    params.add(within.getRadius().getMetric().getAbbreviation());
    
    RedisCommand<GeoResults<GeoLocation<byte[]>>> command;
    if (args.getFlags().contains(GeoRadiusCommandArgs.Flag.WITHCOORD)) {
        command = new RedisCommand<GeoResults<GeoLocation<byte[]>>>("GEORADIUS", postitionDecoder);
        params.add("WITHCOORD");
    } else {
        MultiDecoder<GeoResults<GeoLocation<byte[]>>> distanceDecoder = new ListMultiDecoder2(new GeoResultsDecoder(within.getRadius().getMetric()), new GeoDistanceDecoder());
        command = new RedisCommand<GeoResults<GeoLocation<byte[]>>>("GEORADIUS", distanceDecoder);
        params.add("WITHDIST");
    }
    
    if (args.getLimit() != null) {
        params.add("COUNT");
        params.add(args.getLimit());
    }
    if (args.getSortDirection() != null) {
        params.add(args.getSortDirection().name());
    }
    
    return read(key, ByteArrayCodec.INSTANCE, command, params.toArray());
}
 
Example 18
Source Project: redisson   Source File: RedissonConnection.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public GeoResults<GeoLocation<byte[]>> geoRadiusByMember(byte[] key, byte[] member, Distance radius,
        GeoRadiusCommandArgs args) {
    List<Object> params = new ArrayList<Object>();
    params.add(key);
    params.add(member);
    params.add(radius.getValue());
    params.add(radius.getMetric().getAbbreviation());
    
    RedisCommand<GeoResults<GeoLocation<byte[]>>> command;
    if (args.getFlags().contains(GeoRadiusCommandArgs.Flag.WITHCOORD)) {
        command = new RedisCommand<GeoResults<GeoLocation<byte[]>>>("GEORADIUSBYMEMBER", postitionDecoder);
        params.add("WITHCOORD");
    } else {
        MultiDecoder<GeoResults<GeoLocation<byte[]>>> distanceDecoder = new ListMultiDecoder2(new GeoResultsDecoder(radius.getMetric()), new GeoDistanceDecoder());
        command = new RedisCommand<GeoResults<GeoLocation<byte[]>>>("GEORADIUSBYMEMBER", distanceDecoder);
        params.add("WITHDIST");
    }
    
    if (args.getLimit() != null) {
        params.add("COUNT");
        params.add(args.getLimit());
    }
    if (args.getSortDirection() != null) {
        params.add(args.getSortDirection().name());
    }
    
    return read(key, ByteArrayCodec.INSTANCE, command, params.toArray());
}
 
Example 19
Source Project: redisson   Source File: RedissonConnection.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public GeoResults<GeoLocation<byte[]>> geoRadius(byte[] key, Circle within) {
    RedisCommand<GeoResults<GeoLocation<byte[]>>> command = new RedisCommand<GeoResults<GeoLocation<byte[]>>>("GEORADIUS", new GeoResultsDecoder());
    return read(key, ByteArrayCodec.INSTANCE, command, key, 
                    convert(within.getCenter().getX()), convert(within.getCenter().getY()), 
                    within.getRadius().getValue(), within.getRadius().getMetric().getAbbreviation());
}
 
Example 20
Source Project: redisson   Source File: RedissonConnection.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public GeoResults<GeoLocation<byte[]>> geoRadius(byte[] key, Circle within, GeoRadiusCommandArgs args) {
    List<Object> params = new ArrayList<Object>();
    params.add(key);
    params.add(convert(within.getCenter().getX()));
    params.add(convert(within.getCenter().getY()));
    params.add(within.getRadius().getValue());
    params.add(within.getRadius().getMetric().getAbbreviation());
    
    RedisCommand<GeoResults<GeoLocation<byte[]>>> command;
    if (args.getFlags().contains(GeoRadiusCommandArgs.Flag.WITHCOORD)) {
        command = new RedisCommand<GeoResults<GeoLocation<byte[]>>>("GEORADIUS", postitionDecoder);
        params.add("WITHCOORD");
    } else {
        MultiDecoder<GeoResults<GeoLocation<byte[]>>> distanceDecoder = new ListMultiDecoder2(new GeoResultsDecoder(within.getRadius().getMetric()), new GeoDistanceDecoder());
        command = new RedisCommand<GeoResults<GeoLocation<byte[]>>>("GEORADIUS", distanceDecoder);
        params.add("WITHDIST");
    }
    
    if (args.getLimit() != null) {
        params.add("COUNT");
        params.add(args.getLimit());
    }
    if (args.getSortDirection() != null) {
        params.add(args.getSortDirection().name());
    }
    
    return read(key, ByteArrayCodec.INSTANCE, command, params.toArray());
}
 
Example 21
Source Project: redisson   Source File: RedissonConnection.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public GeoResults<GeoLocation<byte[]>> geoRadiusByMember(byte[] key, byte[] member, Distance radius,
        GeoRadiusCommandArgs args) {
    List<Object> params = new ArrayList<Object>();
    params.add(key);
    params.add(member);
    params.add(radius.getValue());
    params.add(radius.getMetric().getAbbreviation());
    
    RedisCommand<GeoResults<GeoLocation<byte[]>>> command;
    if (args.getFlags().contains(GeoRadiusCommandArgs.Flag.WITHCOORD)) {
        command = new RedisCommand<GeoResults<GeoLocation<byte[]>>>("GEORADIUSBYMEMBER", postitionDecoder);
        params.add("WITHCOORD");
    } else {
        MultiDecoder<GeoResults<GeoLocation<byte[]>>> distanceDecoder = new ListMultiDecoder2(new GeoResultsDecoder(radius.getMetric()), new GeoDistanceDecoder());
        command = new RedisCommand<GeoResults<GeoLocation<byte[]>>>("GEORADIUSBYMEMBER", distanceDecoder);
        params.add("WITHDIST");
    }
    
    if (args.getLimit() != null) {
        params.add("COUNT");
        params.add(args.getLimit());
    }
    if (args.getSortDirection() != null) {
        params.add(args.getSortDirection().name());
    }
    
    return read(key, ByteArrayCodec.INSTANCE, command, params.toArray());
}
 
Example 22
Source Project: spring-data   Source File: ArangoResultConverter.java    License: Apache License 2.0 4 votes vote down vote up
public GeoResults<?> convertGeoResults() {
	return buildGeoResults(result);
}
 
Example 23
Source Project: java-redis-client   Source File: TracingRedisConnection.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public GeoResults<GeoLocation<byte[]>> geoRadius(byte[] key, Circle within) {
  return helper.doInScope(RedisCommand.GEORADIUS, key, () -> connection.geoRadius(key, within));
}
 
Example 24
Source Project: java-redis-client   Source File: TracingRedisConnection.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public GeoResults<GeoLocation<byte[]>> geoRadius(byte[] key, Circle within,
    GeoRadiusCommandArgs args) {
  return helper
      .doInScope(RedisCommand.GEORADIUS, key, () -> connection.geoRadius(key, within, args));
}
 
Example 25
Source Project: java-redis-client   Source File: TracingRedisConnection.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public GeoResults<GeoLocation<byte[]>> geoRadiusByMember(byte[] key, byte[] member,
    double radius) {
  return helper.doInScope(RedisCommand.GEORADIUSBYMEMBER,
      key, () -> connection.geoRadiusByMember(key, member, radius));
}
 
Example 26
Source Project: java-redis-client   Source File: TracingRedisConnection.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public GeoResults<GeoLocation<byte[]>> geoRadiusByMember(byte[] key, byte[] member,
    Distance radius) {
  return helper.doInScope(RedisCommand.GEORADIUSBYMEMBER,
      key, () -> connection.geoRadiusByMember(key, member, radius));
}
 
Example 27
Source Project: java-redis-client   Source File: TracingRedisConnection.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public GeoResults<GeoLocation<byte[]>> geoRadiusByMember(byte[] key, byte[] member,
    Distance radius, GeoRadiusCommandArgs args) {
  return helper.doInScope(RedisCommand.GEORADIUSBYMEMBER,
      key, () -> connection.geoRadiusByMember(key, member, radius, args));
}
 
Example 28
Source Project: java-redis-client   Source File: TracingRedisConnection.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public GeoResults<GeoLocation<byte[]>> geoRadius(byte[] key, Circle within) {
  return helper.doInScope(RedisCommand.GEORADIUS, key, () -> connection.geoRadius(key, within));
}
 
Example 29
Source Project: java-redis-client   Source File: TracingRedisConnection.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public GeoResults<GeoLocation<byte[]>> geoRadius(byte[] key, Circle within,
    GeoRadiusCommandArgs args) {
  return helper
      .doInScope(RedisCommand.GEORADIUS, key, () -> connection.geoRadius(key, within, args));
}
 
Example 30
Source Project: java-redis-client   Source File: TracingRedisConnection.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public GeoResults<GeoLocation<byte[]>> geoRadiusByMember(byte[] key, byte[] member,
    double radius) {
  return helper.doInScope(RedisCommand.GEORADIUSBYMEMBER,
      key, () -> connection.geoRadiusByMember(key, member, radius));
}