Source: Africa Goal

The buildings of Mutendere

Mutendere is a suburb in the city of Lusaka, Zambia. The population of Zambia is growing rapidly and as such, many suburbs are increasing in population density in the capital. It is difficult to estimate the population of these smaller areas and looking at the buildings may give a sense of its population. This map visualizes the buildings in Mutendere. The data is extracted from OpenStreetMap and then converted to a GeoJSON. Another step that can be done is to use an areametric method on the buildings with Census data to obtain a population estimate proxy.

Estimating the population from buildings

Gaining accurate information on population density is bound to the space humans occupy and this can be challenging given the changing nature of human activities over space and time. Choropleth maps can only reveal a part of the story and it tends to apply homogeneity over an area. Dasymetric mapping can be used to gain insights from greater granularity. The general idea is to use ancillary information to define new areas more representative of changes or particular atributes of smaller spaces.

In this case, an areametric method can be attempted. The idea is to use information we have and disaggregate to new areas. Lusaka is a city of 1,747,152 as of Census 2010 and is 360 km square with a density of 4,853.2 people per km square. This is the starting point. The other information we have are the areas of the buildings in Mutendere.

Borrowing from Lwin and Murayama (2010), we can start by adapting their formula:

\({BP_i} = (\frac{C}{\sum_{k=1}^{n}{BA_k}}){BA_i}\)

\({BP_i}\) = Building \(_i\) population

\({BA_i}\) = Building \(_i\) area

\({C}\) = Population of city

We will use this to disaggregate population estimate to the buildings. We must then build the information we need from the buildings in Mutendere: their size.

Prepare the data

We must first process the spatial data. The first thing to do is to verify which projection we have. Projection detemrines the units for the data.

# list the slots 
slotNames(data)
## [1] "data"        "polygons"    "plotOrder"   "bbox"        "proj4string"
# check the projection info
data@proj4string
## CRS arguments:
##  +proj=longlat +datum=WGS84 +no_defs +ellps=WGS84 +towgs84=0,0,0

The data is in geodesic longlat which means the unit is going to be in degrees. We want to measure in meters so we need to change the projection. We are going to use Web Mercator (EPSG: 3857). We can then calculate the area in meter square for each buildings.

# Transform to web mercator from geodesic longlat
data <- spTransform(data, CRS("+init=epsg:3857"))

# Calculate area for each polygon feature (buildings) and store the result in a new variable "area_m2"
data@data$area_m2 <- gArea(data, byid = TRUE)

#Results
summary(data@data$area_m2)
##     Min.  1st Qu.   Median     Mean  3rd Qu.     Max. 
##    4.984   68.910  100.800  110.200  136.700 1483.000

So, we now have the area for all buildings. In Mutendere, the average size of buildings is 110 m2, the smallest building is 5 m2 and the largest is 1483 m2.

area <- "Lusaka"
area_m2 <- 360 * 1000000
population <- 1747152

Lus <- data_frame(area, area_m2, population)

data2 <- data@data %>% 
  select(uid, area_m2) %>% 
  mutate(area = "Mutendere") %>% 
  select(area, uid, everything())

summ2 <- data2 %>% 
  summarise(sum(area_m2))

data@data %>% 
  summarise(sum = area_2)

data2 <- data2@data %>% 
  mutate()