// spatial search with tolerance
private Node findClosestNodeWithinTolerance(Coordinate inCoord) {
double closestDistance = Double.MAX_VALUE;
Coordinate closestCoordinate = null;
List<Coordinate> list = spatialIndex.query(new Interval(inCoord.y - tolerance, inCoord.y + tolerance));
for (Coordinate c : list) {
double distance = inCoord.distance(c);
if (distance < closestDistance) {
closestDistance = distance;
closestCoordinate = c;