-
Notifications
You must be signed in to change notification settings - Fork 59
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
Support for highway=track #717
base: main
Are you sure you want to change the base?
Conversation
A zoom-12 track can be found at approximately this location: It's a section of Rhode Island's North South Trail ( |
Unfortunately this means that most tracks snap in at full opacity, but there doesn't seem to be a way to avoid that without route_rank being exposed in OMT.
Required lightening the color to avoid increasing the visual weight.
Should we just go ahead and make |
That's my plan! |
Thanks for working on this! For unpaved tracks, do you think we might be able to do just a dashed double line as is typical on USGS maps? Essentially dashed casing with no fill? Thinking about how we implement casing as a wider line underneath a thinner one, maybe this isn't possible in MapLibre. Maybe line-offset could be used to draw two dashed lines, each slightly off center from the actual geometry. I guess that would require two layers though. |
@zekefarwell, this is how it is currently implemented on the branch. There is no fill and only one layer. The line-dasharray property specifies the length of dashes and gaps while the line-gap-width property specifies the offset to either side of the center-line of the line (where the fill would be if overlaying multiple painted lines). With a non-zero |
Do we plan to render paved paths differently from unpaved paths? Is the use of brown to represent something paved a problem? |
I played around with a bunch of different spacings and colors and ended up with these lighter colors and narrower low-zoom representation to prevent the visual weight from being heavier than minor roads. I'm sure that there are different balances that would be acceptable, but that was the the metric I was using: visible, but less weighty than minor roads. |
Great questions!
Certainly I think it would be ideal to differentiate between high-quality/improved-infrastructure paths that are likely to be wheelchair accessible (whether paved, or gravel) and those that are less likely to be wheelchair/stroller accessible. After that the actual smoothness or surface feels less important to me than differentiating on the keys focused on by the Trails Working Group ( It might make sense as a design language to keep some dashing on the paved paths, but maybe with just little breaks instead of longer ones. This seems less needed for tracks as the solid double-track line feels like it would be less likely to occur in densely mapped environments and to conflict there with other features
Good question. It feels okay to me for paved tracks as the brown signifies land-access in my mind, but shifting those to a grey-tone would also be very reasonable and might make more sense. For paths it becomes a bit trickier because of the ambiguities in usage of |
I was thinking maybe we could play with incorporating some brown into the current rendering for unpaved roads (primary and below), perhaps in the pattern or casing. I just think I'd be surprised to find a paved road where there's a brown line on the map. A paved track doesn't seem really very distinct from a paved service road to me -- they're so close in real-world meaning that they hardly make sense to differentiate. |
I see the point on paved tracks. I'll think on that and look at more tagging usage as there are also cases of farm tracks with For the general road-network's primary-minor unpaved roads, I'm pretty happy with the current representation and am leery of blurring the line between these and tracks. The majority of road-miles in my region are unpaved, so that distinction between unpaved (and likely maintained publicly or privately) and likely-unmaintained tracks is super important to me. |
I agree that track roads and service roads have a big overlap in physical characteristics. However I don't think rendering all track roads and service roads the same but with a paved/unpaved distinction would be optimal. The distinction I'd ideally like to see is more about overall construction quality and maintenance based on the OpenMapTiles doesn't include tracktype values so that would be required. Also there are probably a bunch of track and service roads that don't have a tracktype, but I think this logic would be reasonable for filling in missing tracktype values:
|
I really like that breakdown, the only think I would adjust is that I thought |
There is a |
In typical OSM fashion it is "Usually a paved surface" 😉 (tracktype wiki page). If there is no |
Longer term, if OMT gets
Any of those worse tracktypes or worse smoothness values would knock even a paved track into a lower category. For example, a way with |
A more typical approach in OpenMapTiles would be to group together the tagging into renderable attributes. I would suggest that from this discussion there are actually 3 surface categories that we really care about:
|
Just saw this, looks great! Re: @zekefarwell's point about the dashes blending together when you're zoomed out, I wonder if it would be better to have tracks as a single dashed line when zoomed out, which can switch to the very nice two-track line you have as you zoom in. One thing that struck me in your samples is that due to that blending, the tracks visually appear much thicker than residential and even tertiary roads. This is also the trick the rest of the roads use, when they switch from being black lines to black with white fill at z>15. |
Even without testing for http://localhost:1776/#map=15.99/44.078913/-73.121379 I guess that leaves the open question: Is the knockout enough? |
Have to say, those track bridges look awesome! |
I think the knockout alone works fine for roads and railways at low zoom as it reduces clutter. At higher zoom I think showing bridges more explicitly in some way makes sense for tracks as well as other highway types. |
Good point on zoom-dependent rendering! A slightly wider black casing could be added to all highway bridges, or for roads that already have a black casing, a background-color+casing to give similar looking standoff to that of tracks and rail. |
We had originally considered a dark casing around road and rail bridges too, but it got complicated because there needed to be a bit of a gap between the roadway and casing, and traditionally the casing would’ve splayed out on either end too. It got really confusing with rail because the railroad ties made the bridge look like a pontoon bridge or something: #476 (comment). I could see an argument for applying a dark casing only for tracks on the basis that tracks lack a solid longitudinal stroke, unlike roads and rail. In that case, what we’re communicating is that the track temporarily becomes more like a normal road as it traverses a bridge. Regardless of how we treat bridges, if there’s enough precedent for marking a ford explicitly with a symbol, perhaps we could explore that in a separate issue. |
It's subtle, but I've added support for Side-note: OMT doesn't have Here are some examples of making fords on tracks the water-line color.
Thoughts? What do you think about the legend labeling? Too verbose? |
"object_types": ["way"], | ||
"description": "Track roads have a two-track line pattern that is dashed if unpaved and solid if paved.", | ||
"doc_url": "https://openmaptiles.org/schema/#transportation" | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also add an entry for ford=yes
, as well as a second entry for surface
that describes the stylistic variation on tracks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the feedback. Added these taginfo entries in ab1e133.
src/layer/track.js
Outdated
|
||
export const legendEntries = [ | ||
{ | ||
description: "Land access track", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This diplomatic wording is more appropriate in contexts like id-tagging-schema and the OSM Wiki, where it’s important for mappers to apply the right tag and not apply the wrong tag. But we have much more latitude in a legend, where the reader just has to get the gist of what distinguishes this entry from the ones above it. For comparison, the entry for expressways condenses an entire highly technical wiki article into just a few words. That’s what you’ve done here, but out of context, “land access” raises more questions than it answers.
In my opinion, even a description as simple as “Unpaved track” or “Unpaved off-road track” would suffice. I don’t think the reader would be left with the impression that they’re looking at running tracks or railroad tracks (which has its own section). Many print maps say things like “Vehicle tracks” or “4×4 tracks”, but we aren’t distinguishing by mode of transportation here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"track" isn't really a word we use for that here though. The closest American-ism is a "two-track road" in my vernacular.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
“Track” or “tracks” is a word in American English. It’s more general than highway=track
(e.g., train tracks, farm tracks, animal tracks), but still close enough that the reader would not be mislead by seeing these lines described as tracks. As a preset name, it would cause mappers to dilute the tag, but dilution doesn’t happen quite like that with a map legend.
Part of the reason we’re in this quandary is that conventional transportation maps don’t even distinguish this notion of a highway=track
. They do distinguish local roads by surface or access with captions like “unpaved local road” or “trail”, or they omit them from the map in the first place.
This outdoors-oriented atlas exemplifies the kitchen-sink approach:
* Other roads in urban areas are typically paved public streets. In rural areas they include local back roads, rough 4WD routes, private roads, and logging roads. Some of these roads are usable, but others are closed to public use, or seasonally impassable, or both. Inquire locally before attempting to drive “Other Roads.”
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the feedback. Shortened to Unpaved track
and Paved track
in 15a832e.
src/layer/track.js
Outdated
filter: notFordSelect, | ||
}, | ||
{ | ||
description: "Land access track - ford", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So far we’ve omitted brunnels from the legend because taking them out of context can be confusing. (A road bridge, for one thing, looks just like a normal road on its own.) We’d need to add some functionality to the legend to place another linear feature across the spotlighted feature. But I think the ford treatment you’ve implemented looks intuitive enough on its own.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For now I've left the ford-specific legend entries to avoid the case of ford-styling ending up in the legend when both unpaved ford and non-ford are present (such as at this location) as well as allow a concrete ford surrounded by unpaved tracks to get an entry noting that it is paved (such as at this location). Maybe this isn't ideal, but dropping any filters and sometimes showing blue for tracks felt particularly wrong.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I certainly agree with filtering out fords from the general track entries, but in the absence of the crossing lines capability I described above, it’s probably less confusing overall to omit any entries about the fords.
The main issue is actually that the legend is depicting the track as a single dashed line, whereas it’s actually two parallel lines. I assume that’s because it doesn’t honor the line-offset
and line-gap-width
properties. If we fix that, then at least the ford entry won’t look like an intermittent creek.
If we keep the ford entries around, we might be able to combine them into one entry. There are other examples where we avoided breaking out combinations of attributes – for example, there’s only one expressway entry, even though multiple classes of roads that render differently can be expressways. This works because the entry clearly is about a particular aspect of the line, not trying to visually represent every possible expressway.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#770 tracks the incorrect implementation of line-gap-width
in the legend.
Link to that location? |
This extension-beyond seems to be a pretty rare occurrence as I've looked at lots of Y-intersections that don't have this behavior. I did find a replica of the issue at http://localhost:1776/#map=21.55/37.9287078/-107.6257251 I wasn't able to find any combination of
I checked this particular case to ensure that it was actually mapped correctly as a junction and not an overlapping line. Given that |
With significant, but not exhaustive searching of the globe, I've so far turned up only two cases where a track layers at
I'm wondering: How valuable it would be to add/validate support for proper track-bridge layering that rarely if ever exists in the world, versus naively assuming track-bridges are one layer above 0 which is almost always the case? |
The area around Stuggart, Germany makes an interesting case to examine for the value of keeping the paved track rendering visually distinct from other minor roads. This area has tons of https://www.openstreetmap.org/#map=15/48.7803/9.2848 This is quite different from the infrastructure I'm familiar with in the US. Given how rare paved tracks are in the US I'm leaning toward keeping the rendering between paved tracks and minor/service roads distinct if only to let the eye pick up on the distinction that there might be a difference (e.g. |
"key": "ford", | ||
"value": "yes", | ||
"object_types": ["way"], | ||
"description": "The color of track roads changes from brown to blue for ways tagged as fords.", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A more direct way of saying this is that the ford blends in with the waterway it crosses.
src/layer/track.js
Outdated
filter: notFordSelect, | ||
}, | ||
{ | ||
description: "Land access track - ford", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I certainly agree with filtering out fords from the general track entries, but in the absence of the crossing lines capability I described above, it’s probably less confusing overall to omit any entries about the fords.
The main issue is actually that the legend is depicting the track as a single dashed line, whereas it’s actually two parallel lines. I assume that’s because it doesn’t honor the line-offset
and line-gap-width
properties. If we fix that, then at least the ford entry won’t look like an intermittent creek.
If we keep the ford entries around, we might be able to combine them into one entry. There are other examples where we avoided breaking out combinations of attributes – for example, there’s only one expressway entry, even though multiple classes of roads that render differently can be expressways. This works because the entry clearly is about a particular aspect of the line, not trying to visually represent every possible expressway.
Some of the imprecision might be a consequence of the tiles only covering up to z14 (compared to z16 in Mapbox Streets). At z20–z22 there’s increasing amounts of weirdness that I’m guessing comes down to floating point imprecision in the shaders. |
After evaluating all 1,216 That said, there are a few cases where a larger layer value is accurately used:
As well, I found several extant cases of a track-bridge actually crossing above another highway bridge:
While not extensive, track-bridges should be stacked appropriately with other bridges. I'm not sure if they are stacking correctly now just because tracks are more minor and being rendered after the other bridges or if it is because the bridge layering is actually working correctly. Layering will certainly be needed for path/footway bridges as those are much more likely to interleave other bridges than the comparatively rare |
#925 removes one-way arrows from tracks and path (which are disjoint from line rendering for tracks and paths). If there isn't a near-term plan to proceed with track rendering, I would recommend approving that PR in the interim, however, I assume that would conflict with this PR. |
I unfortunately don't anticipate having time to work on this in the near-term, though maybe once stick-season gets fully underway and I'm not trying to maximize being outside 🧗 / 🚵 / 🛶 in the evenings I'll be able to get back to it. Easy enough to revert the track portion of the one-way change at that point. |
Reading back through this, the rendering samples look quite good to me. What more work actually needs to be done here? If, as the checklist at the beginning seems to indicate, the only things left are support for |
@wmisener if you wanted to take on reviving this PR, resolving the current conflicts, and documenting the outstanding track/path issues, I think that work would be welcome. The branch is in the repo so you could fork from there. |
I welcome reviews and any contributions that move this over the finish line. I think the bridges with |
I can try to take a hack at it! Unfortunately I've been quite busy myself recently, so there's a chance I won't really have enough time either soon. But I've made a fork to work on in case I do. |
Regarding layering, as with the bridges above, it's hard to find good examples in the wild. A few with valid These appear to not layer correctly, but I note that Carto seems to fail at them as well:
The question that remains is whether it really matters to get the stacking right here, given the fact that (I assume) correcting this introduces significant code complexity. I'd think proper layering matters less for tunnels than bridges: tunnels get a faint rendering anyways, and I doubt there will be many track intersections within tunnels. With bridges on the other hand, you can see the stacking from the ground. What really needs to be found to test this is a situation where a |
As part of #216, this PR adds support for tracks, rendering them as double-tracked dashed lines.
Note that this will require separate layers with different
line-dasharray
values until Implement data-driven styling for line-dash-array maplibre/maplibre-gl-js#1235 is fixed similar to Combine railroad dash patterns into single layer #526.Right now only
surface
is exposed in OpenMapTiles.surface=paved
, then render as solid double-track lines rather than dashed lines.As mentioned in Fix paths and tracks in transportation layer z12 and z13 openmaptiles/openmaptiles#1334, some tracks start showing up at z12, but others not until z13, 14, or 15. It would be great to fade them in smoothly based on their
route_rank
, but theroute_rank
isn't exposed in OMT, so tracks are just present or not at different zooms.