|
|
@@ -50,7 +50,7 @@ public class GeoService {
|
|
|
|
|
|
// 查找某位置附近的ID集合
|
|
|
public List<String> findNearbyIds(String geoKey, double longitude, double latitude, double radius) {
|
|
|
- Circle within = new Circle(new Point(longitude, latitude), new Distance(radius, Metrics.KILOMETERS));
|
|
|
+ Circle within = new Circle(new Point(longitude, latitude), new Distance(radius, Metrics.NEUTRAL));
|
|
|
RedisGeoCommands.GeoRadiusCommandArgs args = RedisGeoCommands.GeoRadiusCommandArgs.newGeoRadiusArgs().includeCoordinates().includeDistance();
|
|
|
List<GeoResult<RedisGeoCommands.GeoLocation<String>>> content = redisTemplate.opsForGeo().radius(geoKey, within, args).getContent();
|
|
|
if (content .size()==0) return new ArrayList<String>();
|