Title: | Population Downscaling Using Areal Interpolation |
---|---|
Description: | Given a set of source zone polygons such as census tracts or city blocks alongside with population counts and a target zone of incogruent yet superimposed polygon features (such as individual buildings) populR transforms population counts from the former to the latter using Areal Interpolation methods. |
Authors: | Marios Batsaris |
Maintainer: | Marios Batsaris <[email protected]> |
License: | GPL-3 |
Version: | 0.2.1 |
Built: | 2025-01-29 04:55:19 UTC |
Source: | https://github.com/mbatsaris/populr |
Ancillary Information from OSM Features
pp_ancillary(x, volume = NULL, key)
pp_ancillary(x, volume = NULL, key)
x |
an object of class |
volume |
x volume information (height or number of floors) useful for float ancillary information |
key |
OSM feature keys or values available in x |
an object of class sf
including ancillary information either for
night or day estimates
## Not run: data('trg') # Download OSM amenities dt <- pp_vgi(trg, key = amenity) # create binary ancillary information dt <- pp_ancillary(dt, 'amenity') # create ancillary information both binary and float dt <- pp_ancillary(dt, floors, 'amenity') ## End(Not run)
## Not run: data('trg') # Download OSM amenities dt <- pp_vgi(trg, key = amenity) # create binary ancillary information dt <- pp_ancillary(dt, 'amenity') # create ancillary information both binary and float dt <- pp_ancillary(dt, floors, 'amenity') ## End(Not run)
Comparison to Other Data
pp_compare(x, estimated, actual, title)
pp_compare(x, estimated, actual, title)
x |
An object of class |
estimated |
Population estimates using pp_estimate function |
actual |
Actual population values |
title |
Scatterplot title |
A list including rmse, mae, linear model details and correlation coefficient
# read lib data data('src') data('trg') # areal weighting interpolation - awi awi <- pp_estimate(trg, src, sid = sid, spop = pop, method = awi) # volume weighting interpolation - vwi vwi <- pp_estimate(trg, src, sid = sid, spop = pop, method = vwi, volume = floors) # awi - rmse pp_compare(awi, estimated = pp_est, actual = rf, title ='awi') # vwi - rmse pp_compare(vwi, estimated = pp_est, actual = rf, title ='vwi')
# read lib data data('src') data('trg') # areal weighting interpolation - awi awi <- pp_estimate(trg, src, sid = sid, spop = pop, method = awi) # volume weighting interpolation - vwi vwi <- pp_estimate(trg, src, sid = sid, spop = pop, method = vwi, volume = floors) # awi - rmse pp_compare(awi, estimated = pp_est, actual = rf, title ='awi') # vwi - rmse pp_compare(vwi, estimated = pp_est, actual = rf, title ='vwi')
Areal Interpolation of Population Data
pp_estimate( target, source, sid, spop, volume = NULL, ancillary = NULL, point = FALSE, method )
pp_estimate( target, source, sid, spop, volume = NULL, ancillary = NULL, point = FALSE, method )
target |
An object of class |
source |
An object of class |
sid |
Source identification number |
spop |
Source population values to be interpolated |
volume |
Target feature volume information (height or number of floors).
Required when |
ancillary |
ancillary information |
point |
Whether to return point geometries (FALSE by default) |
method |
Two methods provided: |
An object of class sf
including estimated population
counts for target features using either awi
or vwi
methods. The estimated population counts are stored in a new column called
pp_est.
# read lib data data('src') data('trg') # areal weighted interpolation - awi pp_estimate(trg, src, sid = sid, spop = pop, method = awi) # areal weighted interpolation - awi using point geometries pp_estimate(trg, src, sid = sid, spop = pop, method = awi, point = TRUE) # volume weighted interpolation - vwi pp_estimate(trg, src, sid = sid, spop = pop, method = vwi, volume = floors) # volume weighted interpolation - vwi using point geometries pp_estimate(trg, src, sid = sid, spop = pop, method = vwi, volume = floors, point = TRUE)
# read lib data data('src') data('trg') # areal weighted interpolation - awi pp_estimate(trg, src, sid = sid, spop = pop, method = awi) # areal weighted interpolation - awi using point geometries pp_estimate(trg, src, sid = sid, spop = pop, method = awi, point = TRUE) # volume weighted interpolation - vwi pp_estimate(trg, src, sid = sid, spop = pop, method = vwi, volume = floors) # volume weighted interpolation - vwi using point geometries pp_estimate(trg, src, sid = sid, spop = pop, method = vwi, volume = floors, point = TRUE)
Rounding Function
pp_round(x, tpop, spop, sid)
pp_round(x, tpop, spop, sid)
x |
An object of class |
tpop |
Target population estimates obtained by the pp_estimate function |
spop |
Initial source population values (included after the implementation of the pp_estimate function) |
sid |
Source identification number |
An object of class sf
including rounded population counts stored
in a new column called pp_int
# read lib data data('src') data('trg') # areal weighted interpolation - awi awi <- pp_estimate(trg, src, sid = sid, spop = pop, method = awi) # volume weighted interpolation - vwi vwi <- pp_estimate(trg, src, sid = sid, spop = pop, method = vwi, volume = floors) # awi - round pp_round(awi, tpop = pp_est, spop = pop, sid = sid) # vwi - round pp_round(vwi, tpop = pp_est, spop = pop, sid = sid)
# read lib data data('src') data('trg') # areal weighted interpolation - awi awi <- pp_estimate(trg, src, sid = sid, spop = pop, method = awi) # volume weighted interpolation - vwi vwi <- pp_estimate(trg, src, sid = sid, spop = pop, method = vwi, volume = floors) # awi - round pp_round(awi, tpop = pp_est, spop = pop, sid = sid) # vwi - round pp_round(vwi, tpop = pp_est, spop = pop, sid = sid)
Download and Count OSM Features Over Target
pp_vgi(x, key)
pp_vgi(x, key)
x |
an object of class |
key |
osm feature key (quoted) see available_features |
an object of class sf
including OSM features
## Not run: data('trg') # example using just a key pp_vgi(trg, key = 'amenity') # example using two keys pp_vgi(trg, key = c('amenity', 'shop') ## End(Not run)
## Not run: data('trg') # example using just a key pp_vgi(trg, key = 'amenity') # example using two keys pp_vgi(trg, key = c('amenity', 'shop') ## End(Not run)
object of sf
class representing the blocks of a fictional area
src
src
object of sf
class with 9 rows and 3 columns:
sid
Source identification number
pop
Source population values to be interpolated
geometry
Geometry
An object of sf
class representing the buildings of a subset
area of the city of Mytilini, Greece. The data set contains 179 building
units along with the number of floors and residential use in binary format
where 0 for non-residential floors and 1 for residential floors.
trg
trg
object of sf
class with 179 rows and 12 columns:
tid
Target identification number
floors
Number of floors
rf
Reference population estimates
geometry
Geometry