Playground Accessibility
Here’s a playful, parental question that popped up recently at work. How’s Auckland’s playground access? More specifically, for every point in the Auckland Region, how many playgrounds lie within a 15-minute, with-child walk of that point? Let’s answer that question, at least approximately, from our armchairs using open data and open source software, so others can retrace our steps.
Set the study area and get its playgrounds
I’ll do this analysis with Python in a Jupyter notebook and just show the key outputs for brevity. Behind the scenes I’ll use GeoPandas for geospatial operations and Folium for map-making. To start, let’s grab Auckland’s geographic shape from Stats NZ.
Now let’s collect all the playgrounds listed in OpenStreetMap that lie within the study area using OSMnx.
If you can’t find your local playground above, then you can add it to OpenStreetMap. Notice that some of these playgrounds lie in schools, some are points instead of polygons, and some should probably be grouped together. Let’s address the latter two issues by converting the points to 7-metre radius circles, say, and grouping playgrounds within 50 metres of each other, say.
Sample the study area
That’s better. Now, there are infinitely many points in Auckland, our study area, which is too many to compute playground access for, so let’s restrict ourselves to a computationally manageable yet geographically representative set of points. One reasonable way to do that is to lay a regular grid over the study area and choose a central point within each grid cell. A hexagon grid of circumradius 250 metres will do nicely. I’ll use MRCagney’s Geohexgrid library to make it. And from each hexagon, let’s choose its central street address point using LINZ’s NZ address points .