Skip to content

Commit

Permalink
gdal raster resample: switch to 'nearest' as official name, and 'near…
Browse files Browse the repository at this point in the history
…' as allowed hidden alias
  • Loading branch information
rouault committed Jan 8, 2025
1 parent 92bf531 commit d43d1ed
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
5 changes: 3 additions & 2 deletions apps/gdalalg_raster_reproject.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion autotest/utilities/test_gdal.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion doc/source/programs/gdal_raster_reproject.rst
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ Synopsis
--overwrite Whether overwriting existing output is allowed
-s, --src-crs <SRC-CRS> Source CRS
-d, --dst-crs <DST-CRS> Destination CRS
-r, --resampling <RESAMPLING> Resampling method. RESAMPLING=near|bilinear|cubic|cubicspline|lanczos|average|rms|mode|min|max|med|q1|q3|sum
-r, --resampling <RESAMPLING> Resampling method. RESAMPLING=nearest|bilinear|cubic|cubicspline|lanczos|average|rms|mode|min|max|med|q1|q3|sum
--resolution <xres>,<yres> Target resolution (in destination CRS units)
--bbox <xmin>,<ymin>,<xmax>,<ymax> Target bounding box (in destination CRS units)
--target-aligned-pixels Round target extent to target resolution
Expand Down

0 comments on commit d43d1ed

Please sign in to comment.