Commit 3212e04e authored by Sebastian Hörl's avatar Sebastian Hörl
Browse files

add road types for analysis

parent 8ef60292
......@@ -2,9 +2,12 @@ package ch.ethz.matsim.projects.astra_2018_002.analysis.flow;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.List;
import java.util.Set;
import org.matsim.api.core.v01.Scenario;
import org.matsim.api.core.v01.network.Link;
......@@ -49,12 +52,12 @@ public class RunFlowAnalysis {
double interval = 3600.0;
List<Link> links = new LinkedList<>();
Set<String> types = new HashSet<>(Arrays.asList("motorway", "trunk", "primary", "secondary"));
for (Link link : scenario.getNetwork().getLinks().values()) {
String osmType = (String) link.getAttributes().getAttribute("osm:way:highway");
if (osmType != null
&& (osmType.equals("primary") || osmType.equals("secondary") || osmType.equals("tertiary"))) {
if (osmType != null && types.contains(osmType)) {
links.add(link);
}
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment