From d43d1ed3b1ed314c901c284e52b40b0572aa8fc1 Mon Sep 17 00:00:00 2001 From: Even Rouault Date: Wed, 8 Jan 2025 23:28:23 +0100 Subject: [PATCH] gdal raster resample: switch to 'nearest' as official name, and 'near' as allowed hidden alias --- apps/gdalalg_raster_reproject.cpp | 5 +++-- autotest/utilities/test_gdal.py | 2 +- doc/source/programs/gdal_raster_reproject.rst | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/apps/gdalalg_raster_reproject.cpp b/apps/gdalalg_raster_reproject.cpp index b3eb388ec35b..5e09c07bd204 100644 --- a/apps/gdalalg_raster_reproject.cpp +++ b/apps/gdalalg_raster_reproject.cpp @@ -36,9 +36,10 @@ GDALRasterReprojectAlgorithm::GDALRasterReprojectAlgorithm(bool standaloneStep) .SetIsCRSArg() .AddHiddenAlias("t_srs"); AddArg("resampling", 'r', _("Resampling method"), &m_resampling) - .SetChoices("near", "bilinear", "cubic", "cubicspline", "lanczos", + .SetChoices("nearest", "bilinear", "cubic", "cubicspline", "lanczos", "average", "rms", "mode", "min", "max", "med", "q1", "q3", - "sum"); + "sum") + .SetHiddenChoices("near"); auto &resArg = AddArg("resolution", 0, diff --git a/autotest/utilities/test_gdal.py b/autotest/utilities/test_gdal.py index ef1f50efaf18..92ec6d58741c 100755 --- a/autotest/utilities/test_gdal.py +++ b/autotest/utilities/test_gdal.py @@ -393,4 +393,4 @@ def test_gdal_completion_pipeline(gdal_path, subcommand): out = gdaltest.runexternal( f"{gdal_path} completion gdal {subcommand} pipeline read foo ! reproject --resampling" ).split(" ") - assert "near" in out + assert "nearest" in out diff --git a/doc/source/programs/gdal_raster_reproject.rst b/doc/source/programs/gdal_raster_reproject.rst index a123dc5d6788..6a27f2dde6de 100644 --- a/doc/source/programs/gdal_raster_reproject.rst +++ b/doc/source/programs/gdal_raster_reproject.rst @@ -38,7 +38,7 @@ Synopsis --overwrite Whether overwriting existing output is allowed -s, --src-crs Source CRS -d, --dst-crs Destination CRS - -r, --resampling Resampling method. RESAMPLING=near|bilinear|cubic|cubicspline|lanczos|average|rms|mode|min|max|med|q1|q3|sum + -r, --resampling Resampling method. RESAMPLING=nearest|bilinear|cubic|cubicspline|lanczos|average|rms|mode|min|max|med|q1|q3|sum --resolution , Target resolution (in destination CRS units) --bbox ,,, Target bounding box (in destination CRS units) --target-aligned-pixels Round target extent to target resolution