`sample_points` is the wrong thing to check against (it's a tuple containing a coordinate and the corresponding sample values) - looks like it should be replaced by `src_points`.