[GRASS5] [bug #4089] (grass) r.out.gdal doesn't handle multiple creation options correctly

this bug's URL: http://intevation.de/rt/webrt?serial_num=4089
-------------------------------------------------------------------------

Subject: r.out.gdal doesn't handle multiple creation options correctly

Platform: Mac OSX
grass obtained from: Trento Italy site
grass binary for platform: Compiled from Sources
GRASS Version: 6.0.1/6.1 CVS
GDAL version: 1.3.1

The documentation for r.out.gdal states that multiple creation option can be specified (though it
doesn't say how - separate by spaces and quote the whole thing). But it doesn't pass that to gdal
correctly. In gdal_translate, multiple creation options are specified separately, as in:

-co OPT1=VAL -co OPT2=VAL ...

But r.out.gdal just prepends a single -co to the whole string passed to r.out.gdal (and quotes are lost
also):

-co OPT1=VAL OPT2=VAL

So, any extra creation options are seen as gdal_translate options, not creation options.

As a workaround, I found it is possible to added the extra needed '-co' tags to r.out.gdal and all
creation options are then recognized:

r.out.gdal .... createopt="OPT1=VAL -co OPT2=VAL"

which comes out in the gdal_translate command as:

... -co OPT1=VAL -co OPT2=VAL

as desired.

I suspect the metadata r.out.gdal option has the same problem.

To fix r.out.gdal, it would have to loop thru each of the items in the createopt string and prepend -
co to each.

-------------------------------------------- Managed by Request Tracker