1 package org.opentrafficsim.road.network.factory.opendrive;
2
3 import java.io.Serializable;
4 import java.util.NavigableMap;
5 import java.util.TreeMap;
6
7 import org.opentrafficsim.core.network.NetworkException;
8 import org.w3c.dom.Node;
9 import org.w3c.dom.NodeList;
10 import org.xml.sax.SAXException;
11
12
13
14
15
16
17
18
19
20
21
22 class ElevationProfileTag implements Serializable
23 {
24
25
26 private static final long serialVersionUID = 20150723L;
27
28
29 @SuppressWarnings("checkstyle:visibilitymodifier")
30 NavigableMap<Double, ElevationTag> elevationTags = new TreeMap<Double, ElevationTag>();
31
32
33
34
35
36
37
38
39
40 @SuppressWarnings("checkstyle:needbraces")
41 static void parseElevationProfile(final NodeList nodeList, final OpenDriveNetworkLaneParser parser, final RoadTag roadTag)
42 throws SAXException, NetworkException
43 {
44 ElevationProfileTag elevationProfileTag = new ElevationProfileTag();
45
46 for (Node node0 : XMLParser.getNodes(nodeList, "elevationProfile"))
47 for (Node node : XMLParser.getNodes(node0.getChildNodes(), "elevation"))
48 {
49 ElevationTag elevationTag = ElevationTag.parseElevation(node, parser);
50 elevationProfileTag.elevationTags.put(elevationTag.s.si, elevationTag);
51 }
52 roadTag.elevationProfileTag = elevationProfileTag;
53 }
54
55
56 @Override
57 public final String toString()
58 {
59 return "ElevationProfileTag [elevationTags=" + this.elevationTags + "]";
60 }
61 }