@@ -12,7 +12,7 @@ import (
12
12
"time"
13
13
14
14
"github.com/getsentry/sentry-go"
15
- "github.com/jamespfennell/gtfs"
15
+ remoteGtfs "github.com/jamespfennell/gtfs"
16
16
"watchdog.onebusaway.org/internal/geo"
17
17
"watchdog.onebusaway.org/internal/models"
18
18
"watchdog.onebusaway.org/internal/report"
@@ -157,7 +157,7 @@ func downloadAndStoreGTFSBundle(url string, serverID int, staticStore *StaticSto
157
157
return err
158
158
}
159
159
160
- staticBundle , err := gtfs .ParseStatic (data , gtfs .ParseStaticOptions {})
160
+ staticBundle , err := remoteGtfs .ParseStatic (data , remoteGtfs .ParseStaticOptions {})
161
161
if err != nil {
162
162
err = fmt .Errorf ("failed to parse GTFS static data from %s: %w" , url , err )
163
163
report .ReportErrorWithSentryOptions (err , report.SentryReportOptions {
@@ -180,7 +180,7 @@ func downloadAndStoreGTFSBundle(url string, serverID int, staticStore *StaticSto
180
180
181
181
// ParseGTFSFromCache reads a GTFS bundle from the cache and parses it into a gtfs.Static object.
182
182
// It returns the parsed static data or an error if parsing fails.
183
- func ParseGTFSFromCache (cachePath string , serverID int ) (* gtfs .Static , error ) {
183
+ func ParseGTFSFromCache (cachePath string , serverID int ) (* remoteGtfs .Static , error ) {
184
184
fileBytes , err := os .ReadFile (cachePath )
185
185
if err != nil {
186
186
report .ReportErrorWithSentryOptions (err , report.SentryReportOptions {
@@ -192,7 +192,7 @@ func ParseGTFSFromCache(cachePath string, serverID int) (*gtfs.Static, error) {
192
192
return nil , err
193
193
}
194
194
195
- staticData , err := gtfs .ParseStatic (fileBytes , gtfs .ParseStaticOptions {})
195
+ staticData , err := remoteGtfs .ParseStatic (fileBytes , remoteGtfs .ParseStaticOptions {})
196
196
if err != nil {
197
197
report .ReportErrorWithSentryOptions (err , report.SentryReportOptions {
198
198
Tags : utils .MakeMap ("server_id" , strconv .Itoa (serverID )),
@@ -209,7 +209,7 @@ func ParseGTFSFromCache(cachePath string, serverID int) (*gtfs.Static, error) {
209
209
// getStopLocationsByIDs retrieves stop locations by their IDs from the GTFS cache.
210
210
// It returns a map of stop IDs to gtfs.Stop objects.
211
211
212
- func getStopLocationsByIDs (serverID int , stopIDs []string , staticStore * StaticStore ) (map [string ]gtfs .Stop , error ) {
212
+ func getStopLocationsByIDs (serverID int , stopIDs []string , staticStore * StaticStore ) (map [string ]remoteGtfs .Stop , error ) {
213
213
staticData , ok := staticStore .Get (serverID )
214
214
if ! ok || staticData == nil {
215
215
err := fmt .Errorf ("no GTFS static data found for server ID %d" , serverID )
@@ -224,7 +224,7 @@ func getStopLocationsByIDs(serverID int, stopIDs []string, staticStore *StaticSt
224
224
stopIDSet [id ] = struct {}{}
225
225
}
226
226
227
- result := make (map [string ]gtfs .Stop )
227
+ result := make (map [string ]remoteGtfs .Stop )
228
228
for _ , stop := range staticData .Stops {
229
229
if _ , exists := stopIDSet [stop .Id ]; exists {
230
230
result [stop .Id ] = stop
@@ -283,7 +283,7 @@ func fetchAndStoreGTFSRTFeed(server models.ObaServer, realtimeStore *RealtimeSto
283
283
return err
284
284
}
285
285
286
- gtfsRT , err := gtfs .ParseRealtime (data , & gtfs .ParseRealtimeOptions {})
286
+ gtfsRT , err := remoteGtfs .ParseRealtime (data , & remoteGtfs .ParseRealtimeOptions {})
287
287
if err != nil {
288
288
report .ReportError (err )
289
289
return err
0 commit comments