sumo icon indicating copy to clipboard operation
sumo copied to clipboard

About the permission of the sidewalk at the intersection

Open xql5891129 opened this issue 1 year ago • 0 comments

Add your issue description here. I wrote a script to generate a sidewalk for each road in my road network file. But after running, it was found that these sidewalks have all the permissions to go straight, turn left, and turn right at intersections. This results in the motorway of the car can not go straight, right, left turn permission. I would like to know what caused this, thank you very much

If possible, upload an example that shows your problem. image

Here's my python script.

import xml.etree.ElementTree as ET # Load the network file tree = ET.parse('input.net.xml') root = tree.getroot() Add sidewalks to each road for edge in root.findall('edge'): lanes = edge.findall('lane') if lanes: Get the length, speed, and shape of the last lane last_lane = lanes[-1] length = last_lane.get('length') shape = last_lane.get('shape') ** Add a sidewalk** sidewalk = ET.SubElement(edge, 'lane') sidewalk.set('id', edge.get('id') + '_sidewalk') sidewalk.set('index', str(len(lanes))) # Index of the sidewalk sidewalk.set('speed', '1.39') # Speed of the sidewalk (about 5 km/h) sidewalk.set('length', length) sidewalk.set('width', '2.0') # Width of the sidewalk sidewalk.set('allow', 'pedestrian') # Only allow pedestrians if shape is not None: sidewalk.set('shape', shape) # Set the shape of the sidewalk ** Save the modified network file** tree.write('output_with_sidewalks.net.xml', encoding='UTF-8', xml_declaration=True) print("Sidewalks added to the network file.")

SUMO-version: 1.20 operating system: windows11

xql5891129 avatar Jun 29 '24 15:06 xql5891129