a-b-street/abstreet · error

Can't import_parcels for popdat.bin without the scenarios…

Error message

Can't import_parcels for popdat.bin without the scenarios feature (GDAL dependency)

What it means

When the importer is built WITHOUT the "scenarios" cargo feature, import_parcels is replaced by a stub that unconditionally panics. Importing parcels (which turns parcel data into endpoints for popdat.bin) requires GDAL, so the crate only supports it under the scenarios feature. Hitting this panic means you invoked the Soundcast import pipeline in a build that excluded the feature.

Solutions

  1. Rebuild with the feature enabled: `cargo build --release --features scenarios` (requires GDAL system libraries installed).
  2. Install GDAL dev packages first (e.g. `apt install libgdal-dev`) so the feature compiles.
  3. If parcels aren't needed, use an import path/mode that skips popdat generation.
  4. Regenerate popdat.bin on a machine with the scenarios build and copy the artifact over.

Example fix

// before
cargo build --release
./target/release/importer soundcast
// after
cargo build --release --features scenarios
./target/release/importer soundcast
Defensive patterns

Strategy: validation

Validate before calling

// At build/startup time, check the feature was compiled in:
#[cfg(not(feature = "scenarios"))]
compile_error!("scenario import requires --features scenarios");

Try / catch

// Panics uncatchably; verify build flags before running imports:
if std::env::var("POPDAT_IMPORT").is_ok() && !cfg!(feature = "scenarios") {
    eprintln!("rebuild with --features scenarios");
    return;
}

Prevention

When it happens

Trigger: Running the importer to produce popdat.bin (importing Soundcast parcels/trips) with a binary compiled without `--features scenarios`, so the #[cfg(not(feature = "scenarios"))] stub executes.

Common situations: Building with plain `cargo build` instead of `cargo build --release --features scenarios`; CI scripts missing the feature flag; following docs for scenario import with a default-feature build.

Related errors


AI-assisted analysis of a-b-street/abstreet@0964f29315 (2026-09-13). Data as JSON: /api/errors/5db4d8e7c070ed3f. Report an issue: GitHub.

Appendix: source

Thrown at importer/src/soundcast/popdat.rs:233

                id,
                ExtraShape {
                    points: vec![gps],
                    attributes,
                },
            );
        }
    }
    info!("{} parcels", prettyprint_usize(result.len()));

    (result, shapes)
}

#[cfg(not(feature = "scenarios"))]
fn import_parcels(
    _: &Map,
    _: &mut Timer,
) -> (HashMap<usize, Endpoint>, BTreeMap<usize, ExtraShape>) {
    panic!("Can't import_parcels for popdat.bin without the scenarios feature (GDAL dependency)");
}

// From https://github.com/psrc/soundcast/wiki/Outputs#trip-file-_triptsv, dpurp
fn get_purpose(code: &str) -> TripPurpose {
    match code {
        "0.0" => TripPurpose::Home,
        "1.0" => TripPurpose::Work,
        "2.0" => TripPurpose::School,
        "3.0" => TripPurpose::Escort,
        "4.0" => TripPurpose::PersonalBusiness,
        "5.0" => TripPurpose::Shopping,
        "6.0" => TripPurpose::Meal,
        "7.0" => TripPurpose::Social,
        "8.0" => TripPurpose::Recreation,
        "9.0" => TripPurpose::Medical,
        "10.0" => TripPurpose::ParkAndRideTransfer,
        _ => panic!("Unknown dpurp {}", code),
    }

View on GitHub (pinned to 0964f29315)