<div dir="ltr"><div>Hello all,</div><div><br></div><div>Due to question at <a href="https://gis.stackexchange.com/questions/398223/how-to-remap-gdal-options-from-string-version-to-a-dictionary-version">https://gis.stackexchange.com/questions/398223/how-to-remap-gdal-options-from-string-version-to-a-dictionary-version</a></div><div></div><div></div><div>I've taken a look at code<br></div><div><br></div><div>When trying to use gdal.Warp from Python, most options are supported but some seems to be missing</div><div>Although an approach with only `gdal.Warp(dest, origin, options='-overwrite')` can work without code change,<br>the dict approach like below seems to be simpler from a Python perspective<br><br>kwargsoptions = {"overwrite": True} # particular key does not exist, just for the explanation<br>gdal.Warp(dest, origin, **kwargsoptions)<br><br>Below are the command options I only found in gdalwarp command line but absent in the WarpOptions (from doc <a href="https://gdal.org/programs/gdalwarp.html#cmdoption-gdalwarp-r">https://gdal.org/programs/gdalwarp.html#cmdoption-gdalwarp-r</a>)<br><br>[-ct string]<br>[-novshiftgrid]<br>[-refine_gcps tolerance [minimum_gcps]]<br>[-ovr level|AUTO|AUTO-n|NONE]<br>[-srcalpha|-nosrcalpha]<br>[-q]<br>[-if format]*<br>[-overwrite]<br>[-oo NAME=VALUE]*<br>[-doo NAME=VALUE]*<br><br>-srcalpha is present but not it counterpart -nosrcalpha<br><br>In gdal.py code, there are references to resampling option not in the doc e.g below excerpt<br>(from <a href="https://github.com/OSGeo/gdal/blob/master/gdal/swig/python/osgeo/gdal.py#L588">https://github.com/OSGeo/gdal/blob/master/gdal/swig/python/osgeo/gdal.py#L588</a>) .<br><br>elif resampleAlg == GRIORA_Bilinear:<br>    new_options += ['-rb']<br>elif resampleAlg == GRIORA_Cubic:<br>    new_options += ['-rc']<br>elif resampleAlg == GRIORA_CubicSpline:<br>    new_options += ['-rcs']<br><br>It may to need to be removed if looking at <a href="https://gdal.org/programs/gdalwarp.html#cmdoption-gdalwarp-r">https://gdal.org/programs/gdalwarp.html#cmdoption-gdalwarp-r</a><br>e.g (no -rcs, -rb or -rc options) except maybe for compatibility reason<br><br>I will try to make a PR. The main issue is more about naming for each option.<br>I also don't know if command line and Python API "unsync" is due to evolution, to intended API choices or other reasons.<br><br>I also only discuss here the gdal.Warp options but I suppose there are maybe other Python tools ported from RFC 59<br><a href="https://gdal.org/development/rfc/rfc59_utilities_as_a_library.html">https://gdal.org/development/rfc/rfc59_utilities_as_a_library.html</a> that may have the same "unsync" issue.</div><div>Did not look at the moment<br><br><br>Regards<br><br>Thomas Gratier<br></div></div>