Skip to content

Commit

Permalink
correctly handle unknown transport type
Browse files Browse the repository at this point in the history
  • Loading branch information
AaronClaydon committed Nov 5, 2024
1 parent bd7b9b6 commit faeca2f
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion pkg/dataimporter/formats/gtfs/schedule.go
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,11 @@ func (g *Schedule) Import(dataset datasets.DataSet, datasource *ctdf.DataSource)
continue
}

transportType := routeTypeMapping[gtfsRoute.Type]
if transportType == "" {
transportType = ctdf.TransportTypeUnknown
}

ctdfService := &ctdf.Service{
PrimaryIdentifier: serviceID,
OtherIdentifiers: []string{
Expand All @@ -256,7 +261,7 @@ func (g *Schedule) Import(dataset datasets.DataSet, datasource *ctdf.DataSource)
Routes: []ctdf.Route{},
BrandColour: gtfsRoute.Colour,
SecondaryBrandColour: gtfsRoute.TextColour,
TransportType: routeTypeMapping[gtfsRoute.Type],
TransportType: transportType,
}

transforms.Transform(ctdfService, 1, "gb-dft-bods-gtfs-schedule")
Expand Down

0 comments on commit faeca2f

Please sign in to comment.