Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Public transport labels fixes #187

Merged
merged 6 commits into from
Sep 24, 2023
Merged

Conversation

Dlurak
Copy link
Collaborator

@Dlurak Dlurak commented Sep 23, 2023

This PR addresses two significant issues and introduces improvements to the public transport labels:

  1. Background Color Adaptation:
    • Previously, the background color of the labels wouldn't adapt when the color is specified as a word (e.g., yellow) instead of a hex-value. This PR fixes this issue by implementing dynamic color adaptation.
  2. Overpass Query Enhancement:
    • The old overpass-query to retrieve routes had multiple problems:
      • It sometimes displayed routes from stops that were closer than 150 meters to each other, leading to incorrect information.
      • On the other hand, it failed to display all routes when a stop was more than 150 meters away from the actual node for the train station.
    • To solve these issues, this PR introduces the use of the relation stop_area to retrieve routes. This improvement ensures that both of the aforementioned problems are resolved.
  3. Mapping Requirement:
    • It's important to note that for this enhancement to work, stops must be correctly mapped with the stop_area relation. In cases where this mapping is not done accurately, the query will not find any routes at all.

@vercel
Copy link

vercel bot commented Sep 23, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
osmapp ✅ Ready (Inspect) Visit Preview Sep 23, 2023 10:26am

@Dlurak
Copy link
Collaborator Author

Dlurak commented Sep 23, 2023

Oops, I've used npm instead of yarn :/

Comment on lines +14 to 17
${featureType}(${id});
rel(bn)["public_transport"="stop_area"];
node(r: "stop") -> .stops;
rel(bn.stops)["route"~"bus|train|tram|subway|light_rail|ferry|monorail"];
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wow, this is some advanced query! I will have to study how this works. It could be useful on my other PR #186 .

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see also here: #387

Copy link
Owner

@zbycz zbycz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Looks very good 🎉

@zbycz zbycz merged commit 1b6af16 into zbycz:master Sep 24, 2023
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants