Wednesday 20 June 2018

qgis - how to aggregate the rates, represented by points, within X radius


the point represents rates like 10%, etc. (this was also pretty clear from 2 years ago) -- been trying to do this for 2 yrs...


the points dont represent numbers of events since they are rates (Finding largest number of observations within a given radius)


but the points have geo ids so they are attached to location, not distance (whatever distance is to imply) -- update: it represents z-value but we're just dealing with rates



Answer



Yes, the Heatmap plugin can be used for this.


Suppose we have a point layer called pointrates.shp with rates between 0 and 1 associated with each point:



We can run the Heatmap plugin on this, using a Decay Ratio of 1 (which means that the value at the edge of each search radius is the same as at the center), and using the "Ratio" column as the Weight. In this example, I'm using a search radius of 200 km.




This gives us the following map:



As you can see, the values range from 0 to 1.2 (the sum of 0.1, 0.2, 0.4 and 0.5 in the cluster of points in the lower right). Now sums of rates are usually not very meaningful, so a map of averages (rather than sums) is probably more useful. To get this, we'll calculate another Heatmap, this time not using the "Rates" column for the weights. That way, all points will have a weight of 1, and the resulting map is simply a count of points:



The values now range from 0 to 4. To get the average value, we simply use the Raster Calculator to divide the "Sums" map by the "Count" map:



And this gives us our map of averages:



No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...