Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[sumo-user] Inquiry : Conversion from co-ordinate axis to Latitude and Longitude

Namaste,


I used the following api to convert from co-ordinate axis to geo co-ordinates.

-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Code:

position = traci.vehicle.getPosition(self.vehicleId)
pos_x = position[0] # cartesian X
pos_y = position[1] # cartesian Y
geo_co_ord = traci.simulation.convertGeo(pos_x, pos_y, fromGeo=False)

The geo co-ordinates which i receive are incorrect. I have checked by putting them in google maps.
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Outputs:

The cartesian co-ordinate  (50450.7527098387, 22602.868908196364)  => returned by getPosition(vehicleId)
The geo co-ordinate  (777805.9327098387, 1439436.2689081964) => returned by convertGeo(pos_x, pos_y)

------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
What is confirmed so far:

traci.simulation.convertGeo(pos_x, pos_y, fromGeo=False) is able to convert from cartesian to geo , and geo to cartesian correctly.
Have tested it with a valid geo co-ordinates.

------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

What is not clear:

position = traci.vehicle.getPosition(self.vehicleId)
The position returned by the getPosition() seems to be incorrect, or we might be wrongly interpreting it. 

------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Please let us know what might be wrong here.


Regards,
Sheshadri K R

+91-9845213149


Back to the top