Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove deprecated support for GTFS flex stop areas #6074

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ public class GTFSToOtpTransitServiceMapper {

private final FareTransferRuleMapper fareTransferRuleMapper;

private final StopAreaMapper stopAreaMapper;
private final DirectionMapper directionMapper;

private final DataImportIssueStore issueStore;
Expand Down Expand Up @@ -112,9 +111,6 @@ public GTFSToOtpTransitServiceMapper(
boardingAreaMapper = new BoardingAreaMapper(translationHelper, stopLookup);
locationMapper = new LocationMapper(builder.stopModel(), issueStore);
locationGroupMapper = new LocationGroupMapper(stopMapper, locationMapper, builder.stopModel());
// the use of stop areas were reverted in the spec
// this code will go away, please migrate now!
stopAreaMapper = new StopAreaMapper(stopMapper, locationMapper, builder.stopModel());
pathwayMapper =
new PathwayMapper(stopMapper, entranceMapper, pathwayNodeMapper, boardingAreaMapper);
routeMapper = new RouteMapper(agencyMapper, issueStore, translationHelper);
Expand All @@ -126,7 +122,6 @@ public GTFSToOtpTransitServiceMapper(
stopMapper,
locationMapper,
locationGroupMapper,
stopAreaMapper,
tripMapper,
bookingRuleMapper,
translationHelper
Expand Down Expand Up @@ -166,7 +161,6 @@ public void mapStopTripAndRouteDataIntoBuilder() {
// Stop areas and Stop groups are only used in FLEX routes
builder.stopModel().withAreaStops(locationMapper.map(data.getAllLocations()));
builder.stopModel().withGroupStops(locationGroupMapper.map(data.getAllLocationGroups()));
builder.stopModel().withGroupStops(stopAreaMapper.map(data.getAllStopAreas()));
}

builder.getPathways().addAll(pathwayMapper.map(data.getAllPathways()));
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
import org.onebusaway.gtfs.model.Location;
import org.onebusaway.gtfs.model.LocationGroup;
import org.onebusaway.gtfs.model.Stop;
import org.onebusaway.gtfs.model.StopArea;
import org.opentripplanner.framework.collection.MapUtils;
import org.opentripplanner.framework.i18n.I18NString;
import org.opentripplanner.model.StopTime;
Expand All @@ -22,7 +21,6 @@ class StopTimeMapper {
private final LocationMapper locationMapper;

private final LocationGroupMapper locationGroupMapper;
private final StopAreaMapper stopAreaMapper;

private final TripMapper tripMapper;
private final BookingRuleMapper bookingRuleMapper;
Expand All @@ -35,15 +33,13 @@ class StopTimeMapper {
StopMapper stopMapper,
LocationMapper locationMapper,
LocationGroupMapper locationGroupMapper,
StopAreaMapper stopAreaMapper,
TripMapper tripMapper,
BookingRuleMapper bookingRuleMapper,
TranslationHelper translationHelper
) {
this.stopMapper = stopMapper;
this.locationMapper = locationMapper;
this.locationGroupMapper = locationGroupMapper;
this.stopAreaMapper = stopAreaMapper;
this.tripMapper = tripMapper;
this.bookingRuleMapper = bookingRuleMapper;
this.translationHelper = translationHelper;
Expand Down Expand Up @@ -71,8 +67,6 @@ private StopTime doMap(org.onebusaway.gtfs.model.StopTime rhs) {
case Stop stop -> lhs.setStop(stopMapper.map(stop));
case Location location -> lhs.setStop(locationMapper.map(location));
case LocationGroup locGroup -> lhs.setStop(locationGroupMapper.map(locGroup));
// TODO: only here for backwards compatibility, this will be removed in the future
case StopArea area -> lhs.setStop(stopAreaMapper.map(area));
default -> throw new IllegalArgumentException(
"Unknown location type: %s".formatted(stopLocation)
);
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -85,17 +85,11 @@ public class StopTimeMapperTest {
locationMapper,
stopModelBuilder
);
private final StopAreaMapper stopAreaMapper = new StopAreaMapper(
stopMapper,
locationMapper,
stopModelBuilder
);
private final TranslationHelper translationHelper = new TranslationHelper();
private final StopTimeMapper subject = new StopTimeMapper(
stopMapper,
locationMapper,
locationGroupMapper,
stopAreaMapper,
new TripMapper(
new RouteMapper(new AgencyMapper(FEED_ID), ISSUE_STORE, translationHelper),
new DirectionMapper(ISSUE_STORE),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,6 @@ public class TransferMapperTest {
LOCATION_MAPPER,
STOP_MODEL_BUILDER
);
private static final StopAreaMapper STOP_AREA_MAPPER = new StopAreaMapper(
STOP_MAPPER,
LOCATION_MAPPER,
STOP_MODEL_BUILDER
);
private static StopTimeMapper STOP_TIME_MAPPER;

private static final Integer ID = 45;
Expand Down Expand Up @@ -99,7 +94,6 @@ void prepare() {
STOP_MAPPER,
LOCATION_MAPPER,
LOCATION_GROUP_MAPPER,
STOP_AREA_MAPPER,
new TripMapper(
new RouteMapper(new AgencyMapper(FEED_ID), ISSUE_STORE, TRANSLATION_HELPER),
new DirectionMapper(ISSUE_STORE),
Expand Down
Loading