For a simple requirement, check in within 300 meters,use the spring-boot-data-redis
,
just code like this:
Distance distance = new Distance(300, Metrics.MILES);
Circle circle = new Circle(center, distance);
RedisGeoCommands.GeoRadiusCommandArgs args
= RedisGeoCommands.GeoRadiusCommandArgs
.newGeoRadiusArgs().includeCoordinates().includeDistance().limit(1);
return redisUtil.getPointRadius(cacheKey,circle,args);
I cant not get a right result ,so debug with my code
results = ops.radius((String) key,circle,args);
I use the redis command client to calcute two points distance and get a result 1643.68mi
,but get e result 0.902 mi
with the above code during debug this code , are you joking?
I have no ieda to handle this problem , so I try use the Metrics.KILOMETERS instead , just code like this:
Distance distance = new Distance(0.3, Metrics.KILOMETERS);
Just a try ,I get the right result , but why not get the right result use the Metrics.MILES , is there is a bug ?
Comment From: wilkinsona
Spring Data Redis is managed as a separate project. The project's README describes the best ways to get some help.