Skip to content

gdal vector reproject: add --like, --like-layer#14935

Merged
rouault merged 1 commit into
OSGeo:masterfrom
dbaston:vector-reproject-like
Jul 16, 2026
Merged

gdal vector reproject: add --like, --like-layer#14935
rouault merged 1 commit into
OSGeo:masterfrom
dbaston:vector-reproject-like

Conversation

@dbaston

@dbaston dbaston commented Jul 8, 2026

Copy link
Copy Markdown
Member

Includes motivating example from gdal raster zonal-stats.

@dbaston dbaston added the gdal_cli Anything related to the new 3.11 "gdal" CLI frontend label Jul 8, 2026
.AddHiddenAlias("t_srs");
.AddHiddenAlias("t_srs")
.SetMutualExclusionGroup("output-crs");
AddArg("like", 0, _("Dataset from which an output CRS should be extracted"),

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I'm wondering if there isn't a risk of inconsistency, given that in clip the like dataset is used for bounds.
Do we really want only the crs, and not crs+extent ?
If only crs, not to sure about an alternative naming. like-crs could imply that we specify a CRS name as a value. crs-like ? Not too convinced

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I'd say that in "clip", only the extent should be taken from --like, and in "reproject", only the CRS should be taken from --like. If we want to reproject and clip, we should use two pipeline steps.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

maybe @jratike80 has some thoughts about that?

For the sake of brainstorming, another alternative could be to make --dst-crs accept a dataset name, although that could be messy, especially for autocompletion purposes

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

another alternative could be to make --dst-crs accept a dataset name

You could use the @filename syntax used elsewhere, though I think it's less clear/discoverable than a separate argument.

@rouault rouault added this to the 3.14.0 milestone Jul 16, 2026
@rouault
rouault merged commit 6367047 into OSGeo:master Jul 16, 2026
33 of 37 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gdal_cli Anything related to the new 3.11 "gdal" CLI frontend

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants