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 missing oneway arrows for tracks and paths #3614

Merged
merged 8 commits into from
Feb 12, 2019

Conversation

jeisenbe
Copy link
Collaborator

@jeisenbe jeisenbe commented Dec 31, 2018

Fixes #2865
Fixes #1937

Changes proposed in this pull request:

  • Add missing oneway arrows for tracks and paths
  • Fixed rendering of arrows on footways: these will always use the footway color, rather than changing if there is (mis)-tagging with designated=bicycle or designated=bridleway.
  • Fixed bridleway one-way arrow color. It is now based on brideway color instead of track color.

EDITED: New changes

  • Change arrows to Unicode text with halo for better visibility.
  • Adjust position of text based on oneway = -1 to make sure text is always on the same side of one-way paths and tracks

Test rendering:

(First option, without change to unicode text arrows and halos)

Before
oneway-master

After - first option
path-oneway-after

EDITED: Current commit:

Copy link
Collaborator

@pnorman pnorman left a comment

Choose a reason for hiding this comment

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

It's not very legible on steps. I'm not convinced about the cartography of the others, but steps are the worst.

@jeisenbe
Copy link
Collaborator Author

jeisenbe commented Jan 1, 2019

  1. Here's the current commit (steps darkened 35% and bridleway darkened 15%, based on the line fill color) at z17. The paths are the same width as at 16, but this image lets us see three arrows instead of 2. (The track is visible at top but horizontal)
    z17-oneway-after-35-15

  2. Here's a slightly darker version: step arrows darkened 45% and bridleway arrows darkened 20%:
    z16
    z16-paths-oneway-darker-45-20

z17
z17-paths-oneway-darker-45-20

  1. Even darker version: step arrows darkened 50% and bridleway arrows darkened 25%:
    z16
    z16-darker-50-25
    z17
    z17-darker-50-25

@pnorman would you like to see changes for footway, cycleway or highway=track as well? I think there is some utility in matching the arrows to the color of the highway=* in cases where there are parallel paths close together, but slightly darkened arrows would still be readable as related to the original color.

@jeisenbe
Copy link
Collaborator Author

jeisenbe commented Jan 1, 2019

Here's another test area, showing all 5 different track grades with the track oneway arrows. This also allows us to see the other arrows in a different orientation.

  1. Steps 35%, Bridleway 15% (current commit)
    tracktype-arrows-35-15

  2. Steps 45%, Bridleway 20%
    tracktype-45-20

  3. Steps 50%, Bridleway 25%
    tracktype-50-25

  4. Every arrow darker: footway 40%, steps 45%, cycleway 30%, track 20%, bridleway 20%
    (these are all 5% darker than the current code, except for steps which is 10% darker)
    arrows-40-45-30-20-20

@jeisenbe
Copy link
Collaborator Author

jeisenbe commented Jan 1, 2019

Another cartographic option is to move the arrows off of the line. This makes it possible to keep the arrows close to the path fill color. It looks especially good for one-way cycleways or paths which parallel a road on both sides - but only for one direction of travel; left-hand or right-hand (i.e. Continental vs British Empire). 65% of the world population travels on the right-hand side of the highway - not an overwhelming majority.

Right-hand:
right-tracktype-oneway-arrows-translate

Left-hand:
left-tracktype-oneway-arrows-translate

z16
z16-oneway-arrows-translate

z17
z17-oneway-arrows-translate

Circular and curved roads and paths:
circles-oneway-arrows-translate

Compared to the previous idea with darker arrows (all darkened 5%, except steps 10%)
circles-oneway-arrows-darken

@jragusa
Copy link
Contributor

jragusa commented Jan 1, 2019

Arrows of bridleway and track (especially tracktype=1-4) are not well readable when located along the path

@HolgerJeromin
Copy link
Contributor

Would/should fix #1937 too

@Adamant36
Copy link
Contributor

I like the idea of it being on the side of the path. Except where the symbol would overlap a road, like in the second to last test rendering. It would be interesting to see another exemple like that where the road is also one way. It would probably be either A. confusing or B. one arrow would out render the other.

@jeisenbe, wasnt there a propsal a while back to make track roads or paths render more like regular roads since they aren't very visible in the first place (I think like the German style or something)? Maybe its worth revisiting. I kind of like the idea. It would give a better area for the arrows and showing paved or not later. As it is, on the path doesnt look great and off has its own issues.

