Skip to content

Commit

Permalink
Fix the broken GTFS loading
Browse files Browse the repository at this point in the history
  • Loading branch information
dabreegster committed Oct 16, 2024
1 parent a4d1431 commit 8edeb84
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ This is an experimental rewrite of <15m.abstreet.org>. Stay tuned.

To build and run the web app locally, `cd web; npm run wasm; npm run dev`. You need to re-run `npm run wasm` when the Rust code in `backend` changes.

The GTFS data used is built from the [UK BODS](https://data.bus-data.dft.gov.uk/). After downloading and unzipping, you can build using `cd backend; cargo run --release gmd /path/to/gtfs`. The file is encoded using [geomedea](https://github.com/michaelkirk/geomedea).
The GTFS data used is built from the [UK BODS](https://data.bus-data.dft.gov.uk/). After downloading and unzipping, you can build using `cd cli; cargo run --release build-gtfs /path/to/gtfs`. The file is encoded using [geomedea](https://github.com/michaelkirk/geomedea).
6 changes: 5 additions & 1 deletion graph/src/scrape.rs
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ impl Graph {
GtfsSource::None => GtfsModel::empty(),
};
snap_stops(&mut self.roads, &mut gtfs, &self.router[Mode::Foot], timer);
self.gtfs = gtfs;
timer.pop();
Ok(())
}
Expand Down Expand Up @@ -207,7 +208,10 @@ fn snap_stops(
return;
}

timer.step("find closest roads per stop");
timer.step(format!(
"find closest roads per stop ({})",
gtfs.stops.len()
));
// TODO Make an iterator method that returns the IDs too
for (idx, stop) in gtfs.stops.iter_mut().enumerate() {
let stop_id = crate::gtfs::StopID(idx);
Expand Down

0 comments on commit 8edeb84

Please sign in to comment.