ua-snap / epa-justice

US Census and CDC data access via API
MIT License
0 stars 0 forks source link

Add Alaska and US data #8

Closed Joshdpaul closed 3 months ago

Joshdpaul commented 3 months ago

This PR grabs contextual data for Alaska and the entire US, and adds them to the results for places in Alaska. For the Census data this was relatively straightforward, but for the CDC datasets I actually had to change the code quite a bit to accomplish this. The changes actually simplified the CDC part of the code and made for a more efficient API call, so the processing time is now a few minutes shorter!

I ended up using SoQL queries to grab all variables/locations for each place in one API call. If the place was Alaska or US, I queried for the whole state or the whole country at the tract level and then aggregated the results using the same aggregation math reviewed in the last PR.

And as requested in the last project meeting, I added a variable for percent of population under 5 (field is pct_under_5) which should be incorporated into the NCR data viz when convenient.

TO TEST: