OSGeo / gdal

GDAL is an open source MIT licensed translator library for raster and vector geospatial data formats.
https://gdal.org
Other
4.84k stars 2.53k forks source link

add `min`, `max`, `med` and `sum` methods for resampling overviews #3683

Open vincentsarago opened 3 years ago

vincentsarago commented 3 years ago

GitHub issues are for bug reports and suggestions for new features.

As far as I know the only supported methods are:

ref: https://gdal.org/programs/gdaladdo.html#cmdoption-gdaladdo-r

While those are more than enough for typical use case. I still think that having at least the sum method would be nice (especially if you have count data stored as COG. When creating overviews, in theory you would want the sum of the counts instead of the near or average.

I haven't dug to much in the code and I'm not 💯 it's possible to add those methods.

🙏

rouault commented 3 years ago

min, max, med, sum are available only as warp resampling methods, and not overview ones. Warp resampling and overview resampling are different code paths. The reason is that overview resampling can be implemented in a more efficient way than warp resampling. So for each resampling method, work has to be done twice if we want it to be available from everywhere.

vincentsarago commented 3 years ago

Thanks @rouault Just wanted to double check before I or someone start working on it 😀

matsamentet commented 2 years ago

I'd just like to throw in a hopeful comment that having min, max, med and sum in gdaladdo would be very useful :)