Viewing a single comment thread. View all comments

wcedmisten OP t1_jdnngzy wrote

Interactive version: https://wcedmisten.fyi/project/virginia-hospital-distance/ Disclaimer: this will be very slow to load because it fetches several MB of JSON files. Sorry! I'm looking into optimizing this.

Data source: OpenStreetMap

Tools: Valhalla Isochrones API, Python, PostGIS

Summary:For this project, my goal was to map out accessibility to hospitals as measured by travel time in a car.

The first step was to find all the hospitals in Virginia. To do so, I downloaded the OpenStreetMap extract for Virginia and loaded it into PostGIS. Then I searched for all features with the `amenity=hospital` tag. This was done for both Points and Polygons. Polygons were converted to points by their centroid.

Next, I loaded the same OSM extract for Virginia into a docker container running Valhalla. Valhalla is mostly known for point to point routing (like google maps provides). But, their API also provides a way to retrieve Isochrones from a point. Isochrones measure the area that can be travelled within a given amount of time.

I iterated over all hospital coordinates through the Isochrones API to retrieve an isochrone for each hospital at 10 minute increments from 10-40 minutes.

Then, for each contour level, I used the Python library Shapely to find the union of all polygons and exported them as GeoJSON.

Using MapLibreGL, I visualized these polygons with a custom style in the browser.

19

Kvothealar t1_jdov8lb wrote

I would love to see another version of this that also factors in population density. How much of the population is within 10/20/30/40min? Etc

This is super cool. Great work. :)

2

wcedmisten OP t1_jdoyvmq wrote

Thank you!

I actually calculated this, but haven't had a chance to add it to the visualization yet.

Here are the numbers:

10 mins: 5,596,838 (65.3%)
20 mins: 7,635,539 (88.7%)
30 mins: 8,296,515 (96.1%)
40 mins: 8,552,706 (99.0%)
This was estimated using the EU's Global Population Density Estimate dataset GHS POP .

Not quite sure the best way to visualize this data. Add it to the legend?

Perhaps not surprisingly, the hospitals are centered around dense urban areas, and so even though the 10 minute boundary doesn't cover most of the state's area, it does cover most of the population.

9

Kvothealar t1_jdp137f wrote

That’s really cool! Thanks for sharing it :)

To visualize, I would maybe make a GIF which slides between the current graphic and a population density map?

2