Skip to content

Commit

Permalink
OSM roadtype mapping can handle "highway" prefix now
Browse files Browse the repository at this point in the history
  • Loading branch information
simei94 committed Sep 4, 2024
1 parent fe570f1 commit 675f45f
Showing 1 changed file with 0 additions and 8 deletions.
8 changes: 0 additions & 8 deletions src/main/java/org/matsim/run/prepare/PrepareNetwork.java
Original file line number Diff line number Diff line change
Expand Up @@ -82,14 +82,6 @@ public static void prepareFreightNetwork(Network network) {
public static void prepareEmissionsAttributes(Network network) {
// do not use VspHbefaRoadTypeMapping() as it results in almost every road to mapped to "highway"!
HbefaRoadTypeMapping roadTypeMapping = OsmHbefaMapping.build();
// the type attribute in our network has the prefix "highway" for all links but pt links.
// we need to delete that because OsmHbefaMapping does not handle that.
for (Link link : network.getLinks().values()) {
//pt links can be disregarded
if (!link.getAllowedModes().contains("pt")) {
NetworkUtils.setType(link, NetworkUtils.getType(link).replaceFirst("highway.", ""));
}
}
roadTypeMapping.addHbefaMappings(network);
}
}

0 comments on commit 675f45f

Please sign in to comment.