define_urban: Defines rural and urban areas based on population density,...

View source: R/defineUrbanRaster.R

define_urbanR Documentation

Defines rural and urban areas based on population density, using the terra package

Description

This function defines urban areas as those with a population density higher than rururb_cutoff per pixel. Urban areas are also contiguous and have a minimal total population equal to min_urbsize. The methodology is derived from http://documents.worldbank.org/curated/en/709121516634280180/pdf/122880-V1-WP-P156561-OUO-9-FINAL-ENGLISH.pdf. This function differs from DefineUrban in that the terra package is used (instead of raster). The results between the 2 functions may differ due to different handling of diagonal values in the terra and raster packages.

Usage

define_urban(
  population_raster,
  rururb_cutoff = 300,
  min_urbsize = 2000,
  directions = 8,
  mask = FALSE,
  verbose = FALSE
)

Arguments

population_raster

An input raster containing people per pixel. Default inputs assume input resolution to be approximately 1 sq. km. resolution.

rururb_cutoff

Minimum population per pixel to be eligible for urban classification.

min_urbsize

Minimum total population of clustered pixels to the classified as urban.

directions

See terra::patches, default is 8.

mask

TRUE/FALSE, Should the returned raster have masked values (1 = Urban, 0 = Rural). Default is FALSE.

verbose

TRUE/FALSE Print messages?

Value

A SpatRaster object similar to population.raster in which all non-urban pixels are masked (i.e. NA), or a categorized raster where 0 = Rural and 1 = Urban if mask = TRUE.


SwissTPH/CHWplacement documentation built on March 10, 2023, 2:34 p.m.