Skip to the content.

Crosswalk Step: Creating the TM2 Geographic Crosswalk

⚠️ IMPORTANT: Crosswalk creation has been moved to the tm2py-utils repository.

This step prepares the essential geographic crosswalk files used throughout the Bay Area PopulationSim pipeline. The crosswalks map MAZs, TAZs, counties, and other geographies, enabling consistent aggregation and disaggregation of data.

What This Step Does

Script Location

The crosswalk creator script is now located in:

C:\GitHub\tm2py-utils\tm2py_utils\inputs\maz_taz\standalone_tm2_crosswalk_creator.py

See the README_crosswalk_creator.md file in that directory for complete usage instructions.

Pipeline Integration

Expected File Locations

The PopulationSim pipeline expects crosswalk files to be located in:

populationsim/bay_area/output_2023/populationsim_working_dir/data/

Required Files

Workflow

  1. Run the standalone crosswalk creator script from tm2py-utils repository
  2. Copy the generated files to the pipeline data directory, or use --pipeline-mode for automatic placement
  3. Proceed with control generation and population synthesis

Migration Notice

Previous scripts deprecated:

New unified approach:

Inputs

Outputs

How to Run

New standalone approach:

python standalone_tm2_crosswalk_creator.py \
  --maz-shapefile /path/to/maz_shapefile.shp \
  --puma-shapefile /path/to/puma_shapefile.shp \
  --county-shapefile /path/to/county_shapefile.shp \
  --blocks-file /path/to/blocks.csv \
  --output-dir /path/to/output/directory \
  --verbose

Example with typical paths:

python standalone_tm2_crosswalk_creator.py \
  --maz-shapefile "C:/GitHub/tm2py-utils/tm2py_utils/inputs/maz_taz/TM2_MAZ_TAZ_Bounds/TM2_MAZ_TAZ_Bounds.shp" \
  --puma-shapefile "C:/GitHub/tm2py-utils/tm2py_utils/inputs/maz_taz/shapefiles/tl_2020_06_puma10.shp" \
  --county-shapefile "C:/GitHub/tm2py-utils/tm2py_utils/inputs/maz_taz/shapefiles/california_counties.shp" \
  --blocks-file "C:/GitHub/tm2py-utils/tm2py_utils/inputs/maz_taz/tm2py_mazs_blocks_23.csv" \
  --output-dir "output_2023/populationsim_working_dir/data" \
  --verbose

Notes


Return to the main documentation index for other pipeline steps.


Return to the main documentation index for other pipeline steps.