DataKind-DC / EcoAction

MIT License
4 stars 2 forks source link

Calculate "most likely civic association" for each block_group and tract #1

Closed allenbaron closed 3 years ago

allenbaron commented 3 years ago

Goal Determine if demographic information, available for census block groups, can be translated to Arlington County civic associations.

This issue needs to be completed soon.

icanhazcodeplz commented 3 years ago

If we are okay with census tracts, then this is done. Compare to the civic associations. There are 59 tracts vs 62 civic associations. I was able to pull the demographic data for the census tracts. See data/demographics_tract.csv.

icanhazcodeplz commented 3 years ago

I included one idea for the implementation of this in scripts/most_likely_civ_assoc.R

allenbaron commented 3 years ago

Instead of union this should probably use intersection but sf::st_intersection() unexpectedly creates different polygons depending on the order of input. This appears to be due to the underlying library (GEOS).

Still need to explore the difference to see how much it matters. As an alternative we could try the slow rasterized approach with frasterize.

Chellison commented 3 years ago

Maybe 'st_interpolate_aw' could be useful. The description is 'Areal-weighted interpolation of polygon data' and the attributes are:

allenbaron commented 3 years ago

I plan to split block groups by their intersection with civic associations using QGIS after we hear back from EcoAction about the residential areas that are not part of a civic association. Then, we can take a look at how the block groups split and decide how to manage them within each civic association.

allenbaron commented 3 years ago

If we decide to go with areal interpolation, the areal package may be a better option that what's available in sf. Check out the vignette.

allenbaron commented 3 years ago

EcoAction said its okay if block groups overlap multiple civic association and we've already translated the demographics so this is complete.