mirror of
https://github.com/cjdenio/uta-trax-api.git
synced 2026-08-04 22:06:34 +00:00
fix headsigns
This commit is contained in:
+14
-3
@@ -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
@@ -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
Binary file not shown.
Reference in New Issue
Block a user