comaps/subways
17
7
Fork
You've already forked subways
6

Remove circular route warning for lollypop shaped routes. #61

Merged
pastk merged 1 commit from Bovi887/subways:remove-false-non-closed-circular-line-warning into master 2026年04月05日 19:18:30 +02:00
Member
Copy link

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

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>
Owner
Copy link
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.
Author
Member
Copy link

As expected! Thanks!

As expected! Thanks!
pastk approved these changes 2026年04月05日 14:24:38 +02:00
Dismissed
pastk left a comment
Copy link

LGTM
check my question, not sure if it matters much

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:
Owner
Copy link

if there are only two elements then its going to be treated as a lollypop?

if there are only two elements then its going to be treated as a lollypop?
Author
Member
Copy link

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.

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.
Author
Member
Copy link

Increased the check to 2

Increased the check to 2
Owner
Copy link

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

> 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
Author
Member
Copy link

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?

> 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?
Owner
Copy link

yeap two times the same station

yeap two times the same station
Author
Member
Copy link

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.

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.
Owner
Copy link

please add a comment that lollypop is e.g. A-B-C-B-A, its not immediately clear what it is :)

please add a comment that lollypop is e.g. A-B-C-B-A, its not immediately clear what it is :)
Author
Member
Copy link

Done!

Done!
Bovi887 marked this conversation as resolved
Bovi887 force-pushed remove-false-non-closed-circular-line-warning from 36a9a3c5ac to 907bd34581 2026年04月05日 14:40:57 +02:00 Compare
Bovi887 force-pushed remove-false-non-closed-circular-line-warning from 907bd34581 to 4d51d568e9 2026年04月05日 15:24:25 +02:00 Compare
Bovi887 changed title from (削除) Remove circular route warning for lollypop shaped routes. (削除ここまで) to WIP: Remove circular route warning for lollypop shaped routes. 2026年04月05日 15:27:19 +02:00
Bovi887 force-pushed remove-false-non-closed-circular-line-warning from 4d51d568e9 to 748a08dacb 2026年04月05日 15:41:58 +02:00 Compare
pastk left a comment
Copy link

LGTM!

LGTM!
Bovi887 force-pushed remove-false-non-closed-circular-line-warning from 748a08dacb to d866144602 2026年04月05日 19:02:33 +02:00 Compare
Bovi887 changed title from (削除) WIP: Remove circular route warning for lollypop shaped routes. (削除ここまで) to Remove circular route warning for lollypop shaped routes. 2026年04月05日 19:03:07 +02:00
Bovi887 deleted branch remove-false-non-closed-circular-line-warning 2026年04月05日 19:23:23 +02:00
Sign in to join this conversation.
No reviewers
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
comaps/subways!61
Reference in a new issue
comaps/subways
No description provided.
Delete branch "Bovi887/subways:remove-false-non-closed-circular-line-warning"

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?