diff --git a/src/main/java/com/conveyal/datatools/manager/jobs/feedmerge/MergeLineContext.java b/src/main/java/com/conveyal/datatools/manager/jobs/feedmerge/MergeLineContext.java index c8ff7a1f9..51b5a255c 100644 --- a/src/main/java/com/conveyal/datatools/manager/jobs/feedmerge/MergeLineContext.java +++ b/src/main/java/com/conveyal/datatools/manager/jobs/feedmerge/MergeLineContext.java @@ -272,13 +272,8 @@ private Table getReferenceTable(FieldContext fieldContext, Field field) { getTableScopedValue(Table.CALENDAR_DATES, fieldContext.getValue()) ); case STOP_TIMES_STOP_ID_KEY: - return ReferenceTableDiscovery.getStopTimeReferenceTable( - fieldContext.getValueToWrite(), - mergeFeedsResult, - feedMergeContext.locationIds - ); case LOCATION_GROUP_STOPS_STOP_ID_KEY: - return ReferenceTableDiscovery.getLocationGroupStopReferenceTable( + return ReferenceTableDiscovery.getStopReferenceTable( fieldContext.getValueToWrite(), mergeFeedsResult ); diff --git a/src/main/java/com/conveyal/datatools/manager/jobs/feedmerge/ReferenceTableDiscovery.java b/src/main/java/com/conveyal/datatools/manager/jobs/feedmerge/ReferenceTableDiscovery.java index 1aa8ac4f5..285a8912d 100644 --- a/src/main/java/com/conveyal/datatools/manager/jobs/feedmerge/ReferenceTableDiscovery.java +++ b/src/main/java/com/conveyal/datatools/manager/jobs/feedmerge/ReferenceTableDiscovery.java @@ -3,7 +3,6 @@ import com.conveyal.gtfs.loader.Field; import com.conveyal.gtfs.loader.Table; -import java.util.Set; import java.util.stream.Collectors; import static com.conveyal.datatools.manager.jobs.feedmerge.MergeLineContext.SERVICE_ID; @@ -32,8 +31,7 @@ public enum ReferenceTableKey { REF_TABLE_SEPARATOR, Table.LOCATION_GROUP_STOPS.name, "stop_id", - Table.STOPS.name, - Table.LOCATIONS.name + Table.STOPS.name ) ), STOP_TIMES_STOP_ID_KEY( @@ -41,9 +39,7 @@ public enum ReferenceTableKey { REF_TABLE_SEPARATOR, Table.STOP_TIMES.name, "stop_id", - Table.STOPS.name, - Table.LOCATIONS.name, - Table.LOCATION_GROUP_STOPS.name + Table.STOPS.name ) ); @@ -112,33 +108,11 @@ public static Table getTripServiceIdReferenceTable( } /** - * Define the reference table for a location group stop: stop id. This will either be a stop or null. + * Defines the reference table as a stop if the field value matches a stop id. */ - public static Table getLocationGroupStopReferenceTable( - String fieldValue, - MergeFeedsResult mergeFeedsResult - ) { - if (mergeFeedsResult.stopIds.contains(fieldValue)) { - return Table.STOPS; - } - return null; - } - - /** - * Define the reference table for a stop time's stop id. This will either be a stop, location or location group. - * TODO: In later PR's this will be redundant as a stop time: stop id will only reference a stop. - */ - public static Table getStopTimeReferenceTable( - String fieldValue, - MergeFeedsResult mergeFeedsResult, - Set locationIds - ) { + public static Table getStopReferenceTable(String fieldValue, MergeFeedsResult mergeFeedsResult) { if (mergeFeedsResult.stopIds.contains(fieldValue)) { return Table.STOPS; - } else if (locationIds.contains(fieldValue)) { - return Table.LOCATIONS; - } else if (mergeFeedsResult.locationGroupStopIds.contains(fieldValue)) { - return Table.LOCATION_GROUP_STOPS; } return null; }