# load data
grid_data_belgium <- flexurba::DoU_load_grid_data_belgium()
# get clusters of cells (4-cell connectivity) with at least 1500 inhabitants
# per km² of permanent land and a minimum total population of 50 000
# inhabitants:
terra::plot(get_clusters(
xden = grid_data_belgium$pop_per_land,
minden = 1500,
xsiz = grid_data_belgium$pop,
minsiz = 50000,
directions = 4
))
# get clusters of cells (4-cell connectivity) with at least 1500 inhabitants
# per km² of permanent land or at least 20% built-up area per permanent
# land, and a minimum total population of 50 000 inhabitants:
terra::plot(get_clusters(
xden = grid_data_belgium$pop_per_land,
minden = 1500,
xden2 = grid_data_belgium$built_per_land,
minden2 = 0.2,
xsiz = grid_data_belgium$pop,
minsiz = 50000,
directions = 4
))
# get clusters of cells (8-cell connectivity) with at least 300 inhabitants
# per km² of permanent land, and a minimum total population of 5000
# inhabitants:
terra::plot(get_clusters(
xden = grid_data_belgium$pop_per_land,
minden = 300,
xsiz = grid_data_belgium$pop,
minsiz = 5000,
directions = 8
))
Run the code above in your browser using DataLab