Skip to content

Conversation

@sidhansu10
Copy link
Contributor

@sidhansu10 sidhansu10 commented Jan 3, 2026

This PR adds concise CLI examples for a small set of commonly confusing options, following the approach discussed in #12098.
Scope: - gdal_translate: -r (bilinear), -projwin
Examples are static .. code-block:: console snippets with brief contextual explanations to keep the change simple and reviewable.
Happy to adjust scope or format based on feedback.

@sidhansu10 sidhansu10 force-pushed the doc-gdal-contour-nodata branch from b160c21 to aa6b4b6 Compare January 4, 2026 16:18
@sidhansu10 sidhansu10 changed the title DOC: clarify interaction of -inodata and -snodata in gdal_contour Doc: add CLI examples for common non-trivial options Jan 4, 2026
@dbaston
Copy link
Member

dbaston commented Jan 5, 2026

Examples should be placed in the "examples" section of the page and referenced from the option documentation.

@jratike80
Copy link
Collaborator

For my mind we should concentrate on the new gdal CLI program. In this case raster convert + resize. But hopefully the new, small subcommands are not as confusing as the old CLI programs. Resampling methods are described shortly in https://gdal.org/en/stable/programs/gdal_raster_resize.html#cmdoption-r and in https://gdal.org/en/stable/programs/gdal_raster_reproject.html#cmdoption-r. Considerations about what resampling method to use are partly opinion based and might fit better to some common knowledge base topic. But we do not have such.


.. code-block:: console
gdal_translate -r bilinear input.tif resampled.tif
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure is just this exaple makes sense at all. The size remains the same so perhaps no resampling happens and the -r argument does not have any effect. I may be wrong, though.

@sidhansu10
Copy link
Contributor Author

sidhansu10 commented Jan 6, 2026

Thanks for the feedback. I’ve updated the -r example to include an explicit size change so resampling definitely occurs, and adjusted the -projwin option text to reference the Examples section instead of duplicating an inline example. Please let me know if this looks good now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants