2

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.

2
  • Is it okay if the solution uses Python? I can't see a good way to do this otherwise.
    – jcarlson
    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
    May 16, 2019 at 18:05

1 Answer 1

1

f I understood correctly, you can normalize the values to 0 and 1. To do this, use the formulas in the raster calculator in QGIS: (value-min) / (max-min)

You need to know what is the minimum value and the maximum value of your data.

Example I did in excel to get clearer: The values range from 25 to 500: enter image description here

3
  • 1
    If you need between 0 and 100, just multiply by 100: (value-min) / (max-min) * 100
    – hugonbg
    May 16, 2019 at 16:14
  • Thanks very much for your suggestion. Thing is: I don't want to type in the specific min/max values of each heatmap manualy/separately. I'm searching a way to tell QGIS to do this automatically. As that QGIS reclassifies all heatmaps automatically with min=x and max=y and for that automatically takes the min/max of each heatmap.
    – Kala
    May 16, 2019 at 16:33
  • 2
    @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.
    – GSienko
    Oct 22, 2019 at 21:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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