-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6229 from ibi-group/wheelchair-debug
Fix parsing of wheelchair accessible parking, add wheelchair debug layer
- Loading branch information
Showing
10 changed files
with
266 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
60 changes: 60 additions & 0 deletions
60
...tion/src/test/java/org/opentripplanner/graph_builder/module/osm/ParkingProcessorTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
package org.opentripplanner.graph_builder.module.osm; | ||
|
||
import static org.junit.jupiter.api.Assertions.assertEquals; | ||
import static org.junit.jupiter.api.Assertions.assertFalse; | ||
import static org.junit.jupiter.api.Assertions.assertNull; | ||
import static org.junit.jupiter.api.Assertions.assertTrue; | ||
|
||
import java.util.List; | ||
import org.junit.jupiter.api.Test; | ||
import org.opentripplanner._support.geometry.Coordinates; | ||
import org.opentripplanner.framework.i18n.I18NString; | ||
import org.opentripplanner.graph_builder.issue.api.DataImportIssueStore; | ||
import org.opentripplanner.osm.wayproperty.specifier.WayTestData; | ||
import org.opentripplanner.routing.graph.Graph; | ||
import org.opentripplanner.street.model._data.StreetModelForTest; | ||
import org.opentripplanner.street.model.vertex.IntersectionVertex; | ||
|
||
class ParkingProcessorTest { | ||
|
||
private static final IntersectionVertex INTERSECTION_VERTEX = StreetModelForTest.intersectionVertex( | ||
1, | ||
1 | ||
); | ||
private static final ParkingProcessor PROCESSOR = new ParkingProcessor( | ||
new Graph(), | ||
DataImportIssueStore.NOOP, | ||
(n, w) -> INTERSECTION_VERTEX | ||
); | ||
|
||
@Test | ||
void noWheelchairParking() { | ||
var entity = WayTestData.parkAndRide(); | ||
var parking = PROCESSOR.createVehicleParkingObjectFromOsmEntity( | ||
true, | ||
Coordinates.BERLIN, | ||
entity, | ||
I18NString.of("parking"), | ||
List.of() | ||
); | ||
|
||
assertFalse(parking.hasWheelchairAccessibleCarPlaces()); | ||
assertNull(parking.getCapacity().getWheelchairAccessibleCarSpaces()); | ||
} | ||
|
||
@Test | ||
void wheelchairParking() { | ||
var entity = WayTestData.parkAndRide(); | ||
entity.addTag("capacity:disabled", "yes"); | ||
var parking = PROCESSOR.createVehicleParkingObjectFromOsmEntity( | ||
true, | ||
Coordinates.BERLIN, | ||
entity, | ||
I18NString.of("parking"), | ||
List.of() | ||
); | ||
|
||
assertTrue(parking.hasWheelchairAccessibleCarPlaces()); | ||
assertEquals(1, parking.getCapacity().getWheelchairAccessibleCarSpaces()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters