xoak icon indicating copy to clipboard operation
xoak copied to clipboard

How to leverage initial guesses?

Open willirath opened this issue 5 years ago • 1 comments

We often know that the point we're querying is close to some location where we already know the nearest grid point. Examples are high-resolution observational tracks where the measurement device (ship, float, whatever) can only travel with very limited velocity.

Can we leverage something like the following?

Give me the nearest neighbour of (x, y). It's probably close to (i0, j0).

willirath avatar Aug 03 '20 13:08 willirath

I think that the "hashing / buckets" approach using H3 cells described in #16 could probably help in this case.

We could choose a H3 cell resolution that is the closest to the expected distance to the nearest grid point. This would optimize the computation such that:

  • we only need to search one H3 cell and its direct neighbor cells
  • there shouldn't be too much grid points in this set of H3 cells (minimize computation of actual distances)

One limitation is that choosing a low resolution increases memory footprint of the index (if the H3 resolution is smaller than the model grid resolution, the size of the hash-table will be equivalent to the number of grid points).

benbovy avatar Sep 07 '20 08:09 benbovy