# Reclassifying Raster (Heatmap) from Value to Percent using QGIS?

I have a point layer with several points "belonging" to different years by attribute. For all points of each year I created a heatmap. Now I would like to define the core area of each heatmap.

Unfortunately, the values of the different heatmaps are pretty different, therefore its not possible to choose one value for all. But because there are over 100 different years, so over 100 different heatmaps, I do not really want to set the value for each core area manually.

I thought of reclassify the heatmaps from value to percentage (min value = 0%; max value = 100% or min=0 max=100) to generate the core area based on one percent-value for all heatmaps with batch-processing or graphical modeller.

I tried different recalculating/reclassifing-tools like the raster calculator, r.reclass (grass), reclassify values (saga) and reclassify by table (qgis) but I'm not able to get it to work. But honestly I think I'm just too stupid to find out the respective expression for this problem.

Can anybody help me with the correct expression or way to reclassify the rasters/heatmaps from min-value=0(%) to max-value=100(%)?

I prefer working with the new QGIS Version 3.6 but if a solution requires another version of QGIS it would not be a problem.

• Is it okay if the solution uses Python? I can't see a good way to do this otherwise. Commented May 16, 2019 at 17:08
• Yes absolutely! In fact we need to bring the whole workflow in python anyway (because I'm not used to use python I planed to build the workflow in the graphical modeller, to export it afterwards as python script). So it would be great, if its already in Python :-)
– Kala
Commented May 16, 2019 at 18:05

• @Kala: It's not a problem. Based on data of this answer type in field calculator: `("B" - minimum( "B" ))/(maximum("B")-minimum("B"))` . QGIS will automaticly compute minimum and maximum value from column B. If you want to round the outcome, use round expression. Commented Oct 22, 2019 at 21:30