Skip to content

Commit eb812b3

Browse files
committed
handle vriable default in .net.xml (when using option --direct), ensuring consistent defaults when converting to plain. refs #16951
1 parent 51f5a18 commit eb812b3

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

tools/net/netdiff.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -353,9 +353,10 @@ def diff(self, tag, name, sourceValue, destValue):
353353
(tag == TAG_EDGE and name == "type")):
354354
return None
355355
elif destValue is None:
356-
return DEFAULT_VALUES[name]
357-
else:
358-
return destValue
356+
destValue = DEFAULT_VALUES[name]
357+
if sourceValue == destValue:
358+
return None
359+
return destValue
359360

360361
def hasChangedConnection(self, tagid, attrs):
361362
tag, id = tagid
@@ -558,6 +559,7 @@ def create_plain(netfile, netconvert, plain_geo):
558559
call([netconvert,
559560
"--sumo-net-file", netfile,
560561
"--plain-output-prefix", prefix,
562+
"--default.spreadtype", "right", # overwrite value in net
561563
"--roundabouts.guess", "false"]
562564
+ (["--proj.plain-geo"] if plain_geo else []))
563565
return prefix
@@ -650,6 +652,9 @@ def handle_children(xmlfile, handle_parsenode):
650652
schema = "tllogic_file.xsd"
651653
if parsenode.hasAttribute("version"):
652654
version = ' version="%s"' % parsenode.getAttribute("version")
655+
if parsenode.hasAttribute("spreadType"):
656+
DEFAULT_VALUES["spreadType"] = parsenode.getAttribute("spreadType")
657+
version = ' version="%s"' % parsenode.getAttribute("version")
653658
if root not in ("edges", "nodes", "connections", "tlLogics"):
654659
# do not write schema information
655660
version = None

0 commit comments

Comments
 (0)