Opportunity Sources and Opportunity Models
1. Overview
In transportation accessibility modeling, travel time alone only tells half the story—the value of a transportation network lies in the opportunities (activities, jobs, goods, and services) it connects people to.
BAMBAM separates opportunity modeling into two concepts:
- Opportunity Source: Where raw land-use and employment data come from and how domain-specific categories are mapped to study activity types (such as jobs, retail, healthcare, food, services, and entertainment). BAMBAM provides built-in connectors for:
- U.S. Census LEHD LODES: Workplace Area Characteristics (WAC) employment counts by NAICS industry sector (
CNS01–CNS20), joined with Census TIGER/Line block or tract polygons. - Overture Maps Foundation (OMF): Point-of-interest
placesandbuildingsfootprints downloaded from cloud object storage and categorized by land-use taxonomy. - Custom Tabular Data: Point or polygon CSV datasets in wide or long format.
- U.S. Census LEHD LODES: Workplace Area Characteristics (WAC) employment counts by NAICS industry sector (
- Opportunity Model: How those opportunities are attached to the routing graph and looked up during a study:
apiModel: Downloads and spatially disaggregates opportunities onto network vertices on the fly when BAMBAM starts.fileModel: Loads pre-tabulated opportunity counts already indexed to network vertices (or edges), avoiding repeated API downloads across multiple runs.combinedModel: Merges multiple opportunity models together—for example, combining Overture Maps POIs (food,retail,healthcare,services,entertainment) with Census LODES employment (jobs).
2. Setup
Pre-Computing Opportunities to Disk (bambam_util import-opportunities)
While the default bambam.toml uses an api model to fetch LODES data at runtime, large studies typically pre-import both Overture Maps POIs and LODES employment into vertex-indexed file tables so subsequent runs start immediately.
First, define an Overture Maps opportunity source config (e.g., denver_buf/opps-omf/opps-import.toml):
[plugin.output_plugins.model.opportunity_source]
type = "overture"
release_version = "Latest"
extent = { type = "wkt_file", path = "query/denver_470_buffer.txt" }
collector_config = { "obj_store_type" = "s3" }
[plugin.output_plugins.model.opportunity_source.places_activity_mapping]
food = ["restaurant", "bar"]
healthcare = ["health_care"]
entertainment = ["sports_and_recreation", "arts_and_entertainment"]
retail = ["shopping"]
services = ["education", "financial_service", "animal_or_pet_service", "home_service"]
[plugin.output_plugins.model.opportunity_source.buildings_activity_mapping]
food = []
healthcare = ["medical"]
entertainment = ["entertainment", "civic"]
retail = ["commercial"]
services = ["education", "religion"]
And a LODES opportunity source config for jobs (e.g., denver_buf/opps-lodes/run-opps.toml):
type = "lodes"
study_region = { type = "national" }
data_granularity = "census_tract"
edition = "LODES8"
job_type = "JT00"
segment = "S000"
year = 2024
fallback = { TryPreviousYears = 5 }
[activity_mapping]
C000 = ["jobs"]
Run bambam_util import-opportunities for each source to spatially attach opportunities to denver_buf/vertices-compass.csv.gz:
# 1. Import Overture Maps Places & Buildings
./rust/target/release/bambam_util import-opportunities \
--source-config denver_buf/opps-omf/opps-import.toml \
--impute-graph \
--vertices-file denver_buf/vertices-compass.csv.gz \
--output-directory denver_buf/opps-omf \
--namespace output-plugins
# 2. Import LODES Employment
./rust/target/release/bambam_util import-opportunities \
--source-config denver_buf/opps-lodes/run-opps.toml \
--impute-graph \
--vertices-file denver_buf/vertices-compass.csv.gz \
--output-directory denver_buf/opps-lodes \
--namespace output-plugins
(Note: For custom CSV datasets, you can also use ./rust/target/release/bambam_util opps-long or opps-wide to snap point or WKT rows to vertices-compass.csv.gz.)
Modifying bambam.toml
Each import-opportunities run writes opportunities.csv.gz and an opportunity.toml snippet containing the pre-computed opportunity_totals and file model block. Replace the [[plugin.output_plugins]] type = "opportunity" section in denver_buf/bambam.toml with a combined model referencing both files:
[[plugin.output_plugins]]
type = "opportunity"
[plugin.output_plugins.opportunity_totals]
entertainment = 8625.0
food = 6884.0
healthcare = 9446.0
retail = 19279.0
services = 21608.0
jobs = 152629402.0
[plugin.output_plugins.model]
type = "combined"
[[plugin.output_plugins.model.models]]
type = "file"
opportunity_input_file = "opps-omf/opportunities.csv.gz"
activity_column_names = ["entertainment", "food", "healthcare", "retail", "services"]
table_orientation = "destination_vertex_oriented"
[[plugin.output_plugins.model.models]]
type = "file"
opportunity_input_file = "opps-lodes/opportunities.csv.gz"
activity_column_names = ["jobs"]
table_orientation = "destination_vertex_oriented"
Running BAMBAM
cd denver_buf
../rust/target/release/bambam \
--config-file bambam.toml \
--query-file ../query/denver_extent.json
3. What Happens
- Spatial Disaggregation & Vertex Assignment (
import-opportunities):- Point opportunities (such as Overture Places) are snapped to the nearest road network vertex within a proximity tolerance (200 meters by default).
- Polygonal opportunities (such as Census LODES tracts/blocks or Overture Building footprints) are apportioned evenly across all road network vertices that fall inside the polygon (or snapped to the nearest vertex to the polygon centroid if no vertices lie strictly inside).
- The resulting
opportunities.csv.gztable has one row per vertex ID invertices-compass.csv.gz, storing the exact count of each activity category at that vertex (destination_vertex_oriented).
- Fast Tabular Lookup During BAMBAM Execution:
- When
bambamstarts, thecombinedopportunity output plugin loads bothopps-omf/opportunities.csv.gzandopps-lodes/opportunities.csv.gzinto memory and merges their activity columns. - As each grid cell’s shortest-path tree completes, BAMBAM groups reached destination vertices into the 10-, 20-, 30-, and 40-minute travel-time bins and sums the vertex opportunity vectors in \(O(1)\) lookup time per reached vertex.
- Study-wide
opportunity_totalsare written alongside the bin-level counts (opps_<activity>_10..40) inresult.csvandresult.json.
- When