[gdal-dev] Sampling raster bands at irregular points

Felix felix.divo at sailingteam.tu-darmstadt.de
Thu Dec 3 05:16:24 PST 2020


Hello All,

I'm here for some suggestions on how to sample from a raster band at 
_non-regular_ points. Non-regular in this context means that the points 
have arbitrary coordinates and do not lie on a regular lattice/mesh like 
all pairs of integers would do.

In my application, there is an irregular set of points for which we 
require bathymetric data (i.e. topographical data/elevation). I started 
out by manually reading in the ETOPO1 dataset (for now, we might use 
Earth2014 later) and then interpolating around each point sequentially. 
As we have up to hundred-tousands of points and doing the computation 
sequentially in Python/numpy, this is currently running for days (well, 
we canceled it at that point).

Ideally, I'd like to use something like the "gdal_grid" tool, where the 
interpolation algorithm can be configured and the heavy-lifting is done 
in C rather than in Python. But it only supports creating a new 
_regular_ grid. The inverse distance interpolation with cutoff radii 
would be ideal.

Does such a tool/such functionality exist in in GDAL or was my search 
rightfully fruitless? I mainly searched in the raster programs, the 
(C++) API of GDALRasterBand and of course generally in the internet. 
Thank you for your suggestions, in advance!

Cheers and Stay Safe
Felix Divo



More information about the gdal-dev mailing list