Skip to main content

read_network

Function read_network 

Source
pub fn read_network(path: &Path) -> Result<Network>
Expand description

Reads and deserializes the .net.xml file at path into a Network.

let network = sumo_types::read_network(std::path::Path::new("city.net.xml"))?;
println!("{} edges", network.edges.len());

§Errors

Returns an error if path can’t be opened, if the document isn’t well-formed XML rooted at <net>, or if any of its attributes can’t be interpreted (a malformed position, a boundary without 4 components, a non-finite coordinate, …).