gravitystorm / openstreetmap-carto

A general-purpose OpenStreetMap mapnik style, in CartoCSS
Other
1.53k stars 821 forks source link

Display platform numbers (ref=* of railway=platform) #3271

Open ghost opened 6 years ago

ghost commented 6 years ago

I think it would be quite useful if platform numbers, i.e. ref=* of railway=platform, were rendered.

kocio-pl commented 6 years ago

We're currently rendering name, so how do you think it should be rendered, ref instead of name or in any other way?

ghost commented 6 years ago

I'd say ref instead of name because the name of the station is already rendered.

boothym commented 6 years ago

Suppose it's a question of whether platforms should be displayed as "Platform X" like here: https://www.openstreetmap.org/#map=19/55.95148/-3.19063 (using name=) or with just their platform number (using ref=) here: https://www.openstreetmap.org/#map=19/51.52932/-0.13498

I'd say it's better with simply their number, in which case osm-carto should render ref instead of name - it would also prevent people tagging for the renderer currently using the name tag.

kocio-pl commented 6 years ago

Sounds reasonable for me. Would any of you like to prepare the code?

ghost commented 6 years ago

I'd like to help, but unfortunately I have only little programming knowledge. :-(

kocio-pl commented 6 years ago

Me too, so that should not be a problem in many cases, it's rather pattern copying and slightly changing them.

The problem is we lack coders in this project, so until somebody actually do it, there's little chance to resolve it.

Adamant36 commented 6 years ago

Theres a way text from multiple fields can be displayed in labels with brackets I was just reading about. Maybe that would be an option. The code for it and an example is about half day down in the link.

https://www.mapbox.com/help/studio-classic-cartocss/

jragusa commented 6 years ago

In France, Germany and Switzerland, ref platform are displayed white in a blue square. We could use the blue square of railway station as a shield like for ref label of road. Once restrained to z19 (z18?) this would not disturb the map and this allows to add the name tag if the latter is different.

boothym commented 6 years ago

I had a look on overpass-turbo for platforms with names in the UK and noticed a couple of things.

Ways with name=* are not rendered, whereas closed ways with names (and area=yes) are rendered. Is it possible to render ref= on single lines as well as closed ways?

Most platforms which have ref=and name= can be described as follows:

So in terms of tagging, should names even be used if they are mostly just duplicating the ref?

DaveF63 commented 6 years ago

My two pennies' worth: Render ref not name Delete name as it's duplicating information which leads to confusion & errors. Don't use "Platform", just a number. I see it as superfluous. It's similar to railway station names where we don't suffix "rail station" to the end of the name.

boothym commented 5 years ago

@kocio-pl I searched the code for "platform" and also looked at other places mentioning "railway", but can't find where the code is which actually renders the name. There is https://github.com/gravitystorm/openstreetmap-carto/blob/1419ef8e0dcdb0863207aedd6a93b5b8e26edfa2/roads.mss#L2132 but it's just the rendering of the area/line. Any ideas?

Plus there's the issue of why name=* renders on an area, but not on a single line.

da1910 commented 5 years ago

Platform text rendering is handled as a roads-area-text-name, which only renders the name on an area over 3000px. To separate this out without retagging requires an exception, but at the moment doing so will remove labels where they are tagged with name. I would support rendering the ref and ignoring the name tag, which I can implement, but it will temporarily remove labels in some cases, like Edinburgh linked above.

boothym commented 5 years ago

I don't think it will take that long to retag the platforms in OSM from name to ref - it shouldn't put you off switching the rendering from name to ref.

Is there a way to make a platform like this - without area=yes - render like it has area=yes? https://www.openstreetmap.org/way/208763467

da1910 commented 5 years ago

I don't see why not, but I'm not sure that that's really the best way to tag platforms? Surely that should be marked as area=yes since it's an actual platform?

boothym commented 5 years ago

Hmm you're probably right - and it would be better if an island platform was mapped as two separate ways so the ref tags can be added to each platform.

It would be great if you were able to do a test render for this, and submit a PR :) Then we can start fixing the platforms in OSM by moving data from name to ref!

boothym commented 5 years ago

Looking again it seems that name=* is not rendered unless the railway=platform is also tagged as area=yes. That's fine for detailed stations where platforms are mapped as a closed way, but not for those with just a line for a platform.

So as well as switching from rendering name to ref, we also need to allow single ways to be rendered with the ref value.

DaveF63 commented 6 months ago

The rules for railway=platform should be the same as for golf=hole where the 'name' tag is rendered if present, otherwise the 'ref' tag is displayed (if present).