I need to calculate centroids for each feature in a polygon layer, weighted by the values of a raster. So the centroids are shifted towards higher raster values.
I found a way, but it is complicated. Is there an existing tool which can do this?
I need to calculate centroids for each feature in a polygon layer, weighted by the values of a raster. So the centroids are shifted towards higher raster values.
I found a way, but it is complicated. Is there an existing tool which can do this?
I've done similar approaches with vectors to get population based centroids. I don't know any existing tool that does this but it would be neat.
Here is another approach, it is also complicated but maybe a bit more precise than grid + variable buffer.
It is a vector based approach, basically weighting coordinates by pixel value. If there was a way to create a raster where pixel values were x and y coordinates without point conversion, would be easier.
And here is the result