Skip to content

Commit 655bf2a

Browse files
committed
Static bike-rental: handle stations w/o networks.
Make bike-rental stations with no network/operators defined compatible with all other by default.
1 parent a3fdf36 commit 655bf2a

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

opentripplanner-graph-builder/src/main/java/org/opentripplanner/graph_builder/impl/osm/OpenStreetMapGraphBuilderImpl.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -819,8 +819,8 @@ private void processBikeRentalNodes() {
819819
networkSet.addAll(Arrays.asList(operators.split(";")));
820820
if (networkSet.isEmpty()) {
821821
_log.warn("Bike rental station at osm node " + node.getId() + " ("
822-
+ creativeName + ") with no network; not including");
823-
continue;
822+
+ creativeName + ") with no network; including as compatible-with-all.");
823+
networkSet.add("*"); // Special "catch-all" value
824824
}
825825
BikeRentalStationVertex station = new BikeRentalStationVertex(graph, ""
826826
+ node.getId(), "bike rental " + node.getId(), node.getLon(),

opentripplanner-routing/src/main/java/org/opentripplanner/routing/edgetype/RentABikeAbstractEdge.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,10 @@ public boolean hasBogusName() {
124124
private boolean hasCompatibleNetworks(Set<String> stationNetworks, Set<String> rentedNetworks) {
125125
/*
126126
* Two stations are compatible if they share at least one network.
127+
* Special case for "*" networks (no network defined in OSM).
127128
*/
129+
if (stationNetworks.contains("*") || rentedNetworks.contains("*"))
130+
return true;
128131
return !Sets.intersection(stationNetworks, rentedNetworks).isEmpty();
129132
}
130133
}

0 commit comments

Comments
 (0)