Add natural neighbor (Voronoi-based) interpolation
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 42/100
Research direction
Start by reading the existing idw() and kriging() functions to understand their shared interface and gridding behavior. Then investigate the numpy path using scipy.spatial.Voronoi, along with how a GPU path would be handled. Done means scattered points produce a raster with Sibson natural-neighbor interpolation while preserving the existing interface.
Written by the indexing model from the issue text.
Description
Motivation
The interpolation module currently has IDW, kriging, and spline, but is missing natural neighbor interpolation. This is one of gdal_grid's interpolation methods and is often preferred over IDW because it produces smoother surfaces without the "bullseye" artifacts that IDW tends to create around data points.
Proposed scope
- Given scattered points (x, y, value), produce a gridded raster using Sibson's natural neighbor method.
- The method works by constructing Voronoi diagrams: the interpolated value at a query point is a weighted average of nearby data points, where each weight is proportional to the area "stolen" from that point's Voronoi cell when the query point is inserted.
- Should follow the same interface as the existing
idw()andkriging()functions.
Implementation notes
The Voronoi computation is the expensive part. For the numpy path, scipy.spatial.Voronoi can be leveraged. The GPU path would need a custom Voronoi implementation or a different algorithmic approach.
Additional suggestion
Also worth considering: a simple moving-average gridding method (another gdal_grid mode) as a cheaper alternative for cases where the smoothness of natural neighbor isn't needed.
- Dominant language
- Python
- Stars
- 972
- Forks
- 92
- Avg merge
- 2d 12h
- Merged PRs (30d)
- 7
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from xarray-contrib/xarray-spatial
-
Difficulty 1/5 Under an hour Newbie friendliness 68/100
xarray-contrib/xarray-spatial#3726 ·
-
api area:surface bug severity:medium sweep-api-consistency
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
xarray-contrib/xarray-spatial#3712 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
xarray-contrib/xarray-spatial#3710 ·
-
bug
Difficulty 1/5 1-3 hours Newbie friendliness 88/100
xarray-contrib/xarray-spatial#3707 ·
-
area:surface documentation user-guide-example
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
xarray-contrib/xarray-spatial#3464 ·
All issues in xarray-contrib/xarray-spatial
Similar issues
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
zostera/django-bootstrap4#894 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
use-agent-os/agent-os#3276 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
zephyrproject-rtos/zephyr#119726 ·
-
area/auth bug comp/agent P3 platform/discord type/security
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
NousResearch/hermes-agent#117848 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
zilliztech/memsearch#759 ·