OpenSenseAction / poligrain

Simplify common tasks for working with point, line and gridded sensor data, focusing on rainfall observations.
https://poligrain.readthedocs.io
BSD 3-Clause "New" or "Revised" License
3 stars 10 forks source link

Force the usage of projected coordinates for nearest-neighbor-lookup in `GridAtPoints` #57

Open cchwala opened 5 months ago

cchwala commented 5 months ago

The implementation for GridAtPoints that I will merge soon via #41 will use lon and lat, because I have no time to change that now. If nnear > 1 the nearest-neighbor-lookup will not be correct because of distorted distances in lon-lat-space.

Hence, we need to either reproject on the fly or force the usage of projected coordinates and not lon and 'lat`.

A related discussion happened already in https://github.com/OpenSenseAction/poligrain/issues/15#issuecomment-1908078372 and in https://github.com/OpenSenseAction/poligrain/pull/43#issuecomment-2039598286.

cchwala commented 3 weeks ago

This need to be discussed again. One can also argue that nnear = 9 anyway does not take the 8 surrounding pixels in all cases even if a equidistant projected grid is used.

Hence, it might maybe be better to correctly implement using the "9er field" with the matching pixel plus the 8 surrounding ones, which should work the same in lon-lat and projected coordinates.