Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [sumo-user] Measuring Distances

Solution 1:  using TraCI
- convert all coordinates to road/edge: https://sumo.dlr.de/docs/TraCI/Simulation_Value_Retrieval.html#command_0x82_position_conversion
- traci.simulation.getDistanceRoad

Solution 2: using sumolib:
- https://sumo.dlr.de/docs/Tools/Sumolib.html#coordinate_transformations
- sumolib.net.getShortestPath / getFastestPath

Solution 3: using duarouter:
- encode the distance you want to measure as trips (edges and coordinates are supported)
- set the trip to a vType with maxSpeed=1
- read the results from the .rou.alt.xml output file (costs equal distance in m)

Am Mo., 18. Nov. 2024 um 03:45 Uhr schrieb Rohan Verma via sumo-user <sumo-user@xxxxxxxxxxx>:
Dear community,

I have a few destinations in my road network. Some destinations are created as polygons alongside edges, while others are marked on the road edges. I plan on calculating the distance (by road) between these destinations. I could calculate them using the coordinates, but that would give Euclidean distance, not the distance on the road. Since there are multiple destinations, I am not willing to manually do this.
Is there a way to compute these distances? I would greatly appreciate any help.

Thanks and Regards,
Rohan
_______________________________________________
sumo-user mailing list
sumo-user@xxxxxxxxxxx
To unsubscribe from this list, visit https://www.eclipse.org/mailman/listinfo/sumo-user

Back to the top