Skip to content
This repository was archived by the owner on Jun 3, 2025. It is now read-only.

Commit 3ec1f69

Browse files
authored
Merge pull request #1313 from transitland/minor-fixes-for-tlv2
Minor fixes for tlv2
2 parents e1048c3 + 13f1c3d commit 3ec1f69

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

app/services/gtfs_graph_importer.rb

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,17 +39,22 @@ def load_graph
3939
# gtfs_agency_id => operator
4040
oifs = Hash[@feed.operators_in_feed.map { |oif| [oif.gtfs_agency_id, oif.operator] }]
4141

42+
default_operator = nil
43+
if oifs.length == 1
44+
default_operator = oifs.first[1]
45+
end
46+
4247
# Operators
4348
@gtfs.agencies.each do |gtfs_agency|
4449
info("GTFS Agency: #{gtfs_agency.agency_id}", indent: 1)
45-
tl_operator = oifs[gtfs_agency.agency_id]
50+
tl_operator = oifs[gtfs_agency.agency_id] || default_operator
4651
if !tl_operator
4752
info("Operator not found, skipping", indent: 2)
4853
next
4954
end
5055
info("Operator: #{tl_operator.onestop_id}", indent: 2)
51-
@entity_tl[gtfs_agency] = tl_operator
52-
add_eiff(tl_operator, gtfs_agency)
56+
# @entity_tl[gtfs_agency] = tl_operator
57+
# add_eiff(tl_operator, gtfs_agency)
5358

5459
# Routes
5560
gtfs_agency.routes.each do |gtfs_route|
@@ -220,9 +225,9 @@ def private_create_change_osr
220225
end
221226

222227
# Update Feed Geometry
223-
info("Updating Feed geometry", indent: 0)
224-
@feed.set_bounding_box_from_stops(entities.select { |i| i.is_a?(Stop) })
225-
@feed.save!
228+
# info("Updating Feed geometry", indent: 0)
229+
# @feed.set_bounding_box_from_stops(entities.select { |i| i.is_a?(Stop) })
230+
# @feed.save!
226231

227232
# Create changeset
228233
info("Changeset create", indent: 0)

0 commit comments

Comments
 (0)