| Type: | Package |
| Title: | Urban Centrality Index |
| Version: | 1.0.0 |
| Description: | Calculates the Urban Centrality Index (UCI) as in Pereira et al., (2013) <doi:10.1111/gean.12002>. The UCI measures the extent to which the spatial organization of a city or region varies from extreme polycentric to extreme monocentric in a continuous scale from 0 to 1. Values closer to 0 indicate more polycentric patterns and values closer to 1 indicate a more monocentric urban form. |
| License: | MIT + file LICENSE |
| URL: | https://github.com/ipea/uci, https://ipea.github.io/uci/ |
| BugReports: | https://github.com/ipea/uci/issues |
| Depends: | R (≥ 4.2.0) |
| Imports: | checkmate, cli (≥ 3.2.0), cppRouting (≥ 3.2), data.table, fields, rlang (≥ 1.0.0), sf, spdep, stats, utils |
| Suggests: | covr, knitr, ggplot2, rmarkdown, testthat (≥ 3.2.0) |
| VignetteBuilder: | knitr |
| Encoding: | UTF-8 |
| Config/testthat/edition: | 3 |
| NeedsCompilation: | no |
| Config/roxygen2/version: | 8.1.1 |
| Packaged: | 2026-10-30 13:41:50 UTC; rafap |
| Author: | Rafael H. M. Pereira
|
| Maintainer: | Rafael H. M. Pereira <rafa.pereira.br@gmail.com> |
| Repository: | CRAN |
| Date/Publication: | 2026-10-30 16:20:02 UTC |
Urban Centrality Index
Description
Calculates the Urban Centrality Index (UCI) as in Pereira et al., (2013) doi:10.1111/gean.12002. The UCI measures the extent to which the spatial organization of a city or region varies from extreme monocentric to extreme polycentric in a continuous scale from 0 to 1. Values close to 0 indicate more polycentric patterns and values close to 1 indicate a more monocentric urban form.
Calculate Urban Centrality Index
Usage
uci(
sf_object,
var_name,
dist_type = "euclidean",
bootstrap_border = FALSE,
showProgress = TRUE,
parallel = FALSE,
remove_islands = FALSE,
max_method = NULL
)
Arguments
sf_object |
A |
var_name |
A |
dist_type |
A |
bootstrap_border |
A |
showProgress |
A |
parallel |
A |
remove_islands |
A |
max_method |
A |
Value
A one-row data.frame with the columns UCI, location_coef
(LC), spatial_separation (the Venables index V of the observed
distribution) and spatial_separation_max (its maximum for the
study area, as found by max_method), so that
UCI = LC * (1 - V / V_max).
Usage
Please check the vignettes and data documentation on the website.
Author(s)
Maintainer: Rafael H. M. Pereira rafa.pereira.br@gmail.com (ORCID)
Authors:
Rafael H. M. Pereira rafa.pereira.br@gmail.com (ORCID)
See Also
Useful links:
Report bugs at https://github.com/ipea/uci/issues
Other urban centrality index:
remove_islands()
Examples
# load data
data_dir <- system.file("extdata", package = "uci")
grid <- readRDS(file.path(data_dir, "grid_bho.rds"))
# calculate UCI
df <- uci(
sf_object = grid,
var_name = 'jobs',
dist_type = "spatial_link"
)
head(df)
Remove islands
Description
Keeps only the largest group of neighbouring polygons (queen contiguity),
i.e. the one with the most polygons, and drops the polygons outside it.
This is useful before calling uci() with dist_type = "spatial_link",
which requires the polygons to form one contiguous area.
Usage
remove_islands(sf_object, var_name = NULL, showProgress = TRUE)
Arguments
sf_object |
A |
var_name |
An optional |
showProgress |
A |
Details
If several groups tie for the most polygons, the group with the
earliest row is kept. Objects with fewer than 2 rows are returned as they
are. Contiguity is computed in the CRS of sf_object, which is not
changed. uci(remove_islands = TRUE) applies this function after
reprojecting to EPSG:3857, so for exactly the same result on
geographic (lon/lat) data, reproject sf_object first.
Value
sf_object with only the polygons of the largest contiguous group
(same CRS, columns, row order and row names).
See Also
Other urban centrality index:
uci()
Examples
# load data
data_dir <- system.file("extdata", package = "uci")
# sf::st_as_sf() loads {sf}, whose methods subset and bind sf objects
grid <- sf::st_as_sf(readRDS(file.path(data_dir, "grid_bho.rds")))
# add an island: a copy of the first cell, shifted away from the grid
island <- grid[1, ]
sf::st_geometry(island) <- sf::st_geometry(island) + c(0.5, 0)
sf::st_crs(island) <- sf::st_crs(grid)
grid_island <- rbind(grid, island)
nrow(grid_island)
# remove the island
grid_main <- remove_islands(grid_island, var_name = 'jobs')
nrow(grid_main)