[R-sig-Geo] Grouping neighbouring polygons to get an equal distribution of residents
Roger Bivand
Roger@B|v@nd @end|ng |rom nhh@no
Wed Jan 8 10:38:44 CET 2020
On Wed, 8 Jan 2020, Anastasia Semenova wrote:
>
>
> Hello everyone,
> I'm working with a large spatial polygon data frame downloaded from
> https://biogeo.ucdavis.edu/data/gadm3.6/Rsp/gadm36_DEU_4_sp.rds . A have
> added two columns to the dataset with number of people and number of
> shops in each district. Now I have to group the polygons so that the 200
> resulting areas contain an approximately equal number of people and
> shops or at least only people. It should be just a new column with an ID
> of the «new» area (from 1 to 200), which matches every polygon
> (district). Like this:
>
>
> CC_4 New_area
> 84255001002 1
> 84255001004 2
> 84255002017 78
> 84255002020 1
> Unfortunately, I have no idea how to implement this. Are there any
> appropariate functions? Could You please help me?
This is a version of the regionalisation problem (search Openshaw
regionalisation). A recent contribution, skater, is included in the spdep
package, but differs from your task because it by default chooses a
partition that minimises within-group variability for contiguous polygons.
See the skater help page for references:
https://r-spatial.github.io/spdep/reference/skater.html
The problem is not unlike voter redistricting, see the archived BARD
package and its references:
https://cran.r-project.org/src/contrib/Archive/BARD/
https://www.jstatsoft.org/article/view/v042i04
(look for work citing the JSS article):
https://scholar.google.com/scholar?oi=bibs&hl=en&cites=3803462190546196364,883721913332052071&as_sdt=5
The underlying problem has no easy solution (NP-complete I think). Many
statistical agencies use scaled square grid cells to handle this, bigger
cells in less dense areas, rather than polygons. Post/zip-codes are often
as good as you get off-the-shelf.
Hope this helps,
Roger
>
> Thank You very much in advance.
> Best regards,
> Anastasia
> [[alternative HTML version deleted]]
>
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo using r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
--
Roger Bivand
Department of Economics, Norwegian School of Economics,
Helleveien 30, N-5045 Bergen, Norway.
voice: +47 55 95 93 55; e-mail: Roger.Bivand using nhh.no
https://orcid.org/0000-0003-2392-6140
https://scholar.google.no/citations?user=AWeghB0AAAAJ&hl=en
More information about the R-sig-Geo
mailing list