@jeisenbe
Copy link
Collaborator Author

jeisenbe commented Jan 1, 2019 via email

@Adamant36
Copy link
Contributor

I can understand that. From my experience openstreetmap-carto and simple fixes don't usually go together, but its always worth a try anyway ;)

@HolgerJeromin
Copy link
Contributor

I had hoped this could be a simple fix, because it was meant to revert the arrows to the way they used to be rendered a year ago.

Did you found out with which commit we lost the arrows?

@jeisenbe
Copy link
Collaborator Author

jeisenbe commented Jan 2, 2019 via email

@Adamant36
Copy link
Contributor

Adamant36 commented Jan 2, 2019

You might be able to do an advanced search in the search box for any closed PR that has a specific word in the code. Or if not, at least by commit message. https://help.github.com/articles/searching-issues-and-pull-requests/

I know it at least does it by key words in PR messages.

@matthijsmelissen
Copy link
Collaborator

I wonder if there is a way on git or github to find the last change to a
line of code?

Git: git blame [filename]
Github: navigate to the file, click the Blame button

@matthijsmelissen matthijsmelissen changed the title Add missing oneway arrows for tracks and paths [WIP] Add missing oneway arrows for tracks and paths Jan 2, 2019
@jeisenbe
Copy link
Collaborator Author

jeisenbe commented Jan 3, 2019

Related to
#1937 - we could try using a "halo" around the arrows. I've checked the Mapnik/CartoCSS documentation, and there isn't a halo function for SVG icons or markers. So we would need to modify the oneway.svg file and oneway-reverse.svg to have a white, 0.5 pixel area with perhaps 50% opacity around the arrow. But I don't know if it is possible to do this and then still change the fill color for each type of arrow. We could make a separate svg file for each type of path, but this would make the style harder to adapt and maintain.

Any ideas about how to do this?

Otherwise, darkening the arrow color and moving the arrows off of the line are the two best options, as shown above.

Fixed rendering of arrows on footways: these will always use the footway color, rather than changing if there is designated=bicycle or designated=bridleway
Fix bridleway arrow color: based on brideway color instead of track color now.
Fix merge conflict in project.mml
Also check for oneway = -1 to make sure text and arrows are on the correct side of the path

Fix whitespace & simplify oneway arrow code for paths
@Adamant36
Copy link
Contributor

(Or go the more complicated but good route and change paths to render more like roads first. Then this wouldnt be an issue. Plus, there would be other benefits)

@jeisenbe
Copy link
Collaborator Author

jeisenbe commented Jan 3, 2019

I've pushed several commits that show the code changes for the different options in the previous test renderings. The most recent commit has the arrows off of the path.

@jeisenbe
Copy link
Collaborator Author

jeisenbe commented Jan 3, 2019

(Or go the more complicated but good route and change paths to render more like roads first. Then this wouldnt be an issue. Plus, there would be other benefits)

That's also an interested idea, I forgot about that. I've just downloaded the German and French styles to see how they work, but I thought it may have only been the footways that were changed? There still might be an issue with track roads, bridleways and cycleways to consider.

@jeisenbe
Copy link
Collaborator Author

jeisenbe commented Jan 4, 2019

Here are some real-world renderings in the Netherlands, land of the cyclepath:

This road is only a few meters wide and has one-way cycle paths immediately next to it, so they overlap with the road rendering. This is a challenging rendering situation:
https://www.openstreetmap.org/#map=17/52.34378/5.20680
z19 arrows darkened, on cycle paths
z19-meerveldstaat-on
z19 arrows to side of cycle paths
z19-meerveldstraat-side

At z18 the version with the arrows to the side could be confusing, because the path is partially covered by the road. This is an unusual situation but can happen with a one-lane road like this.
z18 arrows on path, darkened
z18-meerveldstraat-on

z18 arrows to side
z18-meerveldstraat-side

This bridge is a more reasonable width: 10 meters between the center of the two cycleways (33 feet)
https://www.openstreetmap.org/#map=18/52.33349/5.22320
z18 on path, darkened
z18-sluiskade-on
z18 arrows to side
z18-sluiskade

A one-way path (MTB trail?):
https://www.openstreetmap.org/#map=17/52.40464/5.33439
z17 on
z17-mtb-path-on
z17 side
z17-mtb-path-side

