3

Both GDAL and QGIS's raster calculator index raster bands starting at 1. This is different than the usual 0 indexed convention that one finds in programming. And despite Googling, I'm unable to find if band indexing from 1 is a standard convention, or a byproduct of GDAL's convention. Does anyone know if it is standard convention to refer to a raster's band as 1 based indexing?

For context, I'm developing an API for raster processing and I need to allow the API to express which bands to operate over. My intuition would be to index them from 0, but I wonder since these industry standard tools do otherwise.

3

I would say it is a definitely a convention that is common and widespread. If you look at the satellite world, you will see the same 1-based numbering in the radiometric bands.

Landsat bands.

MODIS bands.

Sentinel-2 bands.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.