public boolean nearby(Node n, double dist) { if (w == null) { Main.debug("way null"); return false; } if (w.containsNode(n)) return false; if (n.isKeyTrue("noexit")) return false; EastNorth coord = n.getEastNorth(); if (coord == null) return false; Point2D p = new Point2D.Double(coord.east(), coord.north()); if (line.getP1().distance(p) > len + dist) return false; if (line.getP2().distance(p) > len + dist) return false; return line.ptSegDist(p) < dist; }