Thanks Jakob – that sumolib geomhelper is exactly what I’ve been looking for!
From: <sumo-user-bounces@xxxxxxxxxxx> on behalf of Jakob Erdmann <namdre.sumo@xxxxxxxxx>
Reply-To: Sumo project User discussions <sumo-user@xxxxxxxxxxx>
Date: Tuesday, July 2, 2019 at 2:22 AM
To: Sumo project User discussions <sumo-user@xxxxxxxxxxx>
Subject: Re: [sumo-user] Convert lane-id and position to xy/UTM/WGS84?
You can also use sumolib in the following way:
x,y = sumolib.geomhelper.positionAtShapeOffset(net.getLane(laneID).getShape(), lanePos)
- the code currently works for flat networks only
- In rare cases, the logical length of the lane may differ from its geometrical length. In this case you would have to use lanePos * sumolib.polyLength(shape) / lane.getLenght()
whats the problem with traci?
Just start a dummy simulation with sumo, using the network you have used to create your files.
Let the simulation start (just one step). At this point traci knows your lanes and the mapping.
Add some code to process your existing files.
Look at the test case tests/complex/traci/pythonApi/simulation (you have to download the tests) and here particularly into
print("convertRoadGeo", traci.simulation.convert2D("o", 0., toGeo=True))
is the function you are looking for.
Am 01.07.19 um 03:32 schrieb Queen, Melissa:
Hey Harald,
I have found those resources but sumolib code only translates from x-y coordinates, and the traci code looks to be intended for a currently-running simulation, not for processing
an existing output file. The logic to convert lane and position to a coordinate system obviously must exist somewhere in the sumo system, but I haven’t been able to find it nor a way to access it.
-Melissa
So you can use either traci or sumolib.
Am 28.06.19 um 19:35 schrieb Queen, Melissa:
Hello all!
I am building a visualization using Sumo output data such as stop-output. This output includes information about what a vehicle is doing at a particular position (in this case it’s
the amount of time stopped). However, this position is described in terms of a lane ID and a position (distance along that lane). Instead of lane ID and position I would like the coordinates in terms of xy, UTM, or WGS84 (I am comfortable converting between
all of those). This conversion will depend on the network file of course, because that is where the lane positions (in xy coordinates) are described.
My main question is: Does such a conversion exist in the community already? If I craft a conversion myself is it something that would be useful to others and should be contributed
to the open source libraries? Or am I chasing a weird niche conversion?
Thanks,
-Melissa
_______________________________________________
sumo-user mailing list
sumo-user@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://www.eclipse.org/mailman/listinfo/sumo-user
_______________________________________________
sumo-user mailing list
sumo-user@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://www.eclipse.org/mailman/listinfo/sumo-user
_______________________________________________
sumo-user mailing list
sumo-user@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://www.eclipse.org/mailman/listinfo/sumo-user
|