point_in does not match get_val
jhill1 opened this issue · comments
Due to interpolation, point_in() can return true, but interpolation of data in get_val() can require data from the neighbouring cell, which might fall outside the extents.
To solve: add extra code to check within extent - resolution and add a test to check this works correctly.
I believe I've just run into this issue myself. Seems like the original fix was to change the number of iterations in extend_mask
from 1 to 3, but the current version is set back to 1. Is this because setting it to >1 caused some other issue?
I've fixed in my local version by adding diagonals into extend_mask
. I also changed to a vectorised implementation, which is a decent speedup for my use case. Happy to put up a PR if this is considered a suitable fix.
Damn; I thought I'd fixed that one properly! Clearly my tests are not robust enough. Please do put in a PR. Thanks!
Will do!