Skip to content

Commit

Permalink
NYS-226 mark stops as accessible
Browse files Browse the repository at this point in the history
  • Loading branch information
sheldonabrown committed Sep 18, 2023
1 parent e9e5c98 commit b5c1eb8
Showing 1 changed file with 15 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,10 @@ public class MTAEntrancesStrategy implements GtfsTransformStrategy {

@CsvField(ignore = true)
private Set<AgencyAndId> stopIdsWithPathways = new HashSet<AgencyAndId>();


@CsvField(ignore = true)
private Map<AgencyAndId, Stop> complexStopIds = new HashMap<>();

@CsvField(ignore = true)
private String agencyId;

Expand Down Expand Up @@ -128,6 +131,9 @@ public class MTAEntrancesStrategy implements GtfsTransformStrategy {
@CsvField(optional = true)
private int elevatorTraversalTime = 120;

@CsvField(optional = true)
private boolean markStopsAsAccessible = false;

public String getName() {
return this.getClass().getName();
}
Expand Down Expand Up @@ -226,6 +232,13 @@ public void run(TransformContext context, GtfsMutableRelationalDao dao) {
if (elevatorsCsv != null) {
readElevatorData(stopGroups, getComplexList(dao));
}

for (AgencyAndId aid : complexStopIds.keySet()) {
Stop stop = complexStopIds.get(aid);
stop.setWheelchairBoarding(WHEELCHAIR_ACCESSIBLE);
_log.info("marking stop {} as accessible", stop.getId());
dao.saveEntity(stop);
}

for (Stop s : newStops) {
dao.saveEntity(s);
Expand Down Expand Up @@ -572,6 +585,7 @@ private Map<String, List<Stop>> getComplexList(GtfsDao dao) {
if (stop == null)
_log.info("null stop: {}", id);
complex.add(stop);
this.complexStopIds.put(AgencyAndId.convertFromString(id), stop);
}
complexes.put("complex-" + UUID.randomUUID(), complex);
}
Expand Down

0 comments on commit b5c1eb8

Please sign in to comment.