-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Fix parsing of wheelchair accessible parking, add wheelchair debug layer #6229
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
Merged
leonardehrenfried
merged 8 commits into
opentripplanner:dev-2.x
from
ibi-group:wheelchair-debug
Nov 12, 2024
Merged
Changes from 5 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
d956df6
Fix parsing of parking capcity for wheelchair users
leonardehrenfried 8068b01
Remove no-op
leonardehrenfried 5cbc9d3
Add test for parking processor
leonardehrenfried 642ae33
Update documentation
leonardehrenfried 79221b6
Add no-op for parsing
leonardehrenfried 18e2d37
Merge remote-tracking branch 'upstream/dev-2.x' into wheelchair-debug
leonardehrenfried a1289a6
Remove unused method
leonardehrenfried 9812c5b
Remove duplicate permissions layer definition
leonardehrenfried File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@testower This is here so that booleans correctly show up in the frontend.