8  Running a custom area

If the area you want to model isn’t already generated, then you can follow this guide to run SPC on a custom area. You must first compile SPC.

8.1 Specifying the area

SPC takes a newline-separated list of MSOAs in the config/ directory as input, like this. You can generate this list from a LAD (local authority district). From the main SPC directory, run python scripts/select_msoas.py. Refer to data/raw_data/referencedata/lookUp.csv (only available after running SPC once) for all geographies available.

This script will create a new file, config/your_region.txt.

8.2 Run SPC for the new area

From the main directory, just run:

cargo run --release -- config/your_region.txt

This will download some large files the first time. You’ll wind up with data/output/your_region.pb as output, as well as lots of intermediate files in data/raw_data/. The next time you run this command (even on a different study area), it should go much faster.

8.3 (Optional) Output to parquet format

As an alternative to protobuf outputs, you can also run the SPC and choose to output to parquet format instead by running:

cargo run --release -- config/your_region.txt --output-formats parquet

or if both protobuf and parquet are required, change the flag to --output-formats protobuf,parquet.

8.4 (Optional) run SPC for lots of areas

If you want to run the program over lots of areas at once and are using Mac/Linux, you can use a for loop in a terminal to repeatedly run SPC over all files in the config directory. For example, this will run SPC on all .txt files in the config directory:

for file in config/*.csv; do cargo run --release -- config/$file; done

8.5 Using the output

After you generate the files, see here for how to use them in your project.

If you use SPC code or data in your work, please cite using the Zenodo DOI (using the bottom-right tool to generate the citation).