[Edited title of post based on fact that @wingnut solved it]
I'm trying to normalise a population density map such as this one (e.g. to a maximum of 255). The maximum value in the file to begin with is 27500.1. However, if I enter ("gbr_pd_2020_1km@1" * 255) / 27500.1
as a formula in the Raster Calculator it only gives me values up to 198.
What makes me further think it's a bug is if I just enter as a formula "gbr_pd_2020_1km@1" / 27500.1
, it should give me values up to 1, but it only gives me values up to 0.8. And even if I just enter itself * 1
it only gives me values up to 21367!!! Please see
What I think must be happening is that the 27500.1 value is only in one pixel (which represents one area in London) and somehow the raster calculator is not looking at every pixel. But I can't see any settings to change this.
I've also tried doing the same via 'Processing Toolbox' then GDAL Raster Calculator, but it gives the same incorrect results.
I've tried this in QGIS 3.16.5 and 3.18 (the latest LTR and beta releases available), and am running it on the latest version of Mac OS (Big Sur 11.2.3).