gdal icon indicating copy to clipboard operation
gdal copied to clipboard

Possibly, same option names for GDAL CLI and GDAL programs

Open PostholerCom opened this issue 8 months ago • 1 comments

Feature description

For instance, using ogr2ogr you would specify a source SRS like: -s_srs EPSG:4326

With CLI it becomes: -s, --src-crs <SRC-CRS>

For readability or porting, 'it would be nice' if they could be the same. The CLI might look like: --s_srs

The same might be said for clipping where CLI is --bbox, it might be --spat or --projwin. Maybe even all 3? Anywhere the existing switches can match the new CLI would be great!

Thanks!

Additional context

No response

PostholerCom avatar Apr 17 '25 21:04 PostholerCom

For readability or porting, 'it would be nice' if they could be the same.

Coming with more consistent option name, and not necessarily sticking to old practices, was a design goal.

For src-crs, --s_srs is actually a hidden alias, but we don't have done that for all arguments. It is expected there will be a learning curve for users familiar with the old utilities

The same might be said for clipping where CLI is --bbox, it might be --spat or --projwin.

projwin convention is different using upper-left corner, lower-right one, whereas bbox uses lower-left, upper-right

rouault avatar Apr 17 '25 21:04 rouault

One of the main ideas of the new GDAL CLI was to "Burn the village to the ground and build again" (page 9 https://docs.google.com/presentation/d/1lNxNJmHDI5_8hU_x9poExuoQgFMNxj2vlDJvB_8ytUk/edit?slide=id.g35bd822d38e_0_19#slide=id.g35bd822d38e_0_19) Possibly GDAL CLI and GDAL programs are using the same option names, if they were used consistently in different GDAL programs. I am not sure if we have any, though.

jratike80 avatar Oct 07 '25 22:10 jratike80