Skip to content

Commit

Permalink
Merge pull request #6093 from HSLdevcom/slope-overrides
Browse files Browse the repository at this point in the history
Don't use elevation data directly for ways with cutting=*, location=underground or indoor=yes tags in the default mapper
  • Loading branch information
optionsome authored Oct 3, 2024
2 parents d8d6f85 + 9da25b1 commit 02f6535
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
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

0 comments on commit 02f6535

Please sign in to comment.