Removes the false "Non-closed rail sequence in a circular route" warning for routes with a lollypop shape.
I think it's good to do a test run before merging, just to be sure.
Signed-off-by: Bovi887 bovi887@noreply.codeberg.org
Bovi887/subways:remove-false-non-closed-circular-line-warning into master Removes the false "Non-closed rail sequence in a circular route" warning for routes with a lollypop shape.
I think it's good to do a test run before merging, just to be sure.
Signed-off-by: Bovi887 bovi887@noreply.codeberg.org
Signed-off-by: Bovi887 <bovi887@noreply.codeberg.org>
Test run results: https://mapgen-fi-1.comaps.app/subway/validator/index.html
https://codeberg.org/comaps/comaps/actions/runs/16317/jobs/1/attempt/1
Please check if its as expected.
As expected! Thanks!
LGTM
check my question, not sure if it matters much
@ -601,1 +600,3 @@
)
# Detect if route is circular or lollypop
if self.stops[0].stoparea == self.stops[-1].stoparea:
if self.stops[1].stoparea == self.stops[-2].stoparea:
if there are only two elements then its going to be treated as a lollypop?
Good catch, I think it wouldn't, because it would try to match the first with the second and the second with the first. I think I need to add a check though to assure there is two stops in the route. Right now it checks for one, so it could crash on that. Looking into it.
Increased the check to 2
it would try to match the first with the second and the second with the first
which is the same if there are two elements only, but in this case its strange to have them equal and its probably a mapping error?
Right now it checks for one, so it could crash on that.
actually the current check is for 2 elems min (>1), your change makes it 3 min
for a 3-elems case (when first and last match) this check would result in lollypop
actually the current check is for 2 elems min (>1), your change makes it 3 min
Whoops, my mistake, i've changed it back.
for a 3-elems case (when first and last match) this check would result in lollypop
Good point, i'll need to think about how to solve that. I'll mark it as WIP until I have a solution for this.
which is the same if there are two elements only, but in this case its strange to have them equal and its probably a mapping error?
Do you mean 2 times the same station?
yeap two times the same station
Would it be as simple as to add a minimum amount of 5 stops for a lollypop (A-B-C-B-A)? That would also cover the case of two times the same stations. Routes with less than 5 stops with a matching start and end station would be treated as circular, like is the case now. For what I can think of a 4-station lollypop (A-B-B-A) loop should be impossible, if these exist it would be a tagging mistake I think.
please add a comment that lollypop is e.g. A-B-C-B-A, its not immediately clear what it is :)
Done!
36a9a3c5ac
to 907bd34581
907bd34581
to 4d51d568e9
4d51d568e9
to 748a08dacb
LGTM!
748a08dacb
to d866144602
No due date set.
No dependencies set.
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?