Engineering Real-Time Isochrone Catchment Areas & Adaptive Population Grids
1. Executive Summary & Problem Context
[Euclidean Radius Fallacy (Circles)]
Store ──(2km Straight Line)──> Blocked by Highway / River / Mountain (25 min travel)
Store ──(5km Straight Line)──> Highway Corridor (6 min travel)
[Real Isochrone Catchment Area (Drive-Time & Walk-Time Polygons)]
Store ──[ Road Network Topology & Speed Limits ]──> True Travel-Time Polygon (Isochrone)
│
└──[ Bounded Census Population Grid ]──> Exact Addressable Market Size (Audience)
The Mission
- Isochrone Generation: Calculate precise 5, 10, 15, 20, and 30-minute drive-time and walk-time reachability polygons across road networks.
- Adaptive Population Grid: Discretize national census point datasets into a dynamic, zoom-aware spatial lattice (approx 90m resolution at zoom 15).
- Instant Demographic Sizing: Intersect complex isochrone geometries with hundreds of thousands of census points in under 5ms using in-memory 2D R-Tree indexing.
- Trade-Zone Intelligence: Quantify competitor overlap, market share potential, and spatial cannibalization across multi-unit retail networks.
2. Catchment & Population Engine Architecture
3. Catchment Area Generation & Isochrone Engineering
3.1 Rate-Limited Routing Pipeline (PQueue + Batching)
Problem Statement
Solution: Controlled Concurrency Queue with Range Bundling
Typescript
3.2 Schema Architecture & Deterministic Upsert Keying
- companyId_mode_range: (companyId, mode, range)
- outletId_mode_range: (outletId, mode, range)
- userId_mode_range: (userId, mode, range)
Typescript
4. Adaptive Census Population Grid Engine
4.1 Exponential Zoom-Dependent Lattice Sizing
Problem Statement
- At Zoom 15 (Street Level), a 1km cell size is too coarse to evaluate individual commercial storefronts.
- At Zoom 9 (National Level), rendering 90m cells generates over 2,000,000 polygons, crashing the browser DOM.
Solution: Exponential Geometric Cell Sizing
Typescript
[Adaptive Grid Resolution Matrix] Zoom Level 15 (Street View): 90m Cells ──> High-Precision Block Analysis Zoom Level 13 (Subdivision): 180m Cells ──> District Demographic Density Zoom Level 11 (Municipality): 360m Cells ──> City-Wide Population Clusters Zoom Level 9 (National): 720m Cells ──> National Population Overview
4.2 Linear Lattice Quantization and Spatial Aggregation
Typescript
5. Catchment Demographics & Multi-Store Cannibalization
5.1 Sub-Millisecond Point-in-Polygon (PIP) Intersection
[Spatial Query Pipeline]
Isochrone Polygon (50+ Vertices)
│
▼ (Phase 1: Bounding-Box Envelope)
[minLng, minLat, maxLng, maxLat] ──> RBush 2D R-Tree Query (O(log N))
│
▼ (Phase 2: Pruned Candidates: 1,200 points instead of 200,000)
Ray-Casting booleanPointInPolygon() on Candidates
│
▼
Exact Total Population Returned in 3.8ms 🚀
Typescript
5.2 Multi-Catchment Overlap & Cannibalization Analysis
[Catchment Overlap Model]
Store A (Catchment A) Store B (Catchment B)
┌─────────────┐ ┌─────────────┐
│ │ Overlap │ │
│ Zone A │ Zone AB │ Zone B │
│ (k = 1) │ (k = 2) │ (k = 1) │
│ │ │ │
└─────────────┼───────────┼─────────────┘
└───────────┘
- Exclusive Zone ($k = 1$): 100% of cell population attributed to the single covering store.
- Shared Overlap Zone ($k = 2$): Cell population and potential demand split equally: Pop_Store = Cell_Population / 2.
- Cannibalization Warning: If more than 45% of a new franchisee's catchment is already covered by existing outlets (k >= 2), the system flags high cannibalization risk before franchise signing.
6. Key Architectural Decisions & Engineering Trade-Offs
7. Performance Benchmarks & Results
┌────────────────────────────────────────────────────────┐ │ CATCHMENT & POPULATION BENCHMARKS │ ├────────────────────────────┬───────────────────────────┤ │ Isochrone Generation (6x) │ 420ms (Parallel PQueue) │ │ Population PIP Query │ 3.8ms (via RBush R-Tree) │ │ Grid Cell Aggregation │ 12ms for 200k Points │ │ Viewport Catchment Query │ 1.8ms (Database Index) │ │ Overlap Cannibalization │ Real-time Deterministic │ └────────────────────────────┴───────────────────────────┘
- Zero Demography Guesswork: Field reps evaluate exact addressable customer bases within walking and driving distance in seconds.
- Deterministic Expansion Planning: Automated catchment intersection prevents store-on-store revenue cannibalization.
- Sub-5ms Responsiveness: Sales directors pan across cities with instant population grid updates and smooth isochrone rendering.
8. Summary Checklist for Portfolio Reviewers
- [x] Routing & Isochrones: Multi-mode, multi-range routing via OpenRouteService with PQueue throttling.
- [x] Spatial Indexing: 2D R-Tree (RBush) for sub-millisecond point-in-polygon queries.
- [x] Computational Demographics: Adaptive geometric grid scaling (~90m base resolution) + $O(N)$ lattice quantization.
- [x] Commercial Analytics: Trade-area overlap sharing, competitor proximity evaluation, and cannibalization modeling.