Skip to content

Commit

Permalink
Merge pull request #6505 from Brickblock1/dev-2.x
Browse files Browse the repository at this point in the history
Add highway=platform to IsBoardingLocation()
  • Loading branch information
leonardehrenfried authored Mar 3, 2025
2 parents 3fd3fba + 485c4e5 commit e0b1758
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -579,6 +579,7 @@ public boolean isBoardingLocation() {
isTag("railway", "halt") ||
isTag("amenity", "bus_station") ||
isTag("amenity", "ferry_terminal") ||
isTag("highway", "platform") ||
isPlatform()
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,4 +66,28 @@ void skipPlatformsWithoutReferences() {
var platform = osmInfoRepository.findPlatform(edges.getFirst());
assertTrue(platform.isEmpty());
}

@Test
void testHighwayPlatform() {
var way = new OsmWay();
way.addTag("highway", "platform");
way.addTag("ref", "1");
var provider = TestOsmProvider.of().addWay(way).build();

var graph = new Graph(new Deduplicator());
var osmInfoRepository = new DefaultOsmInfoGraphBuildRepository();
var osmModule = OsmModule
.of(provider, graph, osmInfoRepository, new DefaultVehicleParkingRepository())
.withBoardingAreaRefTags(Set.of("ref"))
.build();

osmModule.buildGraph();
var edges = List.copyOf(graph.getEdges());
assertThat(edges).hasSize(2);

var platform = osmInfoRepository.findPlatform(edges.getFirst());

assertTrue(platform.isPresent());
assertEquals(Set.of("1"), platform.get().references());
}
}
2 changes: 2 additions & 0 deletions doc/user/BoardingLocations.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ You can add cross-references to a stop's id or code on all OSM entities (nodes,
have one of the following tag combinations:

- `public_transport=platform`
- `railway=platform`
- `highway=platform`
- `highway=bus_stop`
- `railway=tram_stop`
- `railway=station`
Expand Down

0 comments on commit e0b1758

Please sign in to comment.