As you say, a raster is composed of one or several bands with a value for each cell (or pixel, if you prefer). These values are in a certain range depending on the data type of the raster band, e.g. UINT8 can contain values in the range 0..255.
For each band, you can designate a specific cell value to be the NODATA value, this must be some value inside the data type range, for example 0. Depending on the output format, this is also saved in the resulting file, where the metadata will say that for this specific band, the pixel value 0 (or whatever you define) shouldn't be interpreted literally, but as a NODATA value. It's up to the creator of the raster file to define which value corresponds to NODATA, but common values are either 0 or the maximum or minimum value allowed by the raster data type. But in principle the NODATA value can be whatever you like that doesn't interfer with your "real" data.
But what is nodata? Is this just a signal to the software to treat a certain pixel value is a different way?
Yes, exactly. When visualizing the raster in e.g. ArcMap or QGIS, it's up to the client software to read the NODATA metadata setting in the raster file and then interpret it accordingly, e.g. by not plotting the pixels containing those values. If the software used to visualize the raster doesn't know how to treat NODATA values, those pixel value will most probably be plotted as if they contained a regular value, for example 0.
There's also a more detailed description of NODATA concepts here: http://desktop.arcgis.com/en/arcmap/10.3/manage-data/raster-and-images/nodata-in-raster-datasets.htm
As you say, a raster is composed of one or several bands with a value for each cell (or pixel, if you prefer). These values are in a certain range depending on the data type of the raster band, e.g. UINT8 can contain values in the range 0..255.
For each band, you can designate a specific cell value to be the NODATA value, this must be some value inside the data type range, for example 0. Depending on the output format, this is also saved in the resulting file, where the metadata will say that for this specific band, the pixel value 0 (or whatever you define) shouldn't be interpreted literally, but as a NODATA value. It's up to the creator of the raster file to define which value corresponds to NODATA, but common values are either 0 or the maximum or minimum value allowed by the raster data type. But in principle the NODATA value can be whatever you like that doesn't interfer with your "real" data.
But what is nodata? Is this just a signal to the software to treat a certain pixel value is a different way?
Yes, exactly. When visualizing the raster in e.g. ArcMap or QGIS, it's up to the client software to read the NODATA metadata setting in the raster file and then interpret it accordingly, e.g. by not plotting the pixels containing those values. If the software used to visualize the raster doesn't know how to treat NODATA values, those pixel value will most probably be plotted as if they contained a regular value, for example 0.
There's also a more detailed description of NODATA concepts here: http://desktop.arcgis.com/en/arcmap/10.3/manage-data/raster-and-images/nodata-in-raster-datasets.htm
In addition to @david_r's excellent explanation, just be aware that the Nodata mechanism may not be supported depending on the raster file format. The ECW is one of those formats not to support Nodata.
cf. ER Mapper ECW Quick Facts
Therefore, if your goal is to create a raster dataset with ECW format, you might have to think of other approach to represent invalid cells.
In addition to @david_r's excellent explanation, just be aware that the Nodata mechanism may not be supported depending on the raster file format. The ECW is one of those formats not to support Nodata.
cf. ER Mapper ECW Quick Facts
Therefore, if your goal is to create a raster dataset with ECW format, you might have to think of other approach to represent invalid cells.
Yes, exactly, that's important to know re the ECW format.
Thankyou for your answers. So what would in fact be a good way to create ECW rasters transformed from TIFs which did in fact have Nodata values?
Thankyou for your answers. So what would in fact be a good way to create ECW rasters transformed from TIFs which did in fact have Nodata values?
I would just leave the rasters as-is, but make sure to tell the end users which value corresponds to NODATA. That way they can manually configure the NODATA value in their client (e.g. ArcMap, QGIS, etc).
I would just leave the rasters as-is, but make sure to tell the end users which value corresponds to NODATA. That way they can manually configure the NODATA value in their client (e.g. ArcMap, QGIS, etc).
In addition to @david_r suggestion, you might want to consider increasing the image depth in case the values you will assign to the NODATA pixels already exist. If for example the 255,255,255 is already a value in other pixels, 256,256,256 should be idealy your NODATA.
In addition to @david_r suggestion, you might want to consider increasing the image depth in case the values you will assign to the NODATA pixels already exist. If for example the 255,255,255 is already a value in other pixels, 256,256,256 should be idealy your NODATA.
Just be aware that going from e.g. UINT8 to UINT16 will probably have an adverse effect on the file size.