Opened 11 years ago

Closed 11 years ago

Last modified 10 years ago

#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)

comment:1 by warmerdam, 11 years ago

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.

in reply to:  1 comment:2 by lpinner, 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 Kyle Shannon, 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 Even Rouault, 11 years ago

Milestone: 2.0
Resolution: fixed
Status: newclosed

Ah right. I did implement this without knowing about the ticket.

comment:5 by Even Rouault, 10 years ago

Milestone: 2.01.11.0
Note: See TracTickets for help on using tickets.