# Focusing a metro

Zoom to a metro area and rank only its neighborhoods by resemblance to your brand.

## What it does

When you select a metro from the picker, LookAlike zooms the map to that metro and re-ranks neighborhoods to surface the best matches _within that metro_ rather than across the entire country. This is useful when you are screening for expansion in a specific market rather than hunting nationally.

The metro focus also adds a **screening rollup** at the top of the neighborhood list — a quick count of how many neighborhoods in this metro reach the high-similarity threshold (85th percentile or above), and whether they are open markets or already contain a brand location.

## Ranking metros against each other (Top metros)

Focusing a metro answers “which neighborhoods in _this_ metro should I look at?” The **Top metros** view answers the prior question: “which metro should I look at first?” It is a sibling of the lookalikes list — open it from the list header, and return with the ”← LookAlikes” button.

Top metros ranks every metropolitan area by the **count of open, high-resemblance-rank neighborhoods** it holds — tracts at the 85th percentile or higher for the current brand and weights that do not already contain a store. Click any metro in the ranking to focus the map on it.

This ranks metros by how many high-rank neighborhoods each has, not by how good those markets are. A large metro will rank high simply for having more tracts. The count says nothing about demand, rent, competition, or whether a store would perform. Read it as “where are there the most places to start looking,” then investigate each metro on its own merits.

## The 383 metros

The picker offers **383 Metropolitan Statistical Areas** (MSAs) based on the US Census **CBSA delineation from 2023**. These are the Census’s official metro-area definitions, spanning all of continental United States.

The data comes from `fetch_cbsa.py`, which maps the Census’s CBSA reference file to individual census tracts. A tract belongs to a metro if its county sits in that metro’s geographic footprint. Unincorporated rural areas and non-metro counties are assigned a metro code of zero (no metro).

The picker counts are updated from the Census TIGER/Line 2024 tract boundaries and centroids, so metro sizes reflect 2024 tract demography.

## How metros are assigned to tracts

Each census tract’s county FIPS code is cross-walked to its CBSA code using the Census’s official 2023 delineation file. The pipeline writes two assets:

-   `web/public/data/metros.json` — metadata for each of the 383 metros: the CBSA code, official name, tract count, bounding box, and center point (for map positioning).
-   `web/public/data/tracts/cbsa.u16` — a binary uint16 array, one value per tract in the standard geoids order. A value of `0` means the tract is not in any metro; any other value is the CBSA code it belongs to.

Because the metro assignment is based on county-level delineation, all tracts in a county belong to the same metro or no metro. Tract boundary precision is limited by county boundaries.

## The screening rollup

When a metro is focused, the `CandidatesList` component displays a summary above the ranked neighborhoods:

> **\[Metro Name\]:** X neighborhoods at the 85th percentile or higher · Y open · Z already with a store

This breaks down the metro’s high-similarity tracts into:

-   **Total at ≥85th percentile** — the count of neighborhoods that rank at or above the 85th percentile for resemblance to the brand.
-   **Open** — how many of those high-similarity neighborhoods do not yet contain a brand location.
-   **Already with a store** — how many already do.

The 85th percentile threshold is a triage signal: neighborhoods this close to the archetype are candidate expansion sites worth deeper investigation.

The rollup shows resemblance only, not suitability. Even if all high-percentile neighborhoods are open markets, a store there is not guaranteed to succeed. Use this as a screening filter, not as a recommendation.

## How the ranking changes when you focus a metro

When no metro is selected, neighborhoods are ranked by their national similarity percentile — a tract’s position relative to all ~83,000 tracts in the country.

When you select a metro, only that metro’s tracts are ranked. The ranking recomputes live in the browser. A neighborhood that ranks 50th nationally might rank 92nd within its metro if that metro has few stores of that brand; conversely, a tight metro cluster might push lower-national neighborhoods higher within the metro.

The similarity scores themselves do not change — the archetype and distances are the same. Only the percentile assignment changes because the pool of comparable tracts shrinks.

Use metro focus when you want to find the strongest neighborhoods in a specific market without national rankings pulling attention away. Combine it with minimum-similarity and open-markets-only filters for tactical screening.

## Combining filters

Metro focus works alongside other filters:

-   **Open markets only** — excludes tracts already containing the brand, showing only expansion opportunities.
-   **Minimum similarity** — e.g., show only the 75th percentile or above within the metro.
-   **State filter** — if a metro spans multiple states, you can further narrow to one state.

All three filters apply together, so you can say “In the Portland metro, show me open neighborhoods in Oregon that rank 80th percentile or above for resemblance to Trader Joe’s.”

## Implementation details

-   **Metro list** is loaded from `web/public/data/metros.json` and rendered in the “Map & filters” section of the left rail in `App.tsx`.
-   **Metro code selection** triggers the `selectMetro` callback in `App.tsx`, which updates the `metroCode` state and sets the map view to the metro’s center point and bounding box.
-   **Ranking within metro** is filtered in the `allCandidates` memo: a tract is included only if `data.cbsa[i] === metroCode` (or all tracts when `metroCode === 0`).
-   **Screening rollup** is computed in the `metroSummary` memo, counting tracts in the metro at the 85th percentile or higher and tagging them as open or occupied.

The metro does not change the scoring algorithm or feature weights — it only changes the candidate pool and percentile assignment.

## Learning more

-   [How LookAlike works](https://docs.lookalikeiq.com/method/how-it-works/) — the scoring method, features, and validation.
-   [Data sources](https://docs.lookalikeiq.com/method/data-sources/) — CBSA delineation and TIGER/Line tract definitions.
-   [Filtering the map](https://docs.lookalikeiq.com/guides/the-map/) — using state, similarity, and open-markets filters alongside metro focus.

Canonical URL: https://docs.lookalikeiq.com/guides/metro-focus/
