Make isClose() use actual grid and metric data.

Note that current implementation is somewhat ad-hoc, and not
in line with the algorithm of the paper.