Hi Arslan,
Marcus' proposals are all perfectly fine, but since you asked for
sumolib functionality I want to direct your attention to the
getNeighboringEdges and getNeighboringLanes functions of the network
http://www.sumo.dlr.de/pydoc/sumolib.net.html#Net. Both take a point in
the plane and a radius and deliver all edges / lanes in the radius
(together with the distance) which you can compare with the route then.
There is no TraCI involved and be aware that you should have installed
the python rtree package when using the methods with large networks.

Best regards,
Michael

Am 30.03.2016 um 14:29 schrieb Marcus Müller:
> Hi Arslan,
> 
> again it seems like there must be a more elegant way, but you could get a 
> list of junctions (junction.getIDList) and compare it against the vehicles 
> route to find out, which of them are part of the route.
> 
> I don't exactly know, how the position of the junction is defined - whether 
> it is equivalent with the center of the junction you are looking for - if 
> not, you might use the shape points of the junction to calculate the center 
> yourself. But probably the position is alread what you are looking for.
> 
> Another thing you could be interested in is contextSubscription
> Traci.vehicle.subscribeContext()
> Herewith you can receive all edges e.g. which are in a specified radius 
> around your car.
> 
> Regards,
> Marcus
> 
> 
> 
>> Am 30.03.2016 um 14:05 schrieb Arslane Hamza Cherif <[email protected]>:
>>
>> Thanks for the quick reply,
>>
>> Since, i am looking for a solution to compute the closest point on route 
>> between the current vehicle route and a fixed RSU positionned in the middle 
>> of a junction. Is not easier to select junctions traversed by the vehicle, 
>> than compute distance calculation for these junctions ? 
>>
>> I know that i cannot retrieve junctions (nodes) traversed by the vehicle 
>> with the use of TraCI, but maybe it is possible with the use of Sumolib ?
>>
>> Best regards,
>> Arslan
>>
>> Arslane, un mec sympa et drole qui vous veut du bien !
>>
>> Citation favorite : " Qui aime bien chatîe bien" 
>>
>> 2016-03-30 13:59 GMT+02:00 Marcus Müller <[email protected]>:
>>> Hello Arslan,
>>>
>>> I am not aware of such a TraCI functionality (there might be one), but what 
>>> you definitively can do, is get a vehicles route, and afterwards, use some 
>>> minimization to find the point which minimzes the distance = 
>>> sqrt((x_route-x_point)^2 + (y_route-y_point)^2)
>>>
>>> As a route consists of edges, you'll have to get the points for the edges 
>>> which belong to the route.
>>>
>>> 1) getRoute for specific vehicle
>>> 2) getLaneIndex for vehicle
>>> 3) getShape for edge,laneIndex
>>>
>>> Loop 3 over all edges of route
>>>
>>> But be aware, that the vehicle might drive on different lanes due to 
>>> dynamic events during the simulation. If you want to be sure, the vehicle 
>>> is driving the route you have received you might need to change the so 
>>> called "lanechangemode" where you can force the vehicle to stay on its lane.
>>>
>>>
>>> As I said there might be a faster solution I don't know - but if not, I 
>>> hope this helps.
>>>
>>> Best regards,
>>> Marcus
>>>
>>>
>>>
>>>> Am 30.03.2016 um 11:26 schrieb Arslane Hamza Cherif 
>>>> <[email protected]>:
>>>>
>>>> Hello,
>>>>
>>>> I want to calculate the closest point between a given route that is related
>>>> to a single Vehicle and a fixed point (with given coordinates) under SUMO &
>>>> TraCI.
>>>>
>>>> How can i achieve this ? is there a specific TraCI command to use ?
>>>>
>>>> Many thanks,
>>>>
>>>> Best regards,
>>>> Arslan
>>>> ------------------------------------------------------------------------------
>>>> Transform Data into Opportunity.
>>>> Accelerate data analysis in your applications with
>>>> Intel Data Analytics Acceleration Library.
>>>> Click to learn more.
>>>> http://pubads.g.doubleclick.net/gampad/clk?id=278785471&iu=/4140
>>>> _______________________________________________
>>>> sumo-user mailing list
>>>> [email protected]
>>>> https://lists.sourceforge.net/lists/listinfo/sumo-user
>>
> ------------------------------------------------------------------------------
> Transform Data into Opportunity.
> Accelerate data analysis in your applications with
> Intel Data Analytics Acceleration Library.
> Click to learn more.
> http://pubads.g.doubleclick.net/gampad/clk?id=278785471&iu=/4140
> _______________________________________________
> sumo-user mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/sumo-user
> 


------------------------------------------------------------------------------
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785471&iu=/4140
_______________________________________________
sumo-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sumo-user

Reply via email to