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

Render ref of minor roads more than once #3627

Merged
merged 1 commit into from
Jan 17, 2019
Merged

Conversation

jeisenbe
Copy link
Collaborator

@jeisenbe jeisenbe commented Jan 9, 2019

Changes proposed in this pull request:

  • Modify the code for display of the ref on unclassified and residential highways:
  • Add text-placement: line for ref of minor roads so that the ref will display more than once on a way
  • Remove deprecated text-min-distance, replace with text-repeat-distance instead.

Explanation

  • Currently the reference number of an unclassified or residential highway (aka "minor highway") is only displayed once at the center of the OSM way, because text-placement has not been set to line. This PR will allow ref numbers to display every 760 pixels approximately, as intended.
  • Also, text-min-distance was used, but this has been deprecated in the CartoCSS documentation. This has been changed to use the new recommended option, text-repeat-distance, which is already used for name label rendering in most other parts of roads.mss

Test renderings:

Before
refs-master
ref-10-before

After
refs-res-unclass
ref-10-after

Replace text-min-distance with text-repeat-distance
@jeisenbe
Copy link
Collaborator Author

jeisenbe commented Jan 9, 2019

test.osm.xml.zip
Updated file for testing

@kocio-pl
Copy link
Collaborator

kocio-pl commented Jan 9, 2019

Another thing worth updating should be probably moving rendering them from z13+ to z15+, since they can clutter space when residential details are still not really visible, especially when refs get longer for lower highway classes (as it is in Poland for example):

https://www.openstreetmap.org/#map=13/52.2739/21.0992

tkubap_g

@jeisenbe
Copy link
Collaborator Author

jeisenbe commented Jan 10, 2019 via email

@kocio-pl
Copy link
Collaborator

Thanks, so it looks like another issue. However it would be good to make real tests of residential refs too, so we can see if it could be improved too.

@jeisenbe
Copy link
Collaborator Author

It's tricky to find places where the OSM way is long enough that the ref repeats due to these changes, rather than a new way being started, but there are quite a number of unclassified and even residential roads with a ref in Northern Ireland:

z16 Samsonagh Road (highway=unclassified)
https://www.openstreetmap.org/#map=16/54.3505/-7.7417
Current master

  • Ref renders once, and does not orient to way
    samsonagh-master1

After changes

  • Renders twice (in this 1000 x 500 pixel image), about half as often as the name
    z16-samsonagh-refs-1

highway=unclassified B523, in Londonderry/Derry

z15 After
z15-londonderry-refs

z19 Current

  • at this zoom level we can see just one of the ways
    z19-chapel-road-master

After
z19-chapel-road-refs

@kocio-pl
Copy link
Collaborator

Does this code change rendering ref orientation from "landscape" to "along the road"? It's not clear for me from the description, but it looks like this in latest examples.

@Adamant36
Copy link
Contributor

Adamant36 commented Jan 16, 2019

I take it its from adding text-placement: line; Its interesting that would cause it to also display multiple times.

@kocio-pl
Copy link
Collaborator

I guess it's better solution - refs are less visible that way and for such small roads it makes sense to not stand out too much.

@kocio-pl
Copy link
Collaborator

Example I have found:

https://www.openstreetmap.org/#map=17/52.25744/21.03584

Before

o5y2rqix

After

_gnot3cc

@jeisenbe
Copy link
Collaborator Author

jeisenbe commented Jan 17, 2019 via email

@kocio-pl kocio-pl merged commit 34d6ea1 into gravitystorm:master Jan 17, 2019
@kocio-pl
Copy link
Collaborator

Thanks, I like that refs are less intrusive going along the line. However further tuning is also possible.

@jeisenbe jeisenbe deleted the refs branch January 17, 2019 23:59
@jeisenbe
Copy link
Collaborator Author

Thanks! Now I can test adding refs for highway=track (eg US Forest service roads, which are often unnamed)

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