Skip to content

Commit

Permalink
only enable pedestrian indoor routing in the UK
Browse files Browse the repository at this point in the history
  • Loading branch information
miklcct committed Oct 24, 2024
1 parent 5cc750a commit 0d826d7
Show file tree
Hide file tree
Showing 8 changed files with 34 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,6 @@ public void populateProperties(WayPropertySet props) {
props.setProperties("public_transport=platform", pedestrianWayProperties);
props.setProperties("railway=platform", pedestrianWayProperties);
props.setProperties("footway=sidewalk;highway=footway", pedestrianWayProperties);
props.setProperties("indoor=area", pedestrianWayProperties);
props.setProperties("indoor=corridor", pedestrianWayProperties);
props.setProperties("mtb:scale=1", pedestrianWayProperties);
props.setProperties("mtb:scale=2", pedestrianWayProperties);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@

import static org.opentripplanner.osm.wayproperty.WayPropertiesBuilder.withModes;
import static org.opentripplanner.street.model.StreetTraversalPermission.ALL;
import static org.opentripplanner.street.model.StreetTraversalPermission.PEDESTRIAN;

import org.opentripplanner.osm.wayproperty.WayProperties;
import org.opentripplanner.osm.wayproperty.WayPropertySet;

/**
Expand Down Expand Up @@ -73,6 +75,10 @@ public void populateProperties(WayPropertySet props) {
props.setCarSpeed("highway=secondary_link", 13.4f); // ~= 30mph
props.setCarSpeed("highway=tertiary", 15.7f); // ~= 35mph

WayProperties pedestrianWayProperties = withModes(PEDESTRIAN).build();
props.setProperties("indoor=area", pedestrianWayProperties);
props.setProperties("indoor=corridor", pedestrianWayProperties);

// Read the rest from the default set
new DefaultMapper().populateProperties(props);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,14 +122,6 @@ void stairs() {
assertEquals(PEDESTRIAN, props.getPermission());
}

@Test
void indoor() {
var corridor = wps.getDataForWay(WayTestData.indoor("corridor"));
assertEquals(PEDESTRIAN, corridor.getPermission());
var area = wps.getDataForWay(WayTestData.indoor("area"));
assertEquals(PEDESTRIAN, area.getPermission());
}

@Test
void footDiscouraged() {
var regular = WayTestData.pedestrianTunnel();
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package org.opentripplanner.osm.tagmapping;

import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.opentripplanner.street.model.StreetTraversalPermission.PEDESTRIAN;

import org.junit.jupiter.api.Test;
import org.opentripplanner.osm.wayproperty.WayPropertySet;
import org.opentripplanner.osm.wayproperty.specifier.WayTestData;

public class UKMapperTest {

static WayPropertySet wps = new WayPropertySet();

static {
var source = new UKMapper();
source.populateProperties(wps);
}

@Test
void indoor() {
var corridor = wps.getDataForWay(WayTestData.indoor("corridor"));
assertEquals(PEDESTRIAN, corridor.getPermission());
var area = wps.getDataForWay(WayTestData.indoor("area"));
assertEquals(PEDESTRIAN, area.getPermission());
}
}
2 changes: 0 additions & 2 deletions doc/user/osm/Default.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,6 @@ Lower safety values make an OSM way more desirable and higher values less desira
| `public_transport=platform` | `PEDESTRIAN` | | |
| `railway=platform` | `PEDESTRIAN` | | |
| `footway=sidewalk; highway=footway` | `PEDESTRIAN` | | |
| `indoor=area` | `PEDESTRIAN` | | |
| `indoor=corridor` | `PEDESTRIAN` | | |
| `mtb:scale=1` | `PEDESTRIAN` | | |
| `mtb:scale=2` | `PEDESTRIAN` | | |
| `mtb:scale=0` | `PEDESTRIAN_AND_BICYCLE` | | |
Expand Down
2 changes: 0 additions & 2 deletions doc/user/osm/Finland.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,6 @@ Lower safety values make an OSM way more desirable and higher values less desira
| `public_transport=platform` | `PEDESTRIAN` | | |
| `railway=platform` | `PEDESTRIAN` | | |
| `footway=sidewalk; highway=footway` | `PEDESTRIAN` | | |
| `indoor=area` | `PEDESTRIAN` | | |
| `indoor=corridor` | `PEDESTRIAN` | | |
| `mtb:scale=1` | `PEDESTRIAN` | | |
| `mtb:scale=2` | `PEDESTRIAN` | | |
| `mtb:scale=0` | `PEDESTRIAN_AND_BICYCLE` | | |
Expand Down
2 changes: 0 additions & 2 deletions doc/user/osm/Germany.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,6 @@ Lower safety values make an OSM way more desirable and higher values less desira
| `public_transport=platform` | `PEDESTRIAN` | | |
| `railway=platform` | `PEDESTRIAN` | | |
| `footway=sidewalk; highway=footway` | `PEDESTRIAN` | | |
| `indoor=area` | `PEDESTRIAN` | | |
| `indoor=corridor` | `PEDESTRIAN` | | |
| `mtb:scale=1` | `PEDESTRIAN` | | |
| `mtb:scale=2` | `PEDESTRIAN` | | |
| `mtb:scale=0` | `PEDESTRIAN_AND_BICYCLE` | | |
Expand Down
4 changes: 2 additions & 2 deletions doc/user/osm/UK.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ Lower safety values make an OSM way more desirable and higher values less desira
| `highway=trunk_link; cycleway=opposite_track` | `ALL` | forward: 2.06 <br> back: 0.85 | |
| `highway=trunk; bicycle=designated` | `ALL` | 7.25 | |
| `highway=trunk_link; bicycle=designated` | `ALL` | 2.0 | |
| `indoor=area` | `PEDESTRIAN` | | |
| `indoor=corridor` | `PEDESTRIAN` | | |
| `mtb:scale=3` | `NONE` | | |
| `mtb:scale=4` | `NONE` | | |
| `mtb:scale=5` | `NONE` | | |
Expand All @@ -49,8 +51,6 @@ Lower safety values make an OSM way more desirable and higher values less desira
| `public_transport=platform` | `PEDESTRIAN` | | |
| `railway=platform` | `PEDESTRIAN` | | |
| `footway=sidewalk; highway=footway` | `PEDESTRIAN` | | |
| `indoor=area` | `PEDESTRIAN` | | |
| `indoor=corridor` | `PEDESTRIAN` | | |
| `mtb:scale=1` | `PEDESTRIAN` | | |
| `mtb:scale=2` | `PEDESTRIAN` | | |
| `mtb:scale=0` | `PEDESTRIAN_AND_BICYCLE` | | |
Expand Down

0 comments on commit 0d826d7

Please sign in to comment.