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

Widen highways at very high zoom #1183

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Conversation

claysmalley
Copy link
Member

@claysmalley claysmalley commented Dec 31, 2024

Fixes #372

This PR changes the width of highways at zoom level 16 and above, so that they widen in direct proportion with the zoom level. At this level, even the narrowest highway=trunk city streets fit in their physical footprint without overlapping sidewalks.

before/after:

image

image

@claysmalley claysmalley added enhancement New feature or request highway-lines labels Dec 31, 2024
@ZeLonewolf
Copy link
Member

Thanks, this looks awesome! There's some code in here that looks like it's modifying the ferry styles, is that intended?

@claysmalley
Copy link
Member Author

There's some code in here that looks like it's modifying the ferry styles, is that intended?

It's actually there to ensure ferries maintain the same styling while other things change around it. zoom expressions are what they are 🤷

@wmisener
Copy link
Collaborator

wmisener commented Jan 1, 2025

Great work! This is a big improvement in road rendering at high z-level, and goes a long way toward addressing the longstanding issue #372 (in fact, I think I'd say it fully addresses it). In light of the discussion there, it'd be interesting to calculate out what the effective width of each way actually is. It also doesn't preclude an approach like #486 later on with mapped highway areas.

I tested around and agree with your assessment that no roads seem to be overlapping roadside features, with a big boost in attractiveness in my opinion. Here's old and new in DC:
Screenshot 2025-01-01 at 1 36 55 PM
Screenshot 2025-01-01 at 1 36 49 PM

#372 (comment) raised the issue that care might be needed for places outside the mid-latitudes. I'm not sure how the current code approaches that, but I don't see any glaring issues in Hilo, HI or Fairbanks, AK:
Screenshot 2025-01-01 at 1 55 01 PM
Screenshot 2025-01-01 at 1 54 33 PM

@claysmalley
Copy link
Member Author

#372 raised the issue that care might be needed for places outside the mid-latitudes.

Out of curiosity, I looked at Jakarta, a city near the equator with tons of narrow streets. Seems that we're running up against the limits in a place like this, though I believe most of the overlapping buildings here are just imperfectly aligned. On top of that, most of these streets are tagged highway=living_street with access restrictions, and would probably be good candidates for a new tag for narrow streets that we could potentially use in the future.

(location)

image

@wmisener
Copy link
Collaborator

wmisener commented Jan 2, 2025

Out of curiosity, I looked at Jakarta, a city near the equator with tons of narrow streets. Seems that we're running up against the limits in a place like this, though I believe most of the overlapping buildings here are just imperfectly aligned. On top of that, most of these streets are tagged highway=living_street with access restrictions, and would probably be good candidates for a new tag for narrow streets that we could potentially use in the future.

Other OSM renderers also struggle with areas like this:
Screenshot 2025-01-01 at 10 07 05 PM
So I don't think it should be a blocker.

@wmisener
Copy link
Collaborator

wmisener commented Jan 2, 2025

One note, did you consider including aeroways in the scaling relation? They appear to stay constant width as the roads expand (old vs new at this location):
Screenshot 2025-01-01 at 10 14 20 PM
Screenshot 2025-01-01 at 10 14 25 PM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request highway-lines
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Increase default highway width to better match physical width at high zoom
3 participants