From b5c1eb842e25a2cc5f1161365ff532d3e0dbddf4 Mon Sep 17 00:00:00 2001 From: sheldonabrown Date: Mon, 18 Sep 2023 18:25:26 -0400 Subject: [PATCH] NYS-226 mark stops as accessible --- .../impl/MTAEntrancesStrategy.java | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/onebusaway-gtfs-transformer/src/main/java/org/onebusaway/gtfs_transformer/impl/MTAEntrancesStrategy.java b/onebusaway-gtfs-transformer/src/main/java/org/onebusaway/gtfs_transformer/impl/MTAEntrancesStrategy.java index f7f2781b0..db73ecb1a 100644 --- a/onebusaway-gtfs-transformer/src/main/java/org/onebusaway/gtfs_transformer/impl/MTAEntrancesStrategy.java +++ b/onebusaway-gtfs-transformer/src/main/java/org/onebusaway/gtfs_transformer/impl/MTAEntrancesStrategy.java @@ -82,7 +82,10 @@ public class MTAEntrancesStrategy implements GtfsTransformStrategy { @CsvField(ignore = true) private Set stopIdsWithPathways = new HashSet(); - + + @CsvField(ignore = true) + private Map complexStopIds = new HashMap<>(); + @CsvField(ignore = true) private String agencyId; @@ -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(); } @@ -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); @@ -572,6 +585,7 @@ private Map> 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); }