Four user-reported bugs from the Colombia trip: 1. Santa Marta legs not routing (extract gap). The SAMARTA OSM box had MAXLAT 11.22, which clipped the old town (~11.24 N) so every city point snapped to the same boundary node. Raised it to 11.28 (covers the Malecón + Plaza Colesio). Rebuilt the Colombia extract. 2. "Can't take a taxi / wrong times." The :5003 Colombia router is a *walking* build (foot.lua) and cannot return a driving route, so 'car' legs silently came back as long walks (CTG->hotel showed 105 min). Added a second, *driving* build (car.lua, same cropped OSM) on :5004 and made the /route proxy send driving-profile requests there. Now the airport drop-off is a real 16-min drive, and the walk<->taxi toggle changes the estimate (16 min car vs 105 min walk). 3. Arrival timeline inconsistent. The arrival day's startMin was set from a static ~20-min estimate and never updated when the drop-off actually routed. Added syncArrivalStart(): the start tracks landing + the transfer's (asynchronously routed, mode-dependent) duration, and every stop follows. Lunch no longer lands before the traveller reaches the hotel. 4. Hovering a hotel card zoomed to the other city. renderHotelCard flashed EVERY stay's marker, so a multi-city trip flew the map to the off-screen hotel (and alternated on each hover). Now it flashes only the current day's hotel(s). Also: enrichment used a single global token, so when apply_flight_anchors enriched all days in one pass only the LAST day's legs actually routed (the earlier days bailed on the token check). Made the token per-day so every day's legs route independently, and scoped the background re-renders to the on-screen day. Verified via CDP: 11/11 fix checks + cdp_smoke, cdp_struct (13), cdp_dates (7), cdp_leg (17), cdp_coords (6) all green. Co-Authored-By: Claude <noreply@anthropic.com>
58 lines
2.3 KiB
Bash
58 lines
2.3 KiB
Bash
#!/usr/bin/env bash
|
|
# Build + serve the COLOMBIA walking router (Cartagena + Santa Marta boxes) on :5003.
|
|
#
|
|
# The full-country PBF (329 MB) is too big for `osmium extract -s complete_ways`
|
|
# on this box (~2 GB free RAM), so crop_pbf.py streams it in 3 passes and keeps
|
|
# only the two city boxes (~4.6 MB). The dataset is built with the official
|
|
# foot.lua profile (real walking speeds, ~5 km/h).
|
|
#
|
|
# Prereq: scripts/setup-osrm.sh has run once (OSRM binaries + osmium exist in
|
|
# $HOME/osm-build). The Colombia PBF is downloaded from geofabrik if missing.
|
|
#
|
|
# Usage: scripts/setup-osrm-colombia.sh # build + serve :5003
|
|
# scripts/setup-osrm-colombia.sh --no-serve # build only
|
|
set -euo pipefail
|
|
cd "$(dirname "$0")"
|
|
|
|
W="${W:-$HOME/osm-build}"
|
|
OSM_DIR="$(cd ../.. && pwd)/osm"
|
|
DATA_DIR="$W/data/colombia"
|
|
OSRM_BIN="$W/build"
|
|
OSRM_SRC="$W/osrm-backend-26.4.1"
|
|
SERVE=1
|
|
[ "${1:-}" = "--no-serve" ] && SERVE=0
|
|
export LD_LIBRARY_PATH="$W/prefix/lib${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}"
|
|
|
|
mkdir -p "$DATA_DIR"
|
|
PBF="$OSM_DIR/colombia.osm.pbf"
|
|
|
|
echo "=== PBF"
|
|
if [ ! -s "$PBF" ]; then
|
|
echo "downloading colombia-latest.osm.pbf from geofabrik (~330 MB)..."
|
|
curl -sL -o "$PBF" https://download.geofabrik.de/south-america/colombia-latest.osm.pbf
|
|
fi
|
|
ls -la "$PBF"
|
|
|
|
echo "=== crop to Cartagena + Santa Marta boxes (3 streaming passes, ~3 min)"
|
|
# boxes: MINLON MINLAT MAXLON MAXLAT (Cartagena city+beaches, Santa Marta+Tayrona)
|
|
# NOTE: SAMARTA MAXLAT must stay north of the old town (~11.24 N); 11.22 clipped it and
|
|
# made every city point snap to the same boundary node. 11.28 covers Malecón + Plaza Colesio.
|
|
CARTAGENA="-75.66,10.26,-75.36,10.56"
|
|
SAMARTA="-74.36,10.84,-74.02,11.28"
|
|
python3 crop_pbf.py "$PBF" /tmp/colombia-trip.pbf "$CARTAGENA" "$SAMARTA"
|
|
|
|
echo "=== extract (foot.lua) + partition + customize"
|
|
rm -f "$DATA_DIR"/colombia-trip.osrm.*
|
|
"$OSRM_BIN/osrm-extract" /tmp/colombia-trip.pbf \
|
|
-p "$OSRM_SRC/profiles/foot.lua" -o "$DATA_DIR/colombia-trip"
|
|
"$OSRM_BIN/osrm-partition" "$DATA_DIR/colombia-trip"
|
|
"$OSRM_BIN/osrm-customize" "$DATA_DIR/colombia-trip"
|
|
|
|
if [ "$SERVE" = 0 ]; then
|
|
echo "done (not serving; start with: $OSRM_BIN/osrm-routed --algorithm mld --port 5003 $DATA_DIR/colombia-trip.osrm)"
|
|
exit 0
|
|
fi
|
|
|
|
echo "=== serve on :5003 (Ctrl-C to stop)"
|
|
exec "$OSRM_BIN/osrm-routed" --algorithm mld --port 5003 "$DATA_DIR/colombia-trip.osrm"
|