Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [sumo-user] Convert lane-id and position to xy/UTM/WGS84?

Also, you can use the TraCI-API without sockets: https://sumo.dlr.de/wiki/Libsumo

Am Di., 2. Juli 2019 um 10:20 Uhr schrieb Jakob Erdmann <namdre.sumo@xxxxxxxxx>:
You can also use sumolib in the following way:

x,y = sumolib.geomhelper.positionAtShapeOffset(net.getLane(laneID).getShape(), lanePos)

Caveat
- 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()

regards,
Jakob

Am Mo., 1. Juli 2019 um 09:23 Uhr schrieb Harald Schaefer <fechsaer@xxxxxxxxx>:
Hi Melissa

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
    runner.py
    output.complex

I think
    print("convertRoadGeo", traci.simulation.convert2D("o", 0., toGeo=True))
is the function you are looking for.

Best regards, Harald


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

 

From: <sumo-user-bounces@xxxxxxxxxxx> on behalf of Harald Schaefer <fechsaer@xxxxxxxxx>
Reply-To: Sumo project User discussions <sumo-user@xxxxxxxxxxx>
Date: Saturday, June 29, 2019 at 3:23 AM
To: "sumo-user@xxxxxxxxxxx" <sumo-user@xxxxxxxxxxx>
Subject: Re: [sumo-user] Convert lane-id and position to xy/UTM/WGS84?

 

Hi Melissa,

 

if you search the SUMO-Wiki (https://sumo.dlr.de/wiki) for Coordinates you find this page (https://sumo.dlr.de/wiki/Geo-Coordinates) with a chapter on coordinate transformations (https://sumo.dlr.de/wiki/Geo-Coordinates#Performing_coordinate-transformations).

 

So you can use either traci or sumolib.

 

Best Regards, Harald

 

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

Back to the top