Personal blog and hacks by Raymundo Cassani

How far is a Costco in Montreal?

Once clarified the different meanings of Montreal, I'm in a better position to solve a question inspired by a conversation with a friend, the question is:

How far from a Costco is everyone in the Montreal?

For city, I'll be using a map, that encompasses all the interpretations of Montreal.

Map for the different "Montreal" meanings

This post briefly describes the steps to answering the question, implemented as a script (code and data available here), using GeoPandas. If you only want to see the result, jump directly to the map at the end.

Costco stores in my area

The location of the stores in the Montreal is available in their Quebec stores listing. These addresses were then cross-checked with OpenStreetMap and Google maps. Oh surprise! the addresses did not always matched, thus, I had to verify the addressed (street number, street and postal code) with Canada Post. Interestingly the address in the Costco site were the correct. Don't worry, I've submitted the corrections in OpenStreetMap and Google maps.

There are a total of 14 stores in the area: Sud-Ouest, Marche central, Point-Claire, Anjou, Laval, Boucherville, Longueuil, Saint-Bruno, Brossard, Candiac, Vaudreuil-Dorion, Terrebonne, Boisbriand and Saint-Jerome.

Overview of the process

With all the information at hand, making the map as straight forward:

  1. Geocoding, converting the store addresses to locations on Earth
  2. Defining the map boundaries
  3. Making a grid in the map
  4. Computing the distance between each store location and each point in the grid
  5. Finding the minimum of those distances
  6. Plotting

This as a fun project, it can be easily modified to do the same analysis with other points for interest.

Relation with population density?

As a quick exploration, this distance-to-Costco map above was plotted on the 2021 population density map of the area. The result is interesting, and led to make the prediction:

The next Costco store in the region will open in Saint-Jean-sur-Richelieu.

Red background shades indicates high population density.

Limitations and future

Yes, so far it's a linear distance, that does not take into account streets (nor water canals!). An update would be to use a transit (or transportation) API to change distance to time, to show accessibility.


comments powered by Disqus