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

Ignoring steps for the cycling network. #3589

Merged
merged 2 commits into from
Feb 5, 2025
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 @@ -26,8 +26,9 @@ public final class OsmBicycleReader extends SupersonicOsmNetworkReader {
private static final Set<String> bicycleNotAllowed = new HashSet<>(Arrays.asList(OsmTags.MOTORWAY, OsmTags.MOTORWAY_LINK,
OsmTags.TRUNK, OsmTags.TRUNK_LINK));
private static final Set<String> onlyBicycleAllowed = new HashSet<>(Arrays.asList(OsmTags.TRACK, OsmTags.CYCLEWAY, OsmTags.SERVICE,
OsmTags.FOOTWAY, OsmTags.PEDESTRIAN, OsmTags.PATH, OsmTags.STEPS));

// OsmTags.FOOTWAY, OsmTags.PEDESTRIAN, OsmTags.PATH, OsmTags.STEPS // Steps should only be allowed if there are ramps.
OsmTags.FOOTWAY, OsmTags.PEDESTRIAN, OsmTags.PATH, OsmTags.STEPS_RAMP, OsmTags.STEPS_RAMP_BICYCLE
));
private final SupersonicOsmNetworkReader.AfterLinkCreated afterLinkCreated;

public OsmBicycleReader(OsmNetworkParser parser,
Expand Down Expand Up @@ -136,7 +137,8 @@ public Builder() {
addOverridingLinkProperties(OsmTags.FOOTWAY, new LinkProperties(10, 1, 10 / 3.6, 600 * BIKE_PCU, false));
addOverridingLinkProperties(OsmTags.PEDESTRIAN, new LinkProperties(10, 1, 10 / 3.6, 600 * BIKE_PCU, false));
addOverridingLinkProperties(OsmTags.PATH, new LinkProperties(10, 1, 20 / 3.6, 600 * BIKE_PCU, false));
addOverridingLinkProperties(OsmTags.STEPS, new LinkProperties(11, 1, 1 / 3.6, 50 * BIKE_PCU, false));
addOverridingLinkProperties(OsmTags.STEPS_RAMP, new LinkProperties(11, 1, 1 / 3.6, 50 * BIKE_PCU, false));
addOverridingLinkProperties(OsmTags.STEPS_RAMP_BICYCLE, new LinkProperties(11, 1, 1 / 3.6, 50 * BIKE_PCU, false));
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ public class OsmTags {
public static final String FOOTWAY = "footway";
public static final String PEDESTRIAN = "pedestrian";
public static final String PATH = "path";
public static final String STEPS = "steps";
public static final String STEPS_RAMP = "ramp";
public static final String STEPS_RAMP_BICYCLE = "ramp:bicycle";

public static final String HIGHWAY = "highway";
public static final String MAXSPEED = "maxspeed";
Expand All @@ -42,7 +43,7 @@ public class OsmTags {
public static final String CROSSING = "crossing";
public static final String TYPE = "type";
public static final String RESTRICTION = "restriction";

public static final String RAILWAY = "railway";
public static final String RAIL = "rail";
public static final String NARROW_GAUGE = "narrow_gauge";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import org.junit.jupiter.api.extension.RegisterExtension;
import org.matsim.api.core.v01.network.Network;
import org.matsim.core.network.NetworkUtils;
import org.matsim.core.network.io.NetworkWriter;
import org.matsim.core.utils.geometry.CoordinateTransformation;
import org.matsim.core.utils.geometry.transformations.TransformationFactory;
import org.matsim.testcases.MatsimTestUtils;
Expand All @@ -28,7 +29,9 @@ void test_andorra() {
.build()
.read(inputFile);

Network expectedResult = NetworkUtils.readNetwork(Paths.get(matsimTestUtils.getInputDirectory()).resolve("expected-result.xml.gz").toString());
new NetworkWriter(network).write(matsimTestUtils.getOutputDirectory() + "andorra-output.xml.gz");
// Network expectedResult = NetworkUtils.readNetwork(Paths.get(matsimTestUtils.getInputDirectory()).resolve("expected-result-steps.xml.gz").toString());
Network expectedResult = NetworkUtils.readNetwork(Paths.get(matsimTestUtils.getInputDirectory()).resolve("expected-result-stepRamps.xml.gz").toString());

Utils.assertEquals(expectedResult, network);
}
Expand Down
Binary file not shown.
Loading