I have a raster world map of population densities at a resolution of 30 arc seconds. For each raster, I want to find out the average density of neighbors within a certain distance (e.g. 0.1 degrees). The aim is to keep and save in an extra file only those raster values with a density greater than a certain threshold (e.g. 1000 people per sqkm). All contiguous rasters above this threshold will then be clustered to form a core city. Next, I want to find the city fringe to those core cities. This shall be composed by rasters (attached to the core cities) with population densities between 500 and 1000. Core plus fringe will compose a complete city. Those cities then should be transformed to a polygon shape file where I can assign each city an own ID. Furthermore, having a polygon shape file allows me to easily assign values from other raster maps to the city using zonal statistics.
My question is how to do all of this. I tried around a little with Warp but I think that the result is different from what I want because Warp only is able to average over the neighbors to reproject the small to bigger raster, but which rasters are defined as neighbors depends on the layer extent chosen.
Below a sample image of my raster map.
Is there a way without using GRASS? Because I cannot get GRASS running..