#5036 closed enhancement (fixed)
Allow multiple -scale switches in gdal_translate
Reported by: | lpinner | Owned by: | warmerdam |
---|---|---|---|
Priority: | normal | Milestone: | 1.11.0 |
Component: | Utilities | Version: | unspecified |
Severity: | normal | Keywords: | |
Cc: |
Description
It would be useful if gdal_translate could accept multiple -scale switches to allow different scales to be applied to individual bands.
Suggested logic:
- if a single -scale switch is passed, apply to all bands (or only those specified by -b switch) - i.e. current logic
- if N -scale switches are passed and there are N bands, apply -scale switches in the order they were passed to bands in dataset order
- if N -scale and N -b switches are passed, apply -scale switches in the order they were passed to bands in the order they were passed in by -b switches
- if N -scale and a different number of -b switches are passed, raise an error
Change History (5)
follow-up: 2 comment:1 by , 11 years ago
comment:2 by , 11 years ago
Fair enough. That's what I do now (separate vrts then merge). I was just hoping to be able to do it in one hit (aka being lazy), I'll go away and write a wrapper script instead.
Luke
comment:3 by , 11 years ago
Luke, See r26097, seems like it may be what you are looking for. I don't know if EvenR knows about this ticket.
comment:4 by , 11 years ago
Milestone: | → 2.0 |
---|---|
Resolution: | → fixed |
Status: | new → closed |
Ah right. I did implement this without knowing about the ticket.
comment:5 by , 10 years ago
Milestone: | 2.0 → 1.11.0 |
---|
Note:
See TracTickets
for help on using tickets.
It really feels like this going to end up overcomplicating the gdal_translate commandline. You could process each band to a separate file, doing the -scale as you go, then remerge afterwards.
Note that VRTs can also be used to apply per band scaling if so desired.