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

Don't use elevation data directly for ways with cutting=*, location=underground or indoor=yes tags in the default mapper #6093

Merged
merged 1 commit into from
Oct 3, 2024
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 @@ -613,7 +613,10 @@ public void populateProperties(WayPropertySet props) {
// slope overrides
props.setSlopeOverride(new BestMatchSpecifier("bridge=*"), true);
props.setSlopeOverride(new BestMatchSpecifier("embankment=*"), true);
props.setSlopeOverride(new BestMatchSpecifier("cutting=*"), true);
props.setSlopeOverride(new BestMatchSpecifier("tunnel=*"), true);
props.setSlopeOverride(new BestMatchSpecifier("location=underground"), true);
props.setSlopeOverride(new BestMatchSpecifier("indoor=yes"), true);
}

public void populateNotesAndNames(WayPropertySet props) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package org.opentripplanner.openstreetmap.tagmapping;

import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertTrue;
import static org.opentripplanner.street.model.StreetTraversalPermission.ALL;
import static org.opentripplanner.street.model.StreetTraversalPermission.PEDESTRIAN;
Expand Down Expand Up @@ -189,6 +190,15 @@ void bicycleUseSidepath() {
assertEquals(4.9, useSidepathBackwardProps.bicycleSafety().back(), epsilon);
}

@Test
void slopeOverrides() {
var regular = WayTestData.southeastLaBonitaWay();
assertFalse(wps.getSlopeOverride(regular));

var indoor = WayTestData.southeastLaBonitaWay().addTag("indoor", "yes");
assertTrue(wps.getSlopeOverride(indoor));
}

/**
* Test that two values are within epsilon of each other.
*/
Expand Down
Loading