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

Add rendering of "ref" on paths and create new layer for "ref" of minor roads and paths #3663

Closed
wants to merge 4 commits into from

Conversation

jeisenbe
Copy link
Collaborator

@jeisenbe jeisenbe commented Jan 31, 2019

Closes Issue #2052
Follow-up to PR #3654

Changes proposed in this pull request:

  1. Add rendering of "ref" numbers for paths (highway= bridleway, cycleway, footway, path, steps)

  2. Move aeroways, minor roads, tracks and paths "ref" to a later layer, after name labels are rendered

  3. Minor changes:

  • Change text-halo to standard size highway=unclassified/residential refs and aeroway refs
  • Change residential / unclassified road "ref" size to 11 point at z17, to be the same size as the name text labels at this zoom level and higher.

Explanation

1) Map users have requested rendering for the "ref" (reference numbers) for paths

  • Some paths are unnamed, but have a ref
  • Other have both a name and a ref number, which can be useful for following longer routes
  • This is most common with long-distance footways and cycleways, but can sometimes be found for other paths as well

2) The minor roads, aeroways, and tracks with text-based ref labels currently render in the same layer as the shields for major roads.

  • This means that the ref text is rendered before the name label, and can block the name from rendering when spaces is limited.
  • Major road shields render much sooner than the ref text labels of minor roads and paths, which are not shown until z15 or z16.
  • Major road shields are usually more important than the name; the number of a motorway is used more often, but for minor roads, such as residential streets, the name is more useful and should be shown with higher priority
  • Changing residential, unclassified and paths to a later layer will fix this rendering. Aeroways "ref" text labels are also moved to this new layer because they are also rendered only at z15 and higher, though this does not change the cartography because they do not have a rendering for names

3) The "ref" labels rendering for residential/unclassified roads needs minor adjustments

  • At z17, the "name" text label increases to 11pt font size, but the ref does not change size till z18 currently. This should be adjusted so that the "ref" label is the same size as the name label, as at z15 and z16.
  • The halo needs to be changed to standard size. Right now it is 2 pixels wide, which would overlap with the casing at certain zoom levels.

Test rendering with links to the example places:

highway=unclassified with name and ref - Basilicata, Italy
https://www.openstreetmap.org/#map=17/40.3776321/15.7281581
Before z17
via-chiusululle-unclassified-master
z18
z18-via-chiusululle-master
After z17
chiusululle-z17-after
z18
chiusululle-z18-after

highway=residential with name and ref - Basilicata, Italy
https://www.openstreetmap.org/#map=17/40.1412792/16.0893142
Before z17
via-vittorio-res-z17-master
z18
via-vitorio-z18-master
After z17
z17-via-vittorio-after
z18
via-vittori-z18-after

highway=path with name and ref - Basilicata, Italy
https://www.openstreetmap.org/#map=16/40.4133/15.6249
Before z16
z16-sentiero-master
After z16
z16-sentiero-refs-after-16-n40 4133-e15 624916

highway=path with name and ref - Montenegro
https://www.openstreetmap.org/#map=1616/42.6710/19.6521
Before z16
ref355-master
After z16
path-ref355-after-16 42 6710 19 6521

highway=footway with ref - Brussels, Belgium
https://www.openstreetmap.org/#map=19/50.85126/4.33989
Before z19
r20-master
After z19
r20-footway-ref-after-19 50 85126 4 33989

highway=cycleway with ref - Brussels, Belgium
https://www.openstreetmap.org/#map=17/50.87994/4.29554
Before z17
n9f-master
After z17
n9f-cycleway-ref-after-17 50 87994 4 29554

highway=cycleway with ref - Brussels, Belgium
https://www.openstreetmap.org/#map=18/50.86575/4.36460
Before z18
n277-master
After z18
n277-cycleway-ref-after-18 50 86575 4 36460

highway=bridleway with ref - Canada
https://www.openstreetmap.org/#map=16/52.8965/-118.1050
Before z16
bridleway-refs-master
After z16
bridleways-path-ref-after-16 52 8965 -118 1050

highway=steps with ref (and path with ref) - Germany
https://www.openstreetmap.org/#map=19/47.45867/11.12463
Before z19
kalbersteig-master
After z19
z19-kalbersteig-steps-path-19 47 45867 11 12463

@Adamant36
Copy link
Contributor

Adamant36 commented Jan 31, 2019

I'm 100% behind this and also read what you wrote above, which I agree with. But random questions though, is there some kind of universal rule tying the usefulness of ref numbers on roads together? Like, what's the actual practicality of showing "6" on the Canadian paths and do you think there's less utility in rendering ref numbers for something where there's already a road name, like the Montenegro example ? How much would what it actually refers to vary by country? If I'm an America and I see a ref number on a Canadian path I have zero clue what it relates to or what it "references" and visa versa. Even less so for people viewing a map of Canada who live in "third world" countries, that don't have ref numbers on their roads, let alone road names in a lot of places. At least with a road name though, its universally clear that its the name of the road. I'm not sure the meaning is as universal with ref numbers.

Also, I wonder if a lot of these are either just eternal government ref numbers, that were added through imports and aren't important outside of planning departments. Or are random ref numbers to make things relate to each without having to use a relation. In both cases 99% of users will just ignore them. Especially if the ref number is on a path that already has a name tag.

Look at tag history it appears that there were multiple times where a couple hundred thousand were important at a time. Although who knows if they where attached to these tags though. Your looking at almost a million added over a year (or a little less then 100,000 a month).
taghistory
The second picture is from 2018 when it looks like four hundred thousand of them were imported over three months.
taghistory 1

@jeisenbe
Copy link
Collaborator Author

jeisenbe commented Feb 2, 2019

What's the link to the site that makes those cool charts?

In this case, we would need a chart that shows the number of highway=path, =footway, =cycleway etc with ref=, since the "ref=" tag can be used for many different features.

I've checked the combinations on Taginfo:
Ref=* is used with highway=path 31 ,745 times
https://taginfo.openstreetmap.org/tags/highway=path#combinations

It's used 6169 times with highway=cycleway
https://taginfo.openstreetmap.org/tags/highway=cycleway#combinations

11, 327 times with highway=footway:
https://taginfo.openstreetmap.org/tags/highway=footway#combinations

1 853 times with highway=steps
https://taginfo.openstreetmap.org/tags/highway=steps#overview

Taginfo doesn't record how many times it is used with highway=bridleway, suggesting that there are less than 1000. However, there are only 82 ,648 bridleways, so the percentages might be similar.

For comparison, ref=* is used 66, 115 times with highway=track, out of 15 million total tracks. So 0.4% of tracks have a "ref", and these are now rendered: https://taginfo.openstreetmap.org/tags/highway=track#overview

And ref=* is used 82, 235 times with highway=residential, out of 44 million total, thus 0.2% of highway=residential have a "ref="; these have been rendered for some time.

@Adamant36
Copy link
Contributor

OSM Tag History. You can compare multiple tags with it to. Its pretty handy.

Hhhhmmm, I don't know what to make of your tagging summary, but its still interesting and helpful. I hadn't thought about the upper and lower case usages. Would they both be rendered then?

I'm aware that ref=* has been rendered on highway=residential already. But it might be a similar case to rendering based on height where if it works in one situation that doesn't mean it will work in every situation. Off the top of my head, it would probably work fine on residential roads because 99% of the time they also have name tag that would mitigate any possible confusion. Whereas on paths, they don't have names for someone to fall back on most of the time.

Id venture to that where ref names are used without name tags, its just a name tag. Since its essentially being used as one in those cases. Which seems like bad tagging. Ref should be a complement to a name. Not a replacement.

Btw, it even says on the ref wiki page that "This key and variations are frequently used to avoid the use of relations." Which just confirms what I hypothesized above about how they might be used instead of relations, and therefore aren't official or reliable in a lot of cases (there's still the verifiability/ground truth rule in Wikipedia. Which relation numbers wouldn't qualify under. As they have no relation to the real world. Therefore, id put this as a tag worth using for enthusiastic and in specific cases, but not worth rendering in cases where its attached to a widespread tag like paths where there is no fallback like name=*

@jeisenbe
Copy link
Collaborator Author

jeisenbe commented Feb 2, 2019 via email

@matthijsmelissen
Copy link
Collaborator

I'm still not very convinced about the need for this. In which countries would this be desirable?

I know many (hiking/cycling) routes have ref's, but are there also many instances when the paths/tracks themselves have refs?

I'm a bit concerned that this will lead to mistagging, where mappers will add the route ref to the individual roads rather than the route relations.

@jeisenbe
Copy link
Collaborator Author

I'm still not very convinced about the need for this. In which countries would this be desirable?

I know many (hiking/cycling) routes have ref's, but are there also many instances when the paths/tracks themselves have refs?

Many forest trails in the USA have a ref, similar to those used for forest tracks and roads, especially on lands owned by the federal government (eg National Forests, National Parks, BLM lands). Not all of these are currently mapped. The trail has a reference number. Some may have started out as track roads, but now are trails because they are not maintained for 4-track motor vehicle access, or motor vehicle access is prohibited.

For example, there are 934 ways (including >100,000 nodes!) in Oregon with highway=path and ref=*, usually a 4 digit numeric code that has been assigned by the US Forest Service. Most of these ways are 2 to 20 km long:

path-with-ref-oregon-usa
Search on Overpassturbo:

{{geocodeArea:Oregon}}->.searchArea;
  way["highway"="path"]["ref"](area.searchArea);
);

It appears some cycleways in the Netherlands have ref tags, eg "Fietssnelweg F35" around Hengelo. See https://www.openstreetmap.org/way/4797877 and connected ways for an example.

I'm a bit concerned that this will lead to mistagging, where mappers will add the route ref to the individual roads rather than the route relations.

I suppose this same issue is present with all types of roads? The ref is selected from planet_osm_line for all roads and paths, and if I understand how the data is imported correctly, this means it is from multipolygons and ways, but not from route relations

But I would think that the ref should be applied to the individual ways. The [wiki page for highway=](url
https://wiki.openstreetmap.org/wiki/Highways#Names_and_references) says:

"Names and references
"Use the name=* and/or the ref=* for each section of the road (way) which has a name or reference. If a stretch of highway has multiple reference numbers, they should be semicolon-delimited."

So all highways with a ref tag, including paths, footways, and cycleways, should have that ref=* tag on each of the ways, as is done with the name=* tag, according to this.

@imagico
Copy link
Collaborator

imagico commented Feb 21, 2019

The matter of route references has been discussed extensively on #596.

Note about half of the hiking and bicycle routes have a ref tag while only a small fraction of highway=footway/path/cycleway do. So @matthijsmelissen's concern on this seems justified.

@jeisenbe
Copy link
Collaborator Author

Thank you for the link to the other issue. I wasn't aware that the route relations were used so extensively in some other countries for walking and cycling routes. While walking and cycling route refs should not be rendered on most highways, it could be appropriate to render the ref found in a relation of type route=bicycle or =mtb on highway=cycleway, and the ref from a route=foot or =hiking would be appropriate for footways.

After reviewing issue #596 "Render Ref from Route Relation", it appears there is not yet a simple way to render the shields and ref numbers from the relations without affecting rendering performance. If I understand the state of the issue, the best solution would require improvements to osm2pgsql discussed at this link: osm2pgsql-dev/osm2pgsql#230 - but no one is currently working on solving this. I don't have the technical ability to solve this issue.

So should we consider this to prevent the rendering of refs for footways and cycleways from the tags on the ways, since we cannot yet render refs from tags on route relations? I could remove these changes from the PR.

@matkoniecz
Copy link
Contributor

* This is most common with long-distance footways and cycleways

This should be tagged as route relations, not directly on highway=* elements, right?

@jeisenbe
Copy link
Collaborator Author

jeisenbe commented Mar 8, 2019

According to several comments above, it is best if "ref=" tags are placed on route relations for footways and cycleways. This requires solving issue #596 before we can render the ref for paths, which could be done best by improving osm2pgsql. See osm2pgsql-dev/osm2pgsql#230

Therefore, I am closing this PR, and will open a new PR with the other changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants