Add R5 validation

This commit is contained in:
Andras Schmelczer 2026-05-12 06:44:15 +01:00
parent f2a2651b8a
commit b580c51b6d
4 changed files with 53 additions and 10 deletions

View file

@ -111,6 +111,19 @@ mkdir -p "$NETWORK_DIR"
OSM_PBF="property-data/england-latest.osm.pbf"
TRANSIT_SRC="property-data/transit"
NETWORK_DATA_DIR="$NETWORK_DIR/build"
shopt -s nullglob
GTFS_FILES=("$TRANSIT_SRC"/*.zip)
shopt -u nullglob
if [ ${#GTFS_FILES[@]} -eq 0 ]; then
echo "Error: no GTFS .zip files found in $TRANSIT_SRC/"
echo "Run: make -f Makefile.data download-transit-network"
if [ -f "$NETWORK_DIR/network.dat" ]; then
echo "A cached R5 network exists at $NETWORK_DIR/network.dat, but it may be stale or OSM-only."
echo "Delete it after restoring transit data so R5 rebuilds with GTFS."
fi
exit 1
fi
if [ ! -f "$NETWORK_DIR/network.dat" ]; then
BUILD_DIR="$NETWORK_DIR/build"
@ -122,10 +135,7 @@ if [ ! -f "$NETWORK_DIR/network.dat" ]; then
exit 1
fi
cp "$OSM_PBF" "$BUILD_DIR/"
if ! cp "$TRANSIT_SRC"/*.zip "$BUILD_DIR/" 2>/dev/null; then
echo "Warning: no GTFS .zip files found in $TRANSIT_SRC/ — transit routing would be unavailable"
exit 1
fi
cp "${GTFS_FILES[@]}" "$BUILD_DIR/"
fi
# --- Step 5: Run batch ---