diff --git a/cmd/main.go b/cmd/main.go index 2b10d7e..7976122 100644 --- a/cmd/main.go +++ b/cmd/main.go @@ -20,6 +20,15 @@ import ( 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 { radlat1 := float64(math.Pi * lat1 / 180) radlat2 := float64(math.Pi * lat2 / 180) @@ -158,9 +167,11 @@ func feedifyVehicles(vehicles []*pb.VehiclePosition, header *pb.FeedHeader, rout continue } - // force MVX to match other BRT services - if route_id == "87711" { - route_color = sql.NullString{Valid: true, String: "1191d0"} + // sometimes headsigns are weird. this lets me manually change them + if trip_headsign.Valid { + if mapping, ok := headsignMappings[strings.ToLower(trip_headsign.String)]; ok { + trip_headsign.String = mapping + } } rows.Close() diff --git a/update-gtfs.sh b/update-gtfs.sh index 0c1f978..f90136e 100755 --- a/update-gtfs.sh +++ b/update-gtfs.sh @@ -3,4 +3,5 @@ set -eo pipefail curl --output gtfs.zip --location https://gtfsfeed.rideuta.com/GTFS.zip -gtfs-import --gtfsPath gtfs.zip --sqlitePath uta-gtfs.db \ No newline at end of file +gtfs-import --gtfsPath gtfs.zip --sqlitePath uta-gtfs.db +rm -rf gtfs/ && unzip -d gtfs gtfs.zip diff --git a/uta-gtfs.db b/uta-gtfs.db index bd4c870..206d512 100644 Binary files a/uta-gtfs.db and b/uta-gtfs.db differ