Grouping neighbouring polygons to get an equal distribution of residents

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Grouping neighbouring polygons to get an equal distribution of residents

Anastasia Semenova

 
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?
 
Thank You very much in advance.
Best regards,
Anastasia
        [[alternative HTML version deleted]]

_______________________________________________
R-sig-Geo mailing list
[hidden email]
https://stat.ethz.ch/mailman/listinfo/r-sig-geo
Reply | Threaded
Open this post in threaded view
|

Re: Grouping neighbouring polygons to get an equal distribution of residents

Roger Bivand
Administrator
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
> [hidden email]
> 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: [hidden email]
https://orcid.org/0000-0003-2392-6140
https://scholar.google.no/citations?user=AWeghB0AAAAJ&hl=en
_______________________________________________
R-sig-Geo mailing list
[hidden email]
https://stat.ethz.ch/mailman/listinfo/r-sig-geo
Roger Bivand
Department of Economics
Norwegian School of Economics
Helleveien 30
N-5045 Bergen, Norway
Reply | Threaded
Open this post in threaded view
|

R-tutorial: Geospatial Data Science with R

Zia Ahmed
Dear All,


Best


*Zia Ahmed, PhD*

Research Associate Professor (Data & Visualization)

RENEW (Research and Education in eNergy, Environment and Water) Institute
<http://www.buffalo.edu/renew.html>

University at Buffalo <http://www.buffalo.edu/>



Tutorial consist following topics:



*1. Spatial Data Processing
<https://zia207.github.io/geospatial-r-github.io/about.html>*

   - Reading and Writing Spatial Data
   <https://zia207.github.io/geospatial-r-github.io/read-write-spatial-data.html>
      - Vector data
      - Raster data
   - Map Projection and Coordinate Reference Systems
   <https://zia207.github.io/geospatial-r-github.io/map-projection-coordinate-reference-systems.html>
      - Geographic coordinate system (GCS)
      - Projected coordinate system
      - Coordinate Reference System in R
   - Geoprocessing of Vector data
   <https://zia207.github.io/geospatial-r-github.io/geoprocessing-vector-data.html>
      - Clipping
      - Union
      - Dissolve
      - Intersect
      - Erase
      - Convex Hull
      - Buffer
   - Working with Spatial Point Data
   <https://zia207.github.io/geospatial-r-github.io/working-with-spatial-point-data.html>
      - Create a Spatial Point Data Frame
      - Extract Environmental Covariates to SPDF
      - Create a Prediction Grid
      - Exploratory Data Analysis
      - Plot Data on Web Map
   - Working with Spatial Polygon Data
   <https://zia207.github.io/geospatial-r-github.io/working-with-spatial-polygon.html>
      - Data Processing
      - Visualization
      - Animation of Time Series Data
   - Working with Raster Data
   <https://zia207.github.io/geospatial-r-github.io/working-with-raster-data.html>
      - Basic Raster Operation
      - Clipping
      - Reclassification
      - Focal Statistics
      - Raster Algebra
      - Aggregation
      - Resample
      - Mosaic
      - Convert Raster to Point Data
      - Convert Point Data to Raster
      - Raster Stack and Raster Brick
      - Digital Terrain Modeling
         - Slope
         - Aspect
         - Hillshade
         - Terrain Ruggedness Index
         - Topographic Position Index
         - Roughness
         - Curvature
         - Flow Direction
      - netCDF Data Processing
   <https://zia207.github.io/geospatial-r-github.io/netCDF-data-processing.html>



*2. Spatial Statistics
<https://zia207.github.io/geospatial-r-github.io/spatial-statistics.html>*

   - Spatial Autocorrelation
   <https://zia207.github.io/geospatial-r-github.io/spatial-autocorrelation.html>
      - Moran’s I
      - Geary’s C
      - Getis’s Gi
   - Point Pattern Analysis
   <https://zia207.github.io/geospatial-r-github.io/point-pattern-analysis.html>
   - Geographically Weighted Mmodels
   <https://zia207.github.io/geospatial-r-github.io/geographically-weighted-models.html>
      - Geographically Weighted Summary Statistics
      <https://zia207.github.io/geospatial-r-github.io/geographically-weighted-summary-statistics.html>
      - Geographically Weighted Principal Components Analysis
      <https://zia207.github.io/geospatial-r-github.io/geographically-weighted-principal-components-analysis.html>
      - Geographically Weighted Regression
      <https://zia207.github.io/geospatial-r-github.io/geographically-weighted-regression.html>
         - Geographically Weighted OLS Regression
         <https://zia207.github.io/geospatial-r-github.io/geographically-weighted-ols-regression.html>
         - Geographically Weighted Poisson Regression
         <https://zia207.github.io/geospatial-r-github.io/geographically-weighted-poisson-regression.html>
         - Global and local (Geographically Weighted) Random Forest
         <https://zia207.github.io/geospatial-r-github.io/geographically-wighted-random-forest.html>



*3. Spatial Interpolation
<https://zia207.github.io/geospatial-r-github.io/spatial-interpolation.html>*



·         Spatial Interpolation
<https://zia207.github.io/geospatial-r-github.io/spatial-interpolation.html>

o    Deterministic Methods for Spatial Interpolation
<https://zia207.github.io/geospatial-r-github.io/deterministic-methods-for-spatial-interpolation.html>

§  Polynomial Trend Surface

§  Proximity Analysis-Thiessen Polygons

§  Nearest Neighbor Interpolation

§  Inverse Distance Weighted

§  Thin Plate Spline

o    Geostatistical Methods for Spatial Interpolation
<https://zia207.github.io/geospatial-r-github.io/geostatistical-methods-for-spatial-interpolation.html>

§  Semivariogram Modeling
<https://zia207.github.io/geospatial-r-github.io/semivariogram-modeling.html>

§  Kriging <https://zia207.github.io/geospatial-r-github.io/kriging.html>

§  Ordinary Kriging
<https://zia207.github.io/geospatial-r-github.io/ordinary-kriging.html>

§  Universal Kriging
<https://zia207.github.io/geospatial-r-github.io/universal-kriging.html>

§  Co-Kriging
<https://zia207.github.io/geospatial-r-github.io/cokriging.html>

§  Regression kriging
<https://zia207.github.io/geospatial-r-github.io/regression-kriging.html>

§  Generalized Linear Model

§  Random Forest

§  Meta Ensemble Machine Learning

§  Indicator kriging
<https://zia207.github.io/geospatial-r-github.io/indicator-kriging.html>

·         Assessing the Quality of Spatial Predictions
<https://zia207.github.io/geospatial-r-github.io/assessing-quality-spatial-predictions.html>

o    Cross-validation
<https://zia207.github.io/geospatial-r-github.io/cross-validation.html>

o    Validation with an Independent Dataset
<https://zia207.github.io/geospatial-r-github.io/validation-independent-dataset.html>

o    Conditional Simulation for Spatial Uncertainty
<https://zia207.github.io/geospatial-r-github.io/conditional-simulation-spatial-uncertainty.html>



*4. Remote Sensing Data Processing and Analysis
<https://zia207.github.io/geospatial-r-github.io/about-c.html>*

·
Remote Sensing Basic
<https://zia207.github.io/geospatial-r-github.io/reomte-sensing-basic.html>

·         Landsat 8 Image Processing & Visualization
<https://zia207.github.io/geospatial-r-github.io/landsat-8-image-processing.html>

o    RGB image comparison

o    Pan Sharpening or Image Fusion

o    Radiometric Calibration and Atmospheric Correction

·         Spectral Indices
<https://zia207.github.io/geospatial-r-github.io/spectral-indices.html>

o    Normalized Difference Vegetation Index

o    Soil Adjusted Vegetation Index (SAVI)

o    Modified soil Adjusted Vegetation Index (MSAVI)

o    Enhanced Vegetation Index (EVI)

o    Two-bands Enhanced Vegetation (EVI2)

o    Normalized Difference Water Index (NDWI)

·         Green Ground Cover from UAV Images
<https://zia207.github.io/geospatial-r-github.io/uav-ground-cover.html>

·         Texture Analysis
<https://zia207.github.io/geospatial-r-github.io/texture-analysis.html>

·         Image Classification
<https://zia207.github.io/geospatial-r-github.io/image-classification.html>

o    Ground Truth Data Processing
<https://zia207.github.io/geospatial-r-github.io/ground-truth-data-processing.html>

o    Unsupervised Classification
<https://zia207.github.io/geospatial-r-github.io/unsupervised-classification.html>

§  Supervised Classification
<https://zia207.github.io/geospatial-r-github.io/supervised-classification.html>

·      Random Forest
<https://zia207.github.io/geospatial-r-github.io/random-forest.html>

·      Support Vector Machine
<https://zia207.github.io/geospatial-r-github.io/support-vector-machine.html>

·      Naïve Bayes
<https://zia207.github.io/geospatial-r-github.io/naive-bayes.html>

·      eXBoost
<https://zia207.github.io/geospatial-r-github.io/exboost.html>

·      Deep Learning-H2O
<https://zia207.github.io/geospatial-r-github.io/deep-learning-h2o.html>

·      Stack-Ensemble-H20
<https://zia207.github.io/geospatial-r-github.io/stack-ensemble-h2o.html>

·      Deep Learning Keras-TensorFlow
<https://zia207.github.io/geospatial-r-github.io/deep-learning-keras-tensorflow.html>

        [[alternative HTML version deleted]]

_______________________________________________
R-sig-Geo mailing list
[hidden email]
https://stat.ethz.ch/mailman/listinfo/r-sig-geo