---
title: "GIS retail site selection in Python: drive-time catchments, suitability scoring and the Huff model"
description: "Retail site selection in Python with open data: drive-time catchments, weighted-overlay scoring and a Huff model for Albuquerque, tested on a 2023 closure."
url: https://www.technicalgis.com/tutorials/retail-site-selection-gis-python/
author: Sean Blaney (https://www.technicalgis.com/about/#sean-blaney)
publisher: TechnicalGIS (https://www.technicalgis.com/about/)
published: 2026-12-02
updated: 2026-12-02
language: en-GB
---

# GIS retail site selection in Python: drive-time catchments, suitability scoring and the Huff model

> Retail site selection in Python with open data: drive-time catchments, weighted-overlay scoring and a Huff model for Albuquerque, tested on a 2023 closure.

- Level: Intermediate
- Tested with: Python 3.12
- Source code: [Download scripts](https://www.technicalgis.com/code/retail-site-selection-gis-python/)

Series · Part 3 of 3

## [Retail from space](https://www.technicalgis.com/tutorials/series/retail-from-space/)

1.  [Watching car parks from space: what Sentinel-1 radar shows about Walmart's shoppers](https://www.technicalgis.com/articles/retail-car-parks-from-radar/)
2.  [Car-park occupancy from Sentinel-1 radar in Python: Walmart store closures as a natural experiment](https://www.technicalgis.com/tutorials/car-park-occupancy-sentinel-1-python/)
3.  GIS retail site selection in Python: drive-time catchments, suitability scoring and the Huff model

[See the whole series](https://www.technicalgis.com/tutorials/series/retail-from-space/)

## Key takeaways

1.  A drive-time catchment, not a radius, is the basic unit of retail geography. From one Albuquerque Supercenter, 23,036 households live within 5 minutes, 138,991 within 10 and 233,180 within 15.
2.  A weighted overlay of households, spending power, distance to the nearest competitor and road access ranks 918 candidate sites. Existing Supercenters sit at a median 72nd percentile on its demand criteria, so the criteria pick out the kind of place Walmart trades.
3.  The overlay and a Huff gravity model only partly agree (r = 0.44). The Huff model counts the competition explicitly, and it is the better guide to the spending a new store would take.
4.  Replaying 2022, the San Mateo Boulevard SE store that Walmart closed in March 2023 ranked 6th of 7 Supercenters on modelled spending per square metre and had the lowest-income 10-minute catchment.

## Before you start

-   Comfortable with GeoPandas, NumPy and pandas; Street network analysis with OSMnx introduces graphs and shortest paths
-   Python 3.10+ with duckdb, geopandas, scipy, requests, contextily and matplotlib (pinned in requirements.txt)
-   An internet connection: the first run downloads about 110 MB from Overture Maps and the US Census Bureau, with no account or API key, and takes about 10 minutes

**Short answer:** to choose a retail site with GIS, build a road network and measure **drive-time catchments** rather than circles. Put households and income from the census on the network, and list the competing stores with their floor areas. Score candidate sites with a transparent **weighted overlay** of demand, spending power, the gap to the nearest competitor and road access. Then run a **Huff gravity model**, which shares each household’s spending among all the stores it could reach, to estimate what a new store would take from the competition. Check the result against stores that already trade, and against one that failed.

The question in [Part 2](https://www.technicalgis.com/tutorials/car-park-occupancy-sentinel-1-python/) was how busy a store is. This part asks the question that comes before it: where should a store go at all? Retailers, property developers and planners answer it with the same building blocks: who lives within a short drive, how much they can spend, who else competes for that spending, and how easy the site is to reach.

We work in metro Albuquerque, New Mexico, with open data only. It is a good test because Walmart closed one of its Albuquerque Supercenters, on San Mateo Boulevard SE, in March 2023, so we can ask how that store looked to the model before it closed.

This is Part 3 of [Retail from space](https://www.technicalgis.com/tutorials/series/retail-from-space/). You will learn how to:

1.  get **households and income** for census tracts from the American Community Survey, with no API key;
2.  build a **drivable road network** from Overture Maps transportation segments, and run shortest paths with SciPy;
3.  spread demand onto the network, and list the **competing stores** with their floor areas from Overture places and buildings;
4.  map **5, 10 and 15-minute catchments**;
5.  score candidate sites with a **weighted overlay**, and check its demand criteria against where Walmart already trades;
6.  estimate captured spending with a **Huff model**;
7.  replay **2022** with the closed store back in place.

All outputs below are real results from [`site_selection.py`](https://www.technicalgis.com/code/retail-site-selection-gis-python/), run on 20 November 2026 with Python 3.12, DuckDB 1.5.6, GeoPandas 1.2.0 and SciPy 1.18.1.

## Step 1: households and income from the ACS

Demand starts with people. The American Community Survey (ACS) five-year estimates for 2019–2023 give households, population and median household income for every census tract. The Census Bureau publishes each table as one pipe-delimited file for the whole country, so no API key is needed. Tract boundaries come from the 2023 TIGER/Line shapefile for New Mexico.

`site_selection.py`

```python
def acs_table(table: str) -> pd.DataFrame:
    """One ACS 5-year detailed table for every geography, from the key-free table-based summary file."""
    f = DATA / f"acsdt5y2023-{table}.dat"
    if not f.exists():
        url = f"https://www2.census.gov/programs-surveys/acs/summary_file/2023/table-based-SF/data/5YRData/{f.name}"
        r = requests.get(url, headers=UA, timeout=600)
        r.raise_for_status()
        f.write_bytes(r.content)
    t = pd.read_csv(f, sep="|", dtype={"GEO_ID": str}, low_memory=False)
    return t[t.GEO_ID.str.startswith("1400000US35")].set_index("GEO_ID")

acs = pd.DataFrame({
    "households": acs_table("b11001")["B11001_E001"],
    "population": acs_table("b01003")["B01003_E001"],
    "median_income": acs_table("b19013")["B19013_E001"],
})
```

Households times median income gives each tract’s aggregate household income. We use it as a proxy for spending power: it is not what people spend in supermarkets, but it ranks places in the same order.

`Output — Step 1`

```text
192 tracts | 761,664 people | 317,069 households | median of tract median incomes $65,033
```

## Step 2: a drivable network from Overture Maps

Overture’s transportation theme gives road **segments** and the **connectors** where they join. Each segment lists its connectors with a fraction `at` along its length. Splitting every segment at its connectors gives the edges of a graph, and each edge’s travel time comes from its length and a typical urban speed for its road class.

`site_selection.py`

```python
cid, xs, ys, edges = {}, [], [], []
for s in seg.itertuples():
    ids = []
    for c in sorted(s.connectors, key=lambda c: c["at"]):
        if c["connector_id"] not in cid:
            p = s.geometry.interpolate(c["at"], normalized=True)
            cid[c["connector_id"]] = len(xs); xs.append(p.x); ys.append(p.y)
        ids.append((cid[c["connector_id"]], c["at"]))
    for (a, ta), (b, tb) in zip(ids, ids[1:]):
        if a != b:
            edges.append((a, b, s.length_m * (tb - ta) / (SPEED[s.cls] / 3.6) / 60, s.cls))
nodes = np.c_[xs, ys]
E = pd.DataFrame(edges, columns=["a", "b", "minutes", "cls"])
n = len(nodes)
W = coo_matrix((np.r_[E.minutes, E.minutes] + 1e-6, (np.r_[E.a, E.b], np.r_[E.b, E.a])), shape=(n, n)).tocsr()
```

A sparse matrix of travel times is all SciPy’s `dijkstra` needs. It finds every drive time from a set of sources in one call, which is much faster than routing site by site in a general-purpose graph library.

`Output — Step 2`

```text
83,834 road segments -> 139,842 junctions and 177,041 edges; the largest connected network holds 99.8% of junctions
```

The graph is undirected, so one-way streets and turn restrictions are ignored. For a metro-wide comparison of sites, that error is small and shared by every site.

## Step 3: put the households on the network

Households live along residential streets, not at tract centroids. We spread each tract’s households and income evenly over the junctions of its residential, tertiary and unclassified roads.

`Output — Step 3`

```text
317,069 households placed on 67,159 junctions (100.0% of the tracts' total)
```

## Step 4: the competition

A new store’s prospects depend on who else is nearby. We take the big grocery and general-merchandise chains from Overture places, drop the in-store pharmacies, fuel stations and pickup points, and attach each store to the building beneath it. The building’s **floor area** becomes the store’s attractiveness: bigger stores carry more lines and draw from further away.

`site_selection.py`

```python
places = gpd.sjoin_nearest(places, bld, max_distance=60, how="inner")
stores = (places.sort_values("confidence", ascending=False)
          .drop_duplicates("index_right")   # one store per building, whichever listing is most confident
          .drop(columns="index_right").reset_index(drop=True))
stores = stores[stores.floor_m2 > 2500].reset_index(drop=True)
```

Walmart’s San Mateo Boulevard SE store closed on 10 March 2023, as Walmart confirmed to KRQE ([reported by Nexstar via The Hill](https://thehill.com/homenews/nexstar_media_wire/3861514-walmart-to-close-additional-underperforming-locations-the-complete-list-so-far/)). Overture still lists it, so the script removes it from today’s network and keeps it for Step 8.

`Output — Step 4`

```text
76 chain listings -> 52 stores with a building of more than 2,500 m2
                             stores  median_floor_m2
fmt
Albertsons                       12           6783.0
Costco                            3          14808.0
Sam's Club                        3          12482.0
Smith's                           8           6670.0
Sprouts                           6           5627.0
Target                            5          11580.0
Walmart Neighborhood Market       7           3964.0
Walmart Supercenter               6          19882.0
Whole Foods                       2           3856.0
San Mateo Blvd SE (closed 2023): building 19,926 m2
```

Six Supercenters of about 19,900 m² each are the largest stores in the city by a wide margin. In a Huff model, that size is a large part of their pull.

![Map of metro Albuquerque census tracts shaded by households per square kilometre, densest in the south-east, with the 52 large stores marked by chain and a red cross for the closed San Mateo Boulevard SE Walmart](https://www.technicalgis.com/_astro/demand_and_stores.3kitmgNb_ZmIThQ.webp)

_Household density by census tract and the 52 large grocery and general-merchandise stores. The red cross marks the San Mateo Boulevard SE Supercenter, closed in March 2023._

## Step 5: drive-time catchments

A 3 km circle treats a river, a motorway and a cul-de-sac the same. A drive-time catchment follows the roads. From the Supercenter nearest downtown, one `dijkstra` call gives the minutes to every junction.

`site_selection.py`

```python
T_ex = dijkstra(W, indices=[example], limit=20)[0]
ex_ll = gpd.GeoSeries([wm.geometry[ex]], crs=CRS).to_crs(4326).iloc[0]
for m in (5, 10, 15):
    print(f"{m:2d}-minute catchment of the Supercenter at {ex_ll.y:.4f}, {ex_ll.x:.4f}: "
          f"{demand_hh[T_ex <= m].sum():8,.0f} households")
```

`Output — Step 5`

```text
 5-minute catchment of the Supercenter at 35.1120, -106.6079:   23,036 households
10-minute catchment of the Supercenter at 35.1120, -106.6079:  138,991 households
15-minute catchment of the Supercenter at 35.1120, -106.6079:  233,180 households
918 candidate sites (one per 500 m cell on trunk, primary and secondary roads in built-up tracts)
```

The catchment grows six-fold between 5 and 10 minutes, as the drive reaches the arterials and the interstate. Within 15 minutes are 74% of the metro’s households. A Supercenter is a destination people drive to, which is why the 10-minute catchment is the one we score on.

![Map of every road junction within 15 minutes' drive of a central Albuquerque Supercenter, coloured from yellow near the store to dark purple at 15 minutes, with outlines of the 5, 10 and 15-minute catchments](https://www.technicalgis.com/_astro/drive_time_catchments.NUWnJP7b_Z1mmwgS.webp)

_Drive times from the Supercenter nearest downtown, with the 5, 10 and 15-minute catchments outlined. The interstates stretch the catchment north and south._

Candidate sites are junctions on trunk, primary and secondary roads in built-up tracts, one per 500 m grid cell. A big store needs an arterial road for its customers and its lorries.

## Step 6: a weighted-overlay suitability score

The weighted overlay is the classic GIS approach, and its strength is that anyone can read it. Each candidate is ranked on four criteria, and the percentile ranks are added with weights:

-   **households within 10 minutes** (35%);
-   **aggregate household income within 10 minutes** (25%);
-   **the gap**: minutes to the nearest existing large store (25%);
-   **road access**: 1.0 on a trunk or primary road, 0.7 on a secondary (15%).

`site_selection.py`

```python
C["gap"] = nearest_store[cand]   # minutes to the nearest existing large store
C["access"] = pd.Series(node_cls[cand]).map({"trunk": 1.0, "primary": 1.0, "secondary": 0.7}).to_numpy()
WEIGHTS = {"hh10": 0.35, "spend10": 0.25, "gap": 0.25, "access": 0.15}
for k in WEIGHTS:
    C[f"r_{k}"] = C[k].rank(pct=True)
C["score"] = sum(w * C[f"r_{k}"] for k, w in WEIGHTS.items())
```

The weights are a judgement, and that is the method’s weakness as well as its strength. So we test the demand half of it against reality: if households and income within 10 minutes matter, the existing Supercenters should rank high on them.

`Output — Step 6`

```text
                 mean           min           50%           max
hh10     8.473591e+04  2.886600e+03  8.181900e+04  1.580743e+05
spend10  5.649686e+09  2.070025e+08  5.622091e+09  9.895790e+09
gap      2.860000e+00  2.400000e-01  2.420000e+00  1.160000e+01
access   8.000000e-01  7.000000e-01  7.000000e-01  1.000000e+00
huff     8.370255e+08  1.902942e+08  8.721131e+08  1.085048e+09
score    5.000000e-01  1.400000e-01  4.900000e-01  8.400000e-01
existing Supercenters on households and spending within 10 minutes: median percentile 72% (range 7%-88%, 67% in the top half)
```

The existing Supercenters sit at a median 72nd percentile on those criteria, and four of the six are in the top half. The two below halfway are the stores on the northern and south-western edges of the metro, with fewer than 45,000 households within 10 minutes (Step 8). Much of their trade comes from beyond our study area: a reminder that one box of census tracts is not a store’s whole market.

## Step 7: the Huff model

The overlay counts the gap to the nearest competitor, but not how big that competitor is or how many others are a little further away. The Huff model handles both. The probability that a household at junction _i_ shops at store _j_ is

P(i, j) = Aj f(Tij) / Σk Ak f(Tik), with f(T) = 1 / (1 + T)λ,

where A is floor area, T is drive time in minutes and λ = 2. A new store’s captured spending is its share of every household’s spending, summed over the metro.

`site_selection.py`

```python
def batch_metrics(src: np.ndarray, S: np.ndarray) -> pd.DataFrame:
    """Households and spending inside CATCH minutes, and Huff-captured spending, for each source junction."""
    rows = []
    for k in range(0, len(src), 200):
        T = dijkstra(W, indices=src[k:k + 200], limit=30)
        a = A_new * decay(T)
        rows.append(pd.DataFrame({"hh10": (demand_hh * (T <= CATCH)).sum(1),
                                  "spend10": (demand_spend * (T <= CATCH)).sum(1),
                                  "huff": (demand_spend * a / (S + a + 1e-12)).sum(1)}))
    return pd.concat(rows, ignore_index=True)
```

`S` is the sum of Ak f(Tik) over the existing stores at every junction, computed once. Each candidate then only adds its own term, so all 918 candidates take a few seconds.

`Output — Step 7`

```text
   lat      lon       hh10   gap  score  huff_$m  share_of_metro
35.104 -106.671 142579.171 3.023  0.822   1085.0           0.047
35.174 -106.542  73901.266 0.616  0.430   1077.0           0.046
35.209 -106.701  56170.986 3.149  0.460   1067.0           0.046
35.181 -106.675  84275.051 1.335  0.548   1058.0           0.045
35.104 -106.705 116716.240 1.697  0.668   1052.0           0.045
metro aggregate household income $23.3bn | correlation between overlay score and Huff capture across candidates: 0.44
```

The best site, just west of downtown near the Rio Grande, would capture an estimated 4.7% of the metro’s household income, $1,085m a year. It also has the highest overlay score of the five. But the two methods only partly agree across all candidates (r = 0.44). The second-best Huff site, in the north-east, sits just 0.6 minutes from a competitor and scores only 0.43 on the overlay. In the overlay, a nearby store counts against a site however small it is. In the Huff model it counts only in proportion to its floor area, so a 20,000 m² Supercenter can still win most of the spending around it. The overlay cannot see that.

The dollar figures are aggregate household income, not grocery sales, so read them as a ranking rather than a revenue forecast.

![Two maps of Albuquerque's candidate sites: the weighted-overlay score on the left peaks in the dense centre, while the Huff capture on the right is highest west of the river and in the north-east, with the five best Huff sites circled in red](https://www.technicalgis.com/_astro/suitability_and_huff.D8QA_9mb_209P8X.webp)

_The two methods side by side. The overlay (left) favours the dense centre; the Huff model (right) favours places where the existing stores are small or far away. Blue squares are the existing Supercenters._

## Step 8: replaying 2022 with the San Mateo store

Now put San Mateo Boulevard SE back and run the Huff model over all the stores as they were in 2022. Dividing each Supercenter’s captured spending by its floor area gives a measure of how well its location supports a store of its size.

`Output — Step 8`

```text
              where                                      name  floor_m2      hh10    inc10  huff_$m   per_m2
0  35.111, -106.701                                   Walmart   22676.5  100208.1  62434.1   1121.3  49447.7
1  35.243, -106.699                                   Walmart   20948.4   44822.5  83254.5   1016.6  48528.2
2  35.112, -106.608    Walmart Albuquerque - Carlisle Blvd NE   19909.9  138991.4  56662.7    814.1  40891.6
3  35.079, -106.530      Walmart Albuquerque - Eubank Blvd NE   19464.1  121105.6  61992.4    772.4  39682.0
4  35.107, -106.549     Walmart Albuquerque - Wyoming Blvd NE   19655.4  128361.0  64688.5    751.9  38255.7
5  35.076, -106.588  Walmart (San Mateo Blvd SE, closed 2023)   19925.9   96335.8  52674.5    722.7  36270.9
6  35.026, -106.711       Walmart Albuquerque - Coors Blvd SW   19853.7   38610.1  58012.2    570.1  28713.6
San Mateo ranked 6 of 7 Supercenters on modelled spending per m2 of store
```

San Mateo ranked 6th of 7, at $36,300 of modelled spending per square metre against $49,400 for the best. Its 10-minute catchment had the lowest income of any Supercenter, $52,700 per household, and it sat between the Carlisle and Wyoming stores, which shared its customers.

That fits the closure, but it would be wrong to say the model predicted it. The Coors Boulevard SW store ranked lower still and remains open, and much of its catchment lies beyond the south-western edge of our study area. Walmart described the stores it closed in 2023 as underperforming, and a store’s performance depends on far more than its location.

![Horizontal bar chart of modelled spending per square metre for Albuquerque's seven Walmart Supercenters in 2022, from about $49,400 at the top to $28,700 at the bottom, with the San Mateo Boulevard SE store in red, sixth of seven](https://www.technicalgis.com/_astro/huff_2022_supercenters.sxHjPw8z_2gYdWm.webp)

_Huff-modelled household spending captured per square metre of store, for the 2022 network. San Mateo Boulevard SE, in red, ranked sixth of seven._

## Where this goes next

-   **Calibrate λ.** The distance-decay exponent sets how far people will drive. Fit it to real visit data, such as loyalty-card postcodes or anonymised mobile data, if you can get them.
-   **Use spending, not income.** Consumer expenditure surveys give the share of income spent on groceries and general merchandise, which turns the dollar figures into sales estimates.
-   **Add the land.** Real site selection also checks plot size, zoning, the price of land and planning rules, which sit outside this model.
-   **Check it from space.** [Part 2](https://www.technicalgis.com/tutorials/car-park-occupancy-sentinel-1-python/) shows how to measure how busy a car park actually is with Sentinel-1, which gives you a way to test the model against what happened.

## Frequently asked questions

### What is the Huff model used for in retail?

It estimates the share of each area’s spending that a store will capture, given its size and its drive time compared with every competing store. Retailers use it to compare sites, estimate how much a new store would take from their own existing stores, and size a store for its location.

### Why use drive time rather than distance?

Because shoppers experience time, not distance. A river with one bridge, a motorway with few junctions or a gated suburb can make a short distance a long drive. Drive time on a road network captures that; a buffer does not.

### Do I need ArcGIS Network Analyst or a routing engine?

No. A road graph in a SciPy sparse matrix and `scipy.sparse.csgraph.dijkstra` give every drive time from hundreds of sources in seconds. ArcGIS Pro’s Network Analyst, pgRouting or OSRM add one-way streets, turn rules and traffic, which matter more for routing vehicles than for comparing sites.

### How should I choose the overlay weights?

Start from what the business says matters, then test the criteria against the stores that already trade, as in Step 6. If successful stores do not rank high on a criterion, question it. Keep the weights in the report, so that a reader can change them and see the effect.

### Is the data free to use commercially?

Yes. ACS and TIGER/Line data are US Government works in the public domain. Overture Maps data is open, with attribution, and contains OpenStreetMap data under the ODbL, which requires attribution and share-alike for derived databases.

## Next steps

-   [Part 1: Watching car parks from space](https://www.technicalgis.com/articles/retail-car-parks-from-radar/) measures how busy 134 stores are from Sentinel-1 radar.
-   [Part 2: Car-park occupancy from Sentinel-1 radar in Python](https://www.technicalgis.com/tutorials/car-park-occupancy-sentinel-1-python/) builds that method step by step.
-   [Location-allocation in Python](https://www.technicalgis.com/tutorials/location-allocation-python/) chooses several sites at once to cover demand.
-   [Spatial accessibility with the 2SFCA method](https://www.technicalgis.com/tutorials/spatial-accessibility-2sfca-python/) measures access to services with catchments and supply.

## Data and licences

-   **Households, population and income:** US Census Bureau, American Community Survey 2019–2023 five-year estimates, tables B11001, B01003 and B19013. Public domain.
-   **Census tracts:** US Census Bureau, 2023 TIGER/Line shapefiles. Public domain.
-   **Roads, places and buildings:** Overture Maps, release 2026-11-18.0, © Overture Maps Foundation, including data © OpenStreetMap contributors under the ODbL.
-   **Basemap:** Esri, HERE, Garmin, © OpenStreetMap contributors.
-   **Store closure:** Walmart’s confirmation to KRQE, as [reported by Nexstar via The Hill](https://thehill.com/homenews/nexstar_media_wire/3861514-walmart-to-close-additional-underperforming-locations-the-complete-list-so-far/), February 2023.

Walmart, Target, Costco and the other store names are trademarks of their owners, used here only to identify their stores. TechnicalGIS is not affiliated with or endorsed by any of them.

## Key terms

- **Catchment (trade area)**: The area from which a store draws its customers, usually drawn as the places within a given drive time.
- **Weighted overlay**: A suitability score built by ranking each site on several criteria and adding the ranks with chosen weights.
- **Huff model**: A gravity model of shopping: the probability that a household uses a store is the store's attractiveness divided by a power of travel time, as a share of the same quantity summed over every store it could use.
- **Distance decay**: The fall in the chance of travelling to a place as it gets further away. In the Huff model, the exponent λ sets how fast it falls.
- **ACS**: The American Community Survey, the US Census Bureau's continuous survey of households, published as one-year and five-year estimates down to census tracts.

## Data for this tutorial

-   [Overture Maps](https://www.technicalgis.com/data-sources/#src-overture-maps) · road segments with connectors, places and buildings as GeoParquet
-   [TIGER/Line Shapefiles](https://www.technicalgis.com/data-sources/united-states/#src-tiger-line-shapefiles) · 2023 census tract boundaries for New Mexico
-   [data.census.gov](https://www.technicalgis.com/data-sources/united-states/#src-data-census-gov) · American Community Survey 2019–2023 five-year estimates

Licences and formats for each source are listed in the [GIS data sources catalogue](https://www.technicalgis.com/data-sources/).

[← Part 2 Car-park occupancy from Sentinel-1 radar in Python: Walmart store closures as a natural experiment](https://www.technicalgis.com/tutorials/car-park-occupancy-sentinel-1-python/)

---

Source: https://www.technicalgis.com/tutorials/retail-site-selection-gis-python/
