double minDist = Double.MAX_VALUE;
for (Iterator i = result.iterator(); i.hasNext();) {
KdNode nextNode = (KdNode) i.next();
Coordinate testPt = nextNode.getCoordinate();
// ignore segment endpoints
if (testPt.equals2D(p) || testPt.equals2D(q))
continue;
double testRadius = midPt.distance(testPt);
if (testRadius < segRadius) {
// double testDist = seg.distance(testPt);