Home > Software engineering >  Can anyone tell me how to get the geo-coordinates of lanes also?
Can anyone tell me how to get the geo-coordinates of lanes also?

Time:10-08

I have a file osm.net.xml, which is taken from a real map. The file includes shape (X/Y coordinates) for both the edges and lanes. I ran below command to convert/create the files to include geo-coordinates:

netconvert --sumo-net-file osm.net.xml --plain-output-prefix plain --proj.plain-geo

The input file is as follows (it includes x/y coordinates for both the edges and lanes):

enter image description here

I get the output files as:

enter image description here

I don't see any output-file containing the geo-coordinates for lanes. In the plain.edg.xml, there is only shape information for the edges but not for the lanes:

enter image description here

Can anyone tell me how to get the geo-coordinates of lanes also???

CodePudding user response:

It is currently not possible to do this. You could only try to parse the network with a python script and do the geo conversion yourself, see the examples here: https://sumo.dlr.de/docs/Tools/Sumolib.html#import_a_network_and_retrieve_nodes_and_edges It will probably boil down to something like:

import sumolib
net = sumolib.net.readNet('myNet.net.xml')
laneShape = net.getLane('myLaneID').getShape()
for x, y in laneShape:
    lon, lat = net.convertXY2LonLat(x,y)
  • Related