I have a raster image of a road network with pixel values corresponding to vehicule frequency.
What I would like is to calculate a weighted distance raster with the frequency as weight within a maximum distance. I don't seem to grasp the concept of how to reference neighbouring cell values.
How do I refine and apply a formula like the following or better in the raster calculator AND / OR how can I make Focal Statistics work with a weighting formula?
newraster(x,y) = for all i in range(-maxdist, maxdist): for all j(-maxdist to maxdist): oldraster(x-i,y-j)*(1-distance/maxdistance)