Road network routing between postcodes and health related POIs using NetworkX
Cillian
Berragan
[@cjberragan
]1* Mark
Green
[@markalangreen
]1
Alex
Singleton
[@alexsingleton
]1
1 Geographic Data Science Lab, University of Liverpool,
Liverpool, United Kingdom
* Correspondence: [email protected]
This project identifies the time-weighted distance required to travel by road between every postcode in Great Britain and a selection of health related points of interest. A ranked combination of these drive-times is used to create the AHAH index.
Access is defined through the average time-weighted road network distance for each postcode within each LSOA to the nearest point of interest of a particular type. For this, the road highways network and road speed estimates provided through Ordnance Survey was used, alongside the ONS Postcode Directory, which gives centroids for every postcode in the country.
This is a computationally intense calculation, with the total road network used having ~3.8 million edges, and ~3.2million nodes. Access to each nearest health related POI was calculated using the Multi Source Shortest Path algorithm, for all ~1.7 million postcodes in Great Britain.
ahah
├── aggregate_lsoa.py # aggregate outputs to LSOA level
├── create_index.py # use aggregates to create index
├── air_lsoa.py # process air quality data
├── preprocess.py # process all POI data
├── route.py # main routing script
└── common
└── utils.py # utility functions
Accessibility measures were created using the networkx
Python library in conjunction with the OS Open Road network. Unlike similar routing software like Routino, which uses Open Street Map data, the OS Open Road Network provides more accurate road speed estimates for UK roads.
In this study, we measured the network distance (driving travel time) between the centroid of each active postcode in Great Britain to the coordinates of each unique health asset (e.g. GP practice). Measured network distances for each indicator for postcodes were aggregated to the LSOA level, providing average network distance for each indicator (as a measure of accessibility). All other indicators were also summarised for LSOAs. The indicators within each domain were standardised by ranking and transformed to the standard normal distribution. The direction of each variable was dictated by the literature (e.g. accessibility to fast food outlets were identified as health negating, whereas accessibility to GP practices was health promoting).
To calculate our overall index (and domain specific values), we followed the methodology of the 2015 IMD. For each domain, we ranked each domain
where ‘ln’ denotes natural logarithm and ‘exp’ the exponential transformation.
The main domains across our indicators: retail services, health services, physical environment and air quality then were combined to form an overall index of‘Access to Healthy Assets and Hazards’ (AHAH)
Preprocessing of the OS Open Road network is performed within the UKRoutes Python library. The main Route
class is defined by this library; using the multi_source_dijkstra_path_length
function from NetworkX.
Please see the UKRoutes methods for more information.
- Clean raw data
- Save to parquet files
- Iterate over every processed Parquet file in the
data/processed
directory - Use
Route
class fromUKRoutes
to route from POIs to postcodes - Write to
data/out
directory
- Create raster of interpolated values from monitoring station points
- Exclude points that are MISSING
- Aggregate to LSOA by taking mean values
- Combine both processed secure and open data
- Intermediate variables calculated
- All variables ranked
- Exponential default calculated for all ranked variables
- Percentiles calculated from ranked variables
- Domains Scores calculated
- Domain scores calculated from mean of each domains input variables
- Domain scores ranked
- Domain percentiles calculated
- Exponential transformation calculated for each domain
- AHAH index calculated from mean of domain exponential transformations
- Ranked AHAH index calculated
- AHAH percentiles calculated
See DATA.md for current data sources.
- AHAH v3: The code for the previous version can be found under v3 Release.
- AHAH v4: The current codebase represents AHAH v4. This is the latest version, which you can find here.