This work crops the population data downloaded from Worldpop.org (summary note : https://docs.google.com/document/d/1VVjMFbYM0RsmxRDEfZsbHHOJeqBjkTu1SSpoinmWk1Q/edit#heading=h.w4e1uk1k1taa).
For the work, we have to load the following libraries:
packages <- c("terra")
We read the Assam state boundary and crop each WorldPop image showing the population of India to the state boundary. The for-loop also calculates the population density by dividing the populatoin image with the image having the area of each cell.
#read the project extent as polygon
state_4326 <- vect("assam_State.shp")
plot(state_4326)
#load the WorldPop PopulationCount for a particular year
for(yr in 2015:2020 ){
#i <- 1
#yr <- 2020
popCount <- rast(sprintf("~/ind_ppp_%s_UNadj.tif",yr))
popCountDistrict <- terra::crop(popCount, ext(state_4326), overwrite = T)
popCountDistrict <- terra::mask(popCountDistrict , state_4326, overwrite = T)
plot(popCountDistrict)
#population density
a <- terra::cellSize(popCountDistrict, unit = "km")
popDensity <- popCountDistrict/a
plot(popDensity)
}
Next, we project or estimate the population for 2021 and 2022 using the growth rate calculated using the population of 2015 and 2020.
#projected population for 2021
pop2015 <- rast("state/pop_ind_ppp_2015_UNadj.tif")
pop2020 <- rast("state/pop_ind_ppp_2020_UNadj.tif")
popGrowthRate <- ((pop2020 - pop2015)/pop2015)/5
pop2021 <- pop2020 + pop2020*popGrowthRate
plot(pop2021, main = "Projected Population 2021")
#projected population for 2022
pop2022 <- pop2021 + pop2021*popGrowthRate
plot(pop2022, main = "Projected Population 2022")
We find the population density of the years for which the population is projected.
#population density of the projected populations
popden2021 <- rast("state/pop_ind_ppp_2021_UNadj.tif") / a
plot(popden2021, main = "Projected Population Density 2021")
popden2022 <- rast("state/pop_ind_ppp_2022_UNadj.tif") / a
plot(popden2022, main = "Projected Population Density 2022")