|
From: Stefano N. <ste...@ho...> - 2018-07-05 15:48:33
|
Dear Sumo Community, I would like to ask how it is possible to retrieve the length of an edge through Python. Based on what I found here: http://sumo.dlr.de/wiki/Tools/Sumolib at the paragraph: "compute the average and median edge length in a plain xml edge file", I wrote the following code: for edge in sumolib.output.parse('myNet.net.xml', ['edge']): if edge.id == myedgeid: length = edge.length But this solution is not working as the script is able to find effectively edge.id but that, through debugging I found that edge.length is an empty veriable. I looked a little through the internet but I got a little bit confused about the answer I found. How can I retrieve the length of a particular edge? Thank you very much in advance Stefano Niero |