Hello,
1) Yes. You can use sumolib.geomhelper.positionAtShapeOffset(shape. pos)
with the lane shape and the induction loop position to compute x,y
2) Yes. The length of the split is the length of the shortest "internal"
lane that connects edge_before_split with _edge_after_split (in your case
it would be lane index 2). Note, that you need to use
sumolib.readNet(filepath, withInternal=True) to load these. You can also
retrieve the internal lane id with traci.lane.getLinks and
traci.lane.getLength.
3) you can use traci.simulation.getDistanceRoad(edge_before_split,
inductionLoopPos, edge_after_split, length_of_edge_after_split, True)

regards,
Jakob

Am Fr., 20. März 2020 um 13:45 Uhr schrieb lourens <[email protected]>:

> Hi all,
>
> I would like to compute the distance from the induction loop at line x=59
> to
> the *stop-line* at line x =13.6.
> All is explained in the image below.
> I have a method to obtain the distance, but it might not be the most
> systematic / fool-proof way of computing it.
>
> *My current method*
> distance_to_stop_line = traci.lane.getLength(lane_id_after_split) -
> traci.inductionloop.getPosition('loop_id_at_x=43.6')
> This method seems to work fine.
> I do this for both loops at x=59 and x =43.6 and then sum these distances.
> But most importantly I need to add a hardcoded length of the lane-split.
> Only now I have the actual distance to the stop-line and the loop at x=59.
>
> *Using (x,y) points from the GUI*
> I saw some issues on the forum with respect to lane lengths which where
> modified in NETEDIT and  wrongly shown in the SUMO-GUI.
> Therefore, I only used geometry points (red dots in NETEDIT) and changed
> their (x,y) coordinates to set the desired length of lanes.
> I use SUMO V1_0_1.
> Is it fine to use the (x,y) coordinates as obtained in the SUMO-GUI and
> used
> in my image below ?
>
> *Possible solutions*
> 1. Can I get the (x,y) coordinates of the induction loops and stop-line ?
> So I can use Pythagoras' theorem to compute the distance between them.
>
> 2. Can I get the actual length of "lane_split" as shown in the figure
> below.
>
> 3. Is there a third option which I did not see ?
>
> Thanks in advance for any help,
>
> Lourens
>
> <
> http://sumo-user-mailing-list.90755.n8.nabble.com/file/t315/detector_distances_forum.png>
>
>
>
>
>
> --
> Sent from: http://sumo-user-mailing-list.90755.n8.nabble.com/
> _______________________________________________
> sumo-user mailing list
> [email protected]
> To unsubscribe from this list, visit
> https://www.eclipse.org/mailman/listinfo/sumo-user
>
_______________________________________________
sumo-user mailing list
[email protected]
To unsubscribe from this list, visit 
https://www.eclipse.org/mailman/listinfo/sumo-user

Reply via email to