diff --git a/OpenRoadEd/OpenDrive/OpenDriveXmlParser.cpp b/OpenRoadEd/OpenDrive/OpenDriveXmlParser.cpp index 1a97bcc1a84de69375b45f96b7dca1aa74d857e1..481f08d033d5b38d1273fc5ce0351de368550a2d 100644 --- a/OpenRoadEd/OpenDrive/OpenDriveXmlParser.cpp +++ b/OpenRoadEd/OpenDrive/OpenDriveXmlParser.cpp @@ -182,13 +182,12 @@ bool OpenDriveXmlParser::ReadRoadLink (Road* road, TiXmlElement *node, short in { string elementType; string elementId; - string contactPoint="NA"; + string contactPoint; int checker=TIXML_SUCCESS; checker+=node->QueryStringAttribute("elementType",&elementType); checker+=node->QueryStringAttribute("elementId",&elementId); - if (elementType.compare("road")==0) - checker+=node->QueryStringAttribute("contactPoint",&contactPoint); + checker+=node->QueryStringAttribute("contactPoint",&contactPoint); if (checker!=TIXML_SUCCESS) { @@ -203,13 +202,12 @@ bool OpenDriveXmlParser::ReadRoadLink (Road* road, TiXmlElement *node, short in { string elementType; string elementId; - string contactPoint="NA"; + string contactPoint; int checker=TIXML_SUCCESS; checker+=node->QueryStringAttribute("elementType",&elementType); checker+=node->QueryStringAttribute("elementId",&elementId); - if (elementType.compare("road")==0) - checker+=node->QueryStringAttribute("contactPoint",&contactPoint); + checker+=node->QueryStringAttribute("contactPoint",&contactPoint); if (checker!=TIXML_SUCCESS) { diff --git a/Samples/iri_test.xodr b/Samples/iri_test.xodr index 2e6966a38b6e767610e2d293281640e70322968a..0b8cb104bd2adfc416e061648c8eaefd153d61c3 100644 --- a/Samples/iri_test.xodr +++ b/Samples/iri_test.xodr @@ -4,7 +4,7 @@ <road name="road0" length="2.5000000000000000e+01" id="0" junction="-1"> <link> <predecessor elementType="road" elementId="9" contactPoint="end" /> - <successor elementType="junction" elementId="1" contactPoint="NA" /> + <successor elementType="junction" elementId="1" contactPoint="end" /> </link> <type s="0.0000000000000000e+00" type="town" /> <planView> @@ -44,7 +44,7 @@ </road> <road name="road1" length="2.5000000000000000e+01" id="1" junction="-1"> <link> - <predecessor elementType="junction" elementId="1" contactPoint="NA" /> + <predecessor elementType="junction" elementId="1" contactPoint="end" /> <successor elementType="road" elementId="2" contactPoint="start" /> </link> <type s="0.0000000000000000e+00" type="town" /> @@ -221,7 +221,7 @@ <road name="road5" length="2.5000000000000000e+01" id="5" junction="-1"> <link> <predecessor elementType="road" elementId="4" contactPoint="end" /> - <successor elementType="junction" elementId="2" contactPoint="NA" /> + <successor elementType="junction" elementId="2" contactPoint="end" /> </link> <type s="0.0000000000000000e+00" type="town" /> <planView> @@ -261,10 +261,10 @@ </road> <road name="road6" length="2.5000000000000000e+01" id="6" junction="-1"> <link> - <predecessor elementType="junction" elementId="2" contactPoint="NA" /> + <predecessor elementType="junction" elementId="2" contactPoint="end" /> <successor elementType="road" elementId="7" contactPoint="start" /> </link> - <type s="0.0000000000000000e+00" type="Default" /> + <type s="0.0000000000000000e+00" type="town" /> <planView> <geometry s="0.0000000000000000e+00" x="2.5000000000000000e+01" y="8.0000000000000000e+01" hdg="3.1415926540000001e+00" length="2.5000000000000000e+01"> <line /> @@ -352,7 +352,7 @@ <predecessor elementType="road" elementId="7" contactPoint="end" /> <successor elementType="road" elementId="9" contactPoint="start" /> </link> - <type s="0.0000000000000000e+00" type="Default" /> + <type s="0.0000000000000000e+00" type="town" /> <planView> <geometry s="0.0000000000000000e+00" x="-1.0000000000000000e+01" y="7.0000000000000000e+01" hdg="4.7123889800000001e+00" length="6.0000000000000000e+01"> <line /> @@ -437,8 +437,8 @@ </road> <road name="road10" length="6.0000000000000000e+01" id="10" junction="-1"> <link> - <predecessor elementType="junction" elementId="1" contactPoint="NA" /> - <successor elementType="junction" elementId="2" contactPoint="NA" /> + <predecessor elementType="junction" elementId="1" contactPoint="end" /> + <successor elementType="junction" elementId="2" contactPoint="end" /> </link> <type s="0.0000000000000000e+00" type="town" /> <planView> @@ -478,7 +478,7 @@ </road> <road name="road11" length="5.0000000000000000e+01" id="11" junction="-1"> <link> - <predecessor elementType="junction" elementId="1" contactPoint="NA" /> + <predecessor elementType="junction" elementId="1" contactPoint="end" /> </link> <type s="0.0000000000000000e+00" type="town" /> <planView> @@ -518,9 +518,9 @@ </road> <road name="road12" length="2.0000000000000000e+01" id="12" junction="-1"> <link> - <predecessor elementType="junction" elementId="1" contactPoint="NA" /> + <predecessor elementType="junction" elementId="1" contactPoint="end" /> </link> - <type s="0.0000000000000000e+00" type="Default" /> + <type s="0.0000000000000000e+00" type="town" /> <planView> <geometry s="0.0000000000000000e+00" x="4.5000000000000000e+01" y="1.0000000000000000e+01" hdg="7.8539800000000004e-01" length="2.0000000000000000e+01"> <line />