Adds distance calculation between line vertices and sample points. Also test for some grid2line functions.