package com.mosty.yjzl.cluster; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Set; public class DistanceRunnable implements Runnable { private WGS84Point point; private Set points; private List neighborList; private long scope; public DistanceRunnable(WGS84Point point, Set points, List neighborList, long scope) { super(); this.point = point; this.points = points; this.neighborList = neighborList; this.scope = scope; } @Override public void run() { Map map = new HashMap<>(); for (WGS84Point point2 : points) { if (point.equals(point2)) { continue; } long distance = PositionUtil.getDistance(point.getLatitude(), point.getLongitude(), point2.getLatitude(), point2.getLongitude()); if (distance < scope) { map.put(point2, distance); } } neighborList.add(new NeighborDTO(point, map)); } }