fix headsigns

This commit is contained in:
2026-05-24 11:50:42 -06:00
parent e0af336a94
commit c74195b650
3 changed files with 16 additions and 4 deletions
+14 -3
View File
@@ -20,6 +20,15 @@ import (
var scheduleDb *sql.DB var scheduleDb *sql.DB
var headsignMappings map[string]string = map[string]string{
"to medical": "To University Medical",
"to airport": "To Airport",
"to draper": "To Draper",
"to salt lake": "To Salt Lake Central",
"to meadowbrook": "To Meadowbrook",
"to ballpark": "To Ballpark",
}
func distance(lat1 float64, lng1 float64, lat2 float64, lng2 float64) float64 { func distance(lat1 float64, lng1 float64, lat2 float64, lng2 float64) float64 {
radlat1 := float64(math.Pi * lat1 / 180) radlat1 := float64(math.Pi * lat1 / 180)
radlat2 := float64(math.Pi * lat2 / 180) radlat2 := float64(math.Pi * lat2 / 180)
@@ -158,9 +167,11 @@ func feedifyVehicles(vehicles []*pb.VehiclePosition, header *pb.FeedHeader, rout
continue continue
} }
// force MVX to match other BRT services // sometimes headsigns are weird. this lets me manually change them
if route_id == "87711" { if trip_headsign.Valid {
route_color = sql.NullString{Valid: true, String: "1191d0"} if mapping, ok := headsignMappings[strings.ToLower(trip_headsign.String)]; ok {
trip_headsign.String = mapping
}
} }
rows.Close() rows.Close()
+2 -1
View File
@@ -3,4 +3,5 @@
set -eo pipefail set -eo pipefail
curl --output gtfs.zip --location https://gtfsfeed.rideuta.com/GTFS.zip curl --output gtfs.zip --location https://gtfsfeed.rideuta.com/GTFS.zip
gtfs-import --gtfsPath gtfs.zip --sqlitePath uta-gtfs.db gtfs-import --gtfsPath gtfs.zip --sqlitePath uta-gtfs.db
rm -rf gtfs/ && unzip -d gtfs gtfs.zip
BIN
View File
Binary file not shown.