azavea / pfb-network-connectivity

PFB Bicycle Network Connectivity
Other
39 stars 10 forks source link

Revise calculation of population scores for destinations #790

Closed beckymasond closed 4 years ago

beckymasond commented 4 years ago

Overview

When the user clicks on a destination in the BNA map "pop low stress," "pop high stress," and "pop score" values appear in the pop-up. For destinations retrieved from OSM as points (single nodes) residing within a single census block area, these values are accurate. For destinations retrieved from OSM as polygons that overlap multiple census blocks, these values are inaccurate. For single block destinations these values are accurate because they sum the population in all blocks within the bikeshed. For multi-block destinations these values are incorrect because they repeat the summation of the bikeshed population for every destination block without distinguishing between blocks that have already been counted. In the fixes implemented here, only the population of each unique block in the bikeshed for all of the destination blocks is summed.

Demo

Running the BNA for the Algiers region of New Orleans and selecting the destination in the Universities output, University of the Holy Cross, gives a pop_low_stress score of 5609, pop_high_stress score of 248036, and a pop_score of 0.0226. The pop_high_stress score is clearly too high because the population of the Algiers region is only 51755 and the population of all of New Orleans is only 345392. Using the corrected access_universities.sql script included here, pop_low_stress=4463, pop_high_stress=34097, and pop_score=0.13. As another point of comparison, University of the Holy Cross is also tagged as a school as a single node destination in close proximity to the university tag and the pop_high_stress value for that destination is 31164.

Original: image

Revised: image

Notes

The same changes has been applied to all destinations retrieved as points or polygons from OSM:

Testing Instructions

KlaasH commented 4 years ago

:+1: Looks good. I found a park in Kalamazoo that was reporting 163,000 high-stress population when the one right next to it said 32,000. With the change, they both say 32,000.