[gdal-dev] multiple bands in gdal2xyz.py should be comma separated

Even Rouault even.rouault at mines-paris.org
Thu May 31 13:58:05 PDT 2012


Le jeudi 31 mai 2012 12:55:21, Tom van Tilburg a écrit :
> Hi,
> 
> It seems that gdal2xyz.py currently supports the output of multiple
> raster bands using:
>      gdal2xyz.py -band 1 -band 2 etc....
> 
> However, when I use this in combination with the parameter -csv I do not
> get the extected comma in between the values of my bands.
> Extected:   5.604, 50.765, 3, 2
> Received: 5.604, 50.765, 3  2 <== "notice the missing komma"
> 
> I briefly checked the python code and it seems to be an addition to
> 'band_format' is needed.
> 
> band_format = ("%g " * len(bands)).rstrip() + '\n'
> 
> should become something like
> 
> band_format = (("%g " + delim) * len(bands)).rstrip(",") + '\n'

I've committed just a slightly different version in r24523 :

band_format = (("%g" + delim) * len(bands)).rstrip(delim) + '\n'

Thanks

> 
> 
> Cheers,
>      Tom
> _______________________________________________
> gdal-dev mailing list
> gdal-dev at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/gdal-dev


More information about the gdal-dev mailing list