[Qgis-developer] Should QGIS use generic names for raster bands

Marco Hugentobler marco.hugentobler at karto.baug.ethz.ch
Sun Jul 20 02:55:42 EDT 2008


Hi Peter,

I also prefer generic names.

> If we are to go with generic band names, I will not be winning any
> popularity contests with the users because the band name is stored in
> the project file rather than just the band number. While it may seem
> trivial, I think that this is actually a very important decision as we
> move toward trying to get version 1.0 out.

In my opinion, technical decisions should have priority over project file 
compatibility issues.
And there is the possibility to write some code to transform project files to 
new version (see the project file transformation framework provided by Magnus 
in qgsprojectfiletransform.cpp/h). There you could write a new method 
(transform0110to1000), iterate over the raster layers and transform the band 
names to band numbers.

Regards,
Marco

Am Freitag 18 Juli 2008 17:50:31 schrieb Peter Ersts:
> Howdy devs.
>
> A comment on the recent ticket has gotten me thinking. Should QGIS use
> generic names (i.e., Band 1, Band 2 etc) rather than using the band
> names stored in the raster file itself?
>
> Take these two geotiffs. They are the same data (Landsat band 1,2,3,4,5,
> and 7 in that order) but were created with two different applications.
> Here are the band names as reported by GDAL
>
> GeoTiff_ENVI:
> Band 1 Block=256x1 Type=Byte, ColorInterp=Red
> Band 2 Block=256x1 Type=Byte, ColorInterp=Green
> Band 3 Block=256x1 Type=Byte, ColorInterp=Blue
> Band 4 Block=256x1 Type=Byte, ColorInterp=Alpha
> Band 5 Block=256x1 Type=Byte, ColorInterp=Undefined
> Band 6 Block=256x1 Type=Byte, ColorInterp=Undefined
>
> GeoTiff_ERDAS
> Band 1 Block=256x32 Type=Byte, ColorInterp=Gray
> Band 2 Block=256x32 Type=Byte, ColorInterp=Undefined
> Band 3 Block=256x32 Type=Byte, ColorInterp=Undefined
> Band 4 Block=256x32 Type=Byte, ColorInterp=Undefined
> Band 5 Block=256x32 Type=Byte, ColorInterp=Undefined
> Band 6 Block=256x32 Type=Byte, ColorInterp=Undefined
>
>
> So,
> 1) Displaying undefined in the pull down menu for a band name does not
> seem very useful to me
> 2) The user/application that created the raster file can change the name
> of the bands and they may not be accurate. In the GeoTiff_ENVI example,
> Band 1 is Landsat Band 1 which is actually the blue band. This could be
> confusing to newer users
> 3) In the GeoTiff_ERDAS example, if you wanted a true color combination,
> your pulldowns would display R= 3: Undefined G=2: Undefined B=1: Gray.
> Again, the band names from the raster file are not very useful.
>
> If we are to go with generic band names, I will not be winning any
> popularity contests with the users because the band name is stored in
> the project file rather than just the band number. While it may seem
> trivial, I think that this is actually a very important decision as we
> move toward trying to get version 1.0 out.
>
> Any thoughts?
>
> -pete



-- 
Dr. Marco Hugentobler
Institute of Cartography
ETH Zurich
Technical Advisor QGIS Project Steering Committee


More information about the Qgis-developer mailing list