alexey-zakharenkov / subways

Subway Preprocessor and Validator
Apache License 2.0
12 stars 1 forks source link

Detect excessive RouteStop generation on incorrect stop_areas scheme at a station #3

Open alexey-zakharenkov opened 3 years ago

alexey-zakharenkov commented 3 years ago

Lets consider an interchange subway station where two rails may lay at different layers or may pass nearby:

--p-l-a-t-f-o-r-m--1--                 |     |     |
                                       pl    r     pl
                             __        |     a     |
--r-a-i-l-------st1---      |__|       at    i     at
                          station      |     l     |
                                       fo    |     fo
--p-l-a-t-f-o-r-m--2--                 |     |     |
                                       rm-3  st2   rm-4
                                       |     |     |

One of possible incorrect platform arrangement across stop_areas is: stop_area1: station, st1, pl3, pl4 stop_area2: station, st2, pl1, pl2 route: ..., st1, pl1, ...

In this case the validator produces irrelevant error message or doesn't detect any error.

Normally consecutive stop and platform in a route belonging to the same station produce only one RouteStop as they belong to the same stop_area. But here st1 and pl1 mistakenly belong to different stop_areas, and they produce two RouteStops: RouteStop(stop_area1) and RouteStop(stop_area2). The first negative effect is that this results in excessive RouteStop in the route, the second - this also may produce confusing "angle too narrow" error/warning or no message at all, depending on the positions of the elements.