From c27100b61d98c0644656d5311004058be3974879 Mon Sep 17 00:00:00 2001 From: Ian Rees Date: Tue, 27 Jul 2021 17:29:23 -0700 Subject: [PATCH 1/3] Attempt to guess operator --- app/services/gtfs_graph_importer.rb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/services/gtfs_graph_importer.rb b/app/services/gtfs_graph_importer.rb index 37bad647..ad5af937 100644 --- a/app/services/gtfs_graph_importer.rb +++ b/app/services/gtfs_graph_importer.rb @@ -39,10 +39,15 @@ def load_graph # gtfs_agency_id => operator oifs = Hash[@feed.operators_in_feed.map { |oif| [oif.gtfs_agency_id, oif.operator] }] + default_operator = nil + if oifs.length == 1 + default_operator = oifs.first[1] + end + # Operators @gtfs.agencies.each do |gtfs_agency| info("GTFS Agency: #{gtfs_agency.agency_id}", indent: 1) - tl_operator = oifs[gtfs_agency.agency_id] + tl_operator = oifs[gtfs_agency.agency_id] || default_operator if !tl_operator info("Operator not found, skipping", indent: 2) next From 9dd203d9c2dd3a6cde13a89f0bf32d81c3db21ac Mon Sep 17 00:00:00 2001 From: Ian Rees Date: Tue, 27 Jul 2021 17:29:33 -0700 Subject: [PATCH 2/3] Do not update feed geometry --- app/services/gtfs_graph_importer.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/services/gtfs_graph_importer.rb b/app/services/gtfs_graph_importer.rb index ad5af937..d29a264e 100644 --- a/app/services/gtfs_graph_importer.rb +++ b/app/services/gtfs_graph_importer.rb @@ -225,9 +225,9 @@ def private_create_change_osr end # Update Feed Geometry - info("Updating Feed geometry", indent: 0) - @feed.set_bounding_box_from_stops(entities.select { |i| i.is_a?(Stop) }) - @feed.save! + # info("Updating Feed geometry", indent: 0) + # @feed.set_bounding_box_from_stops(entities.select { |i| i.is_a?(Stop) }) + # @feed.save! # Create changeset info("Changeset create", indent: 0) From 13f1c3d6f2139b4283ae0ca0469ed34922566543 Mon Sep 17 00:00:00 2001 From: Ian Rees Date: Tue, 27 Jul 2021 17:30:33 -0700 Subject: [PATCH 3/3] Do not save updated operator; these live in Atlas now --- app/services/gtfs_graph_importer.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/services/gtfs_graph_importer.rb b/app/services/gtfs_graph_importer.rb index d29a264e..36d277b3 100644 --- a/app/services/gtfs_graph_importer.rb +++ b/app/services/gtfs_graph_importer.rb @@ -53,8 +53,8 @@ def load_graph next end info("Operator: #{tl_operator.onestop_id}", indent: 2) - @entity_tl[gtfs_agency] = tl_operator - add_eiff(tl_operator, gtfs_agency) + # @entity_tl[gtfs_agency] = tl_operator + # add_eiff(tl_operator, gtfs_agency) # Routes gtfs_agency.routes.each do |gtfs_route|