MRCagney Works

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.

Make this Notebook Trusted to load map: File -> Trust Notebook

Now let’s collect all the playgrounds listed in OpenStreetMap that lie within the study area using OSMnx.

Make this Notebook Trusted to load map: File -> Trust Notebook

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.

Make this Notebook Trusted to load map: File -> Trust Notebook

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 .

Make this Notebook Trusted to load map: File -> Trust Notebook

Get the walking isochrones

For each of our 14,320 grid points, let’s compute its 15-minute, outbound, walking-with-child isochrone. We’ll use the Targomo isochrone API for this, which takes elevation into account and lets us set a custom flat-land walking speed. Setting the latter to 3.2 km/h seems reasonable for walking with children of various ages. On second thought, let’s compute the inbound isochrone about each playground instead, which amounts to the same thing, but limits our API calls to only 1,550 (the number of playgrounds). Here’s what those isochrones look like.

Make this Notebook Trusted to load map: File -> Trust Notebook

Measure playground access

Finally, let’s count how many isochrones of distinct playground groups each grid point is contained in, then map each grid point colour-coded by its count. Better yet, let’s colour-code the cell of each grid point instead for a prettier map and an estimate of the cell’s playground access.

Make this Notebook Trusted to load map: File -> Trust Notebook

Looks like Freemans Bay, Point England, and Weymouth top the chart. I’ve never heard of Weymouth, but I notice that it and Point England both contain over 27% 0–14 year olds. I am surprised to see the wealthy, mostly residential suburb of Remuera score so low. Is that and other gaping holes legitimate, or are we missing some playgrounds or walkways in OpenStreetMap? Such questions I’d probe were this a paid project, but such questions I now leave for you, dear reader, as we end this data story. I hope you all learned something. Excuse me while I find the nearest monkey bars.

Author: Alex Raichev
Date: 2024-02-02
Comment