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

Add support for light_rail routes with tram tagging #73

Merged
jeanbaptisteC merged 1 commit from Bovi887/subways:support-partial-tram-routes into master 2026年05月12日 21:58:43 +02:00
Member
Copy link

This PR adds support for light rail routes that have partial tram tagging as a first step of full tram support (#16).

The way I implemented this requires 'tram' to be added as mode to networks for it to consider tram stops (this does not make the generator look for tram routes, I think we should keep that to the overground mode). Another option would be to make it enabled by default, but I think that would just cause unnescessary processing.

While it works on my end I'm not sure if this is ready for merging, so i've marked it as WIP, but, if possible, a test run would be nice to be sure I'm not breaking anything unexpected.

I also saw that I've been working a bit in parallel with @jeanbaptisteC so I'm not sure what the best workflow would be here.

Signed-off-by: Bovi887 bovi887@noreply.codeberg.org

This PR adds support for light rail routes that have partial tram tagging as a first step of full tram support (#16). The way I implemented this requires 'tram' to be added as mode to networks for it to consider tram stops (this does not make the generator look for tram routes, I think we should keep that to the overground mode). Another option would be to make it enabled by default, but I think that would just cause unnescessary processing. While it works on my end I'm not sure if this is ready for merging, so i've marked it as WIP, but, if possible, a test run would be nice to be sure I'm not breaking anything unexpected. I also saw that I've been working a bit in parallel with @jeanbaptisteC so I'm not sure what the best workflow would be here. Signed-off-by: Bovi887 <bovi887@noreply.codeberg.org>
Signed-off-by: Bovi887 <bovi887@noreply.codeberg.org>
Contributor
Copy link

IMO, it's better to revive support of tram, instead try to support a mix of tram/light_rail to adapt our tool to the osm data

IMO, it's better to revive support of tram, instead try to support a mix of tram/light_rail to adapt our tool to the osm data
Author
Member
Copy link

@jeanbaptisteC I agree that we need tram support, but light_rail lines with tram tagging are a quite common problem, so I think we need a way to deal with this as well.

I think this approach (although not that elegant by just taking the first found tram stop as station if no other stations are available) also has potential to work for full tram support, as long as the right data is provided (by querying for overground). However tram lines are way more often clustered on the same routes, so I think we also need to do some work to get a different rendering for those. I think the current subway styling would look too cluttered for full tram networks.

I'm right now looking into if it would be possible to use track geometry to create lines to display instead of the current estimations (in my oppinion quite needed for trams). But this does look very complicated with getting an average line of multiple tracks, so I don't think I have a quick solution (I'm not even sure if there even is a good solution at all).

With this PR we can already support light rail lines with some tram tagging while we still figure out how to properly support tram.

@jeanbaptisteC I agree that we need tram support, but light_rail lines with tram tagging are a quite common problem, so I think we need a way to deal with this as well. I think this approach (although not that elegant by just taking the first found tram stop as station if no other stations are available) also has potential to work for full tram support, as long as the right data is provided (by querying for overground). However tram lines are way more often clustered on the same routes, so I think we also need to do some work to get a different rendering for those. I think the current subway styling would look too cluttered for full tram networks. I'm right now looking into if it would be possible to use track geometry to create lines to display instead of the current estimations (in my oppinion quite needed for trams). But this does look very complicated with getting an average line of multiple tracks, so I don't think I have a quick solution (I'm not even sure if there even is a good solution at all). With this PR we can already support light rail lines with some tram tagging while we still figure out how to properly support tram.
Contributor
Copy link

I'm not fan of the solution but ok, more early we reenable tram support more early we can ask help to the community osm and unify and fix tagging
We can enable tram support on the validator without integrate it in the maps generation in first and find a solution for the render
Also I think, we need not to take too much time to implement that, our actual transport support is a temporary solution before support transitous and motis 😉

I'm not fan of the solution but ok, more early we reenable tram support more early we can ask help to the community osm and unify and fix tagging We can enable tram support on the validator without integrate it in the maps generation in first and find a solution for the render Also I think, we need not to take too much time to implement that, our actual transport support is a temporary solution before support transitous and motis 😉
Author
Member
Copy link

Of course, real GTFS data support will be so nice!

Unfotunately unifying tagging is not always possible where different types of networks integrate. Do you have any suggestions to improve the solution or to make this PR better/more robust?

Of course, real GTFS data support will be so nice! Unfotunately unifying tagging is not always possible where different types of networks integrate. Do you have any suggestions to improve the solution or to make this PR better/more robust?
Contributor
Copy link

I'm not really an expert, but I suggest to use this solution only when network cannot be fixed easily
About problem of render about tram, we can start by support tram in cities not yet supported without subway or light_rail to increase the network coverage without pollute the map

I'm not really an expert, but I suggest to use this solution only when network cannot be fixed easily About problem of render about tram, we can start by support tram in cities not yet supported without subway or light_rail to increase the network coverage without pollute the map
Author
Member
Copy link

Yeah, I did not mean this solution to just be used everywhere, which is why I require tram to be in modes to use it. I can add an extra check to the code to only use it when processing rapid transit networks, but then a different solution is needed for overground processing.

With this solution we can at least support some now put aside networks that are clearly rapid transit, but partially use infrastructure of tram networks.

Yeah, I did not mean this solution to just be used everywhere, which is why I require tram to be in modes to use it. I can add an extra check to the code to only use it when processing rapid transit networks, but then a different solution is needed for overground processing. With this solution we can at least support some now put aside networks that are clearly rapid transit, but partially use infrastructure of tram networks.
Author
Member
Copy link

About tram rendering: I think your solution is a good way to get started. Starting small with cities with just a couple of lines. I'm just a bit hesistant about big cities. 😅

Let's process them separate though, so we at a later point easily can ajust rendering. (I think you are already planning this by using the overground csv)

About tram rendering: I think your solution is a good way to get started. Starting small with cities with just a couple of lines. I'm just a bit hesistant about big cities. 😅 Let's process them separate though, so we at a later point easily can ajust rendering. (I think you are already planning this by using the overground csv)
Bovi887 changed title from (削除) WIP: Add support for light_rail routes with tram tagging (削除ここまで) to Add support for light_rail routes with tram tagging 2026年05月10日 12:44:25 +02:00
Author
Member
Copy link

@pastk Could you do a test run with this PR if/when possible just to be sure I'm not breaking anything before merging?

@pastk Could you do a test run with this PR if/when possible just to be sure I'm not breaking anything before merging?
Contributor
Copy link
Run here https://codeberg.org/comaps/comaps/actions/runs/17934/jobs/1/attempt/1 https://mapgen-fi-1.comaps.app/subway/validator/denmark.html
Author
Member
Copy link

Seems good, not creating problems with other networks.

Seems good, not creating problems with other networks.
Contributor
Copy link

Let's support more networks in the app
Thanks for this PR

Let's support more networks in the app Thanks for this PR
Bovi887 deleted branch support-partial-tram-routes 2026年05月13日 15:40:42 +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
3 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!73
Reference in a new issue
comaps/subways
No description provided.
Delete branch "Bovi887/subways:support-partial-tram-routes"

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?