Day 10 — Pizzas, Push-ups, and Python

SauYee Chan
henngeblog
Published in
4 min readDec 10, 2022

This blog post was inspired by my team’s daily stand-up. Everyone’s plans and blockers? Of course, we cover the usual Scrum stuff. Bug reports? Ugh, OK, if it’s not really a feature. A quiet day with no imminent blockers and everything seems fine? We seek advice from others (e.g. how to get a cheap flight this holiday season) and discuss current affairs (e.g. Japan beat Germany/Spain in the World Cup, but we have no extra holidays).

One time, someone quipped, “I started going to the gym. But there’s a Domino’s next to it…” Soon, another chimed in, “Oh, there’s a Domino’s next to a gym near my place too.” This led to a brief debate about the location strategy of Domino’s, which subsequently inspired me, an urban engineer (make of that what you will) in a previous life, to explore if it’s true that gyms and pizzerias tend to be located near each other.

Theoretical framework

The field of location theory is fascinating. Ever wondered why there’s a FamilyMart just across the road from another FamilyMart in Japan?

FamilyMart spotted across the road from another FamilyMart (taken in Shibuya, Japan — near our office!)

Hotelling’s Law posits that, assuming demand is evenly distributed along a linear path, two sellers will both be located at the centre of that path, which is the equilibrium point that allows businesses to maximise their market coverage.

Economists also offer explanations for the agglomeration of economies: labour market pooling, sharing of suppliers and knowledge spillovers are supposed to encourage similar businesses and industries to form clusters (e.g. Silicon Valley, Shenzhen).

But what about businesses that seem somewhat disjoint, as in the case of Domino’s and gyms?

An image of six slices of pizza
Will workouts and pizzas prove to have more in common, beyond a six-pack?

Intuitively, having a gym next to a Domino’s makes sense, as the benefit goes both ways: 1) gym-goers will be hungry after a good work-out; and 2) pizza-eaters may need a good workout to burn those calories. We’ll turn to data to find out if this purported location pattern of pizzerias and gyms can be observed in reality.

Methodology

We make use of a type of Open Data called OpenStreetMap (commonly known as OSM) to identify the locations of gyms and pizzerias. In OSM, data are mapped and tagged by volunteers in the form of “key=value”, such as “cuisine=pizza” and “leisure=fitness_centre”.

To simplify the data retrieval process, we analyse OSM data through the Ohsome API, which allows us to specify the area of interest (Tokyo, in this case) as well as key-value filters. The programming language Python will be used to execute API requests and visualise location data.

A map that shows pizzerias (in yellow) and gyms (in blue) in Tokyo
Visualising pizzerias (in yellow) and gyms (in blue) in Tokyo (Source: OSM)

For the purpose of this analysis, we define proximity as “within 100 metres”. This threshold is determined using a random sample of data retrieved from the Ohsome API and verified via Google Maps Street View (see examples below).

Google Maps Street View image showing Domino’s Pizza below a sports gym
Examples of gyms and pizzerias located in proximity, i.e. within 100 metres, in Taito-ku and Ota-ku, Tokyo (Source: Google Maps)

Results and Reflection

The Ohsome API returned ~200 pizzerias and ~300 gyms in Tokyo (excluding the islands), as of Oct 2022. Overall, the percentage of pizzerias located within a 100-metre radius of a sports gym is a measly 5%. Even if we take the data with a grain of salt (according to OSM, several populous cities, such as Tachikawa-shi, have no pizzerias at all!) and limit our scope to the better-mapped 23 Wards of Tokyo, the percentage only increases to a paltry 6%. In other words, looking at the data, it’s impossible to conclude that pizzerias tend to be located near sports gyms.

Pizzerias with a gym located nearby only represent 5% of all pizzerias in Tokyo (Source: OSM)

Although the results are somewhat disappointing, this is a good illustration of a common difficulty I’ve encountered throughout my Data Analysis career: Good data is expensive. A more reliable source (in a Japanese context, at least) like the Google Places API would have cost upwards of $20 USD, while scraping data off Domino’s official website would have required more time.

Anyway, the lack of this spatial pattern may represent future business opportunities. Planet Fitness, a fitness chain in North America, offers free pizzas to members on the first Monday night of every month (“Pizza Mondays”). Given that they were one of the fastest-growing fitness chains circa 2015, they might be onto something…

Data powered by

Raifer, Martin, Troilo, Rafael, Mocnik, Franz-Benjamin, & Schott, Moritz. (2022). OSHDB — OpenStreetMap History Data Analysis (1.0.0). Zenodo. https://doi.org/10.5281/zenodo.7351614

Geospatial Information Authority of Japan. 地球地図日本. https://www.gsi.go.jp/kankyochiri/gm_jpn.html

--

--

SauYee Chan
henngeblog

Will run her first and last full marathon in Nov 2022, in the rain. Intrigued by humans who do illogical things.