One-way footway(?):
https://www.openstreetmap.org/#map=18/52.53644/5.70264
z19 on
z19-oneway-footway-on
z19 side
z19-footway-oneway-side

One-way track road:
https://www.openstreetmap.org/#map=19/52.35675/5.22666
z19 on
z19-track-oneway-on
z19 side
z19-track-oneway-side

@Adamant36
Copy link
Contributor

I think originally it was for footways. Track roads etc could be more view-able though and they would also benefit from paved/unpaved rendering later on. A while back I was screwing with an idea of having them render similar to normal roads, but with the brown colored dashes (or whatever they are) larger and inside of the road (I've always wondered why that wasn't explored as an option for showing paved/unpaved).

Kind of like this
path

@jeisenbe
Copy link
Collaborator Author

jeisenbe commented Jan 4, 2019

One-way steps (an escalator in a mall in Harburg, Germany):
https://www.openstreetmap.org/#map=18/53.45756/9.98706
Arrows on steps
steps-oneway-on

Arrows to side
steps-oneway-side

@jragusa
Copy link
Contributor

jragusa commented Jan 4, 2019

When looking to the MTB trail example, I'm wondering if it would be better to also apply opacity to arrows

@Adamant36
Copy link
Contributor

@jragusa, see #3614 (comment)

@jeisenbe
Copy link
Collaborator Author

jeisenbe commented Jan 10, 2019 via email

@pnorman
Copy link
Collaborator

pnorman commented Jan 10, 2019

I haven’t been able to find the PR where the arrows were removed. I tried git blame but it wasn’t clear what happened.

I'd go for using git bisect to try to narrow it down. It's a bit more of a pain, but can work better where bisect fails.

Is there a clear division between footway and highway=path which requires that footways be exclusively for the use of pedestrians?

For the purpose of this style, highway=path is turned into highway=footway or highway=cycleway.

@HolgerJeromin
Copy link
Contributor

Perhaps oneway=no is more interesting to render. But i have not checked the usage

@jeisenbe
Copy link
Collaborator Author

jeisenbe commented Jan 10, 2019 via email

@imagico
Copy link
Collaborator

imagico commented Jan 10, 2019

Ok, i will try to comment without making assumptions on if parts of this is a bug fix or not.

To me oneway arrows on steps definitely make sense. In particular for escalators where up and down might be separated and it is important for navigation to know which is which.

But for escalators there is also conveying=* which is more common than oneway (not sure how many have both). Also often a direction arrow is of little help with steps when incline=* is not rendered. So improving rendering of steps to be more meaningful is kind of a separate matter.

Almost 10 percent of highway=cycleway (100k) have oneway=yes but only 6000 of nearly 10 million footways. path: 20k of 7 million (many of them probably foot=designated + bicycle=designated), track 5600 of 15.7 million, bridleway: less than 1000.

I see the problem mainly in that cycleways are the primary use case here and there are practical cases where showing oneway arrows is useful - like a large street crossing with various direction segregated cycleway links where oneway arrows would be good to have and important for feedback or downhill mountainbike routes but this strongly interferes with local implicit rules. In Germany for example all road parallel cycleway are legally oneway for bicycles unless designated otherwise. Therefor tagging those oneway=no makes more sense and showing this like @HolgerJeromin would be more significant.

Oneway footways are a highly specialized thing and usually not really a legal "you may not go in the other direction" but more of a "this is the normal direction you are expected to go of you do not want people to think you are weird".

For track and bridleway i don't know. Would be helpful if someone would extract those 5.6k from a planet file for reviewing.

In general when showing oneway arrows for non-motorized traffic it might also make sense to start later than z16.

I am not opposed to this change as is but my recommendation in principle would be to separate into different matters (which could of course all be tackled either with or without this PR merged):

  • more meaningful rendering of steps possibly indicating conveying=, incline= and oneway=*
  • rendering of direction restrictions and permissions on cycleways taking into account that there are implicit defaults that likely vary between countries
  • analyzing the quality of oneway tagging on track, bridleway and footway if it makes sense to render oneway arrows on those.

@jeisenbe
Copy link
Collaborator Author

jeisenbe commented Jan 10, 2019 via email

This was unintentionally removed and would prevent the rendering of name labels for under-constructions paths
Simplify current PR by removing the changes to text-dy for path name labels, which had been intended to make sure that the text was always on the same side as the arrows if these were rendered next to the line
@jeisenbe
Copy link
Collaborator Author

I removed a minor change to the text-dy for path name labels, which would have been necessary if using arrows next to the path rather than on top of it, but is no longer needed, and I fixed a mistake that would have stopped the rendering of the names of under-construction paths. I believe everything is now working properly.

@matthijsmelissen
Copy link
Collaborator

I'm holding of merging this until we find out when and why the arrows were removed in the first place. Would be great if somebody could find this back.

@jeisenbe
Copy link
Collaborator Author

jeisenbe commented Jan 12, 2019 via email

@matthijsmelissen
Copy link
Collaborator

@jeisenbe git bisect bisects the history, which means starting in 2015 goes very fast. If you start in 2015, after one step you already will know if it was before or after 2017, and after two steps you will know if it was before or after 2018, etc.

@jeisenbe
Copy link
Collaborator Author

I believe the bug was introduced in Commit e455ee4 - "Move one way arrow rendering from several roads fill related layers to roads-text-name, so arrows get lower precedence than names. As the arrow symbol is quite small, most of the time it can still be squeezed in."
PR #2320

@jeisenbe
Copy link
Collaborator Author

Also it looks like #2342 fixed the rendering of one-way arrows on roads, but probably it was missed that they were still not rendering on paths.

There was never any discussion about removing the rendering of oneway arrows from paths; this was an unintentional change.

@jeisenbe
Copy link
Collaborator Author

Oneway cycleways are common, but practically always oneway cycleways have an opposite cycleway right next to it (on the opposite side of the road)

Perhaps this is true in the Netherlands, which has world-renowned bicycle infrastructure However, the UK, USA and other English-speaking countries are notorious for having one-way cycleways only on one side of a street (you get to ride with motor vehicle traffic on the other side), and having complicated ways to access one-way cycle paths on bridges, and at major intersections.

We also have a number of one-way mountain bike trails.

Another situation that has been mentioned are one-way "via ferrata" in the mountains, foot/climbing paths.

@jeisenbe
Copy link
Collaborator Author

I checked Singapore, which is relatively well-mapped. There are 111 ways tagged with oneway=yes and highway=path, =cycleway, =footway, =steps, or =track. Cycleway and footway have 39 each, the rest have 6 to 13 occurrences. These examples are the first I found. There are no examples of parallel one-way paths or cycleways on opposite sides of a street, but there are a number of one-way mountain bike paths, one-way pedestrian bridges and steps (at the international border, in a zoo and in a park), and one-way circles for bike and golf carts.

z19 Create Tower oneway bicycle path
https://www.openstreetmap.org/#map=19/1.30357/103.77436

  • If you want to go west you can ride on the main roadway; bicycle=yes
    z19-create-tower-cyclepath

z17 Chestnut Point Mountain Bike trails
https://www.openstreetmap.org/#map=17/1.3717944/103.7798446
z17-chestnut-point-mtb-oneway

z17 Singapore Island Country Club golf cart path
https://www.openstreetmap.org/#map=17/1.3637611/103.826251
z17-singapore-country-club-path

z16 HSBC-sponsored "Treetop Walk" (wooden path thru the trees and up hills)
https://www.openstreetmap.org/#map=17/1.36139/103.8094101
z16-hsbc-treetop-walk

z18 Woodlands checkpoint (international border)
https://www.openstreetmap.org/#map=18/1.4455896/103.7688039

  • You probably don't want to try going the wrong way on these paths and steps!
    z18-woodlands-checkpoint-paths-steps
    z19
  • You can see that the path and steps lead from the bus to the building entrance, where your passport is checked. On the other side you walk back to another bus stop.
    z19-woodlands-checkpoint-path-steps

z16 Pulau Ubin track road "Jalan Durian"
https://www.openstreetmap.org/#map=16/1.410072/103.982814

  • An agricultural/forestry road in the city-state of Singapore?! Well, this is another small island that was used as a quarry and is now preserved for recreation and nature.
    z16-jalan-durian-pulau-ubin

@jeisenbe
Copy link
Collaborator Author

I searched a couple more areas. Basilicata (southern Italy) had only a handful of cycleways, and none that were one-way. There were couple of one-way paths near a zip-line:

z16 Marcirosa path near Castelmezzano, Basilicata, Italy
z16-castelmezzano-path-marcirosa

In Washington DC there are a handful of one-way cycleways, usually on the left side (!) of a one-way street, such as the L Street Cycle Track: (https://www.openstreetmap.org/#map=18/38.90402/-77.04310)
l-street-cycle-track-oneway

The only oneway footpaths were these sidewalks, which are certainly mistagged. However, I suppose it is still helpful to show the arrows in this case, so that mappers realize there is a problem, rather than being puzzled when a routing app sends them the long way around:
z17-eckington-place-sidwalks-oneway

@jeisenbe
Copy link
Collaborator Author

jeisenbe commented Jan 17, 2019

Bremen, Germany - there are a number of cycleways and paths, and a few tracks and footways with oneway=yes

https://www.openstreetmap.org/#map=17/53.09655/8.87581

  • One-way highway=footway with footway=sidewalk, foot=designated and bicycle=yes
    z17-berckstrathe-footway-oneway

https://www.openstreetmap.org/#map=18/53.08297/8.79848

  • One-way paths along causeway/bridge over historic moat, connecting to one-way and two-way cycleways. Note that the cycleway along the north side of Eduard-Schopf-Allee is specifically tagged oneway=no, as is the path along the northeast side of Doventorscontrescarpe
    z18-doventorscontrescarpe

https://www.openstreetmap.org/#map=16/53.0723428/8.8427867

  • There are one-way cycleways only along some parts of the southern street (Hamburger)
  • Still visible at z16 distinctly
    z16-hamburger-stra-oneway-cycleways

https://www.openstreetmap.org/#map=16/53.0681/8.7594

  • One-way track roads in allotments
    z16-bremen-allotments-tracks-oneway

@jeisenbe
Copy link
Collaborator Author

Canberra, Australia

This capital city was purpose-built in mid-century style, with lots of motorways and roundabouts, including a motorway circling the parliament buildings. I guess they didn't think much about air pollution back then?

I've shown the first 2 oneway cycleways and paths that I found by randomly searching. There was only one footway with oneway=yes, and no tracks or bridleways (which are quite rare in this area).

Cycleways

  • Most of the oneway cycleways that I saw in Canberra are like these; short connectors that let bike riders avoid traffic circles:

https://www.openstreetmap.org/#map=18/-35.42391/149.07949
z18-drakeford-dr-circle-oneway-cycleway

https://www.openstreetmap.org/#map=18/-35.16602/149.13933
z18-mulligans-flat-cycleways

Paths

  • most of the oneway paths are MTB trails (which may also be open to people on foot? This is not tagged either way):

https://www.openstreetmap.org/#map=17/-35.25670/149.10143
z17-daviesia-up-down-paths

https://www.openstreetmap.org/#map=16/-35.3146/149.0181
z16-mt-stromlo-mtb-paths

Footway

  • This is the only oneway footway in the city. While it could be mistagged, it is right in front of the parliament building, by a "formal garden", so perhaps this one-way restriction is correct?

z17-parliament-house-footway

@matthijsmelissen
Copy link
Collaborator

As this reverts an unintended change, I'd be happy to accept this PR (and certainly the part of the PR reverting this change).

I don't have time for a full review now though, is anyone else willing to help with that?

@jeisenbe
Copy link
Collaborator Author

@jragusa
Copy link
Contributor

jragusa commented Feb 2, 2019

Since track/path/cycleway are thinner than highway=residential/tertiary/..., why not shift arrows for the formers to z18 ? They look prominent in the two first pictures.

@jeisenbe
Copy link
Collaborator Author

jeisenbe commented Feb 2, 2019 via email

@matthijsmelissen
Copy link
Collaborator

Thanks for this PR, and sorry for the wait!

@matthijsmelissen matthijsmelissen merged commit 9d3e0de into gravitystorm:master Feb 12, 2019
@jeisenbe
Copy link
Collaborator Author

jeisenbe commented Feb 12, 2019 via email

@jengelh
Copy link

jengelh commented Feb 14, 2019

The choices made in osm-carto are generally well researched, and I am impartial to the arrow style. Just an inquiry though, did you consider JOSM style arrows (triangle with a colored outline), and if so, what was your opinion of those?
josmarrow

@jeisenbe
Copy link
Collaborator Author

jeisenbe commented Feb 14, 2019 via email

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.

8 participants