gravitystorm / openstreetmap-carto

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

Render barrier=bollard on lines as dots #1908

Open valhentai opened 9 years ago

valhentai commented 9 years ago

In the French rendering of OSM (http://tile.openstreetmap.fr/), discontinious barrier such as bollard are rendered as dots instead of a line. It allow user to make a difference between unpassable barrier like a wall and barrier which allow pedestrians and bike to pass like bollard. bollard

HolgerJeromin commented 9 years ago

That would prevent such funny tagging (multiple bollard nodes): This is probably a correct tagging. http://www.openstreetmap.org/?mlat=50.77814&mlon=6.06655#map=19/50.77814/6.06655

matkoniecz commented 9 years ago

fr style renders specially only barrier=bollard (see https://github.com/cquest/osmfr-cartocss/blob/master/other.mss#L3626)

Is there also other discontinuous barrier type that may be worth supporting?

HolgerJeromin commented 9 years ago

barrier=block would make sense IMO, is not defined on ways in wiki but has 2300 in the DB.

barrier=spikes perhaps. has only 6 instances in the DB.

dieterdreist commented 9 years ago

2015-10-11 20:32 GMT+02:00 Holger Jeromin notifications@github.com:

That would prevent such funny tagging (multiple bollard nodes):

http://www.openstreetmap.org/?mlat=50.77814&mlon=6.06655#map=19/50.77814/6.06655

why is that "funny"? in the meantime someone has deleted these bollards. Given that they are there, I'd consider this vandalism. It is one thing to render bollard lines in some way, and it is another to have the actual positions of multiple bollards (i.e. more information). Bollards are mostly interesting for routing, but not only, each of them is a feature as well.

AFAIK this style already renders bollard lines as dots along the line, but I'd encourage people to map actual bollards, not sets of them (in many cases, according to the situation).

matkoniecz commented 9 years ago

in the meantime someone has deleted these bollards. Given that they are there, I'd consider this vandalism.

It is better to discuss it at http://www.openstreetmap.org/changeset/34743220#map=19/50.77841/6.06722 which seems to be a relevant changeset.

HolgerJeromin commented 9 years ago

I deleted the four nodes and merged the middle bollard to the highway (so it is usable in the routers and not only nice on a rendering).

But you are probably right. If they are there, they should stay. I just restored them.

dieterdreist commented 9 years ago

sent from a phone

Am 21.10.2015 um 11:03 schrieb Holger Jeromin notifications@github.com:

I just restored them.

thank you. Yes, on bollard should be part of the highway to make it usable.

HolgerJeromin commented 9 years ago

AFAIK this style already renders bollard lines as dots along the line

No, it does not: http://www.openstreetmap.org/way/326841609

dieterdreist commented 9 years ago

Am 21.10.2015 um 11:26 schrieb Holger Jeromin notifications@github.com:

AFAIK this style already renders bollard lines as dots along the line

No, it does not: http://www.openstreetmap.org/way/326841609

maybe a regression, I believe to recall it once did...

valhentai commented 5 years ago

barrier=kerb can also have a different rendering. Currently it has the same rendering as barrier=wall so there is no difference between a kerb and a wall on the map.

It could be rendered as a dashed line. Here is a example of the french cadastre were the dashed lines are kerbs.

kerb_cadastre

Adamant36 commented 5 years ago

"barrier=kerb can also have a different rendering"

I was thinking about something similar to that myself. You should open a new issue for it.

valhentai commented 5 years ago

Done https://github.com/gravitystorm/openstreetmap-carto/issues/3714

jeisenbe commented 5 years ago

I looked into the options for rendering barrier=bollard when mapped as a line.

The wiki page for barrier=bollard and the key page for barrier both mention that lines of bollards can be mapped with a way. There are 11,232 ways mapped.

I downloaded all of the ways tagged with barrier=bollard in England. There are 727 linear ways and only 4 closed ways, so it appears that most of the ways are mapped appropriately. In England there appear to be 2 main types of bollards mapped with a way:

1) short lines of bollards across a single road. This is often also mapped with barrier=bollard on a node shared with the highway way.

2) Longer lines of bollards parallel to a road, usually preventing vehicles from entering a sidewalk or pedestrian area. These would be a pain to map one node at a time.

There are also some bollards mapped around an object (such as a tree or statue in a traffic circle), and sometimes there are lines of bollards across a pedestrian square, park or parking lot, not by a highway.

Both 1) and 2) have difficulties with rendering at lower zoom levels, because line barriers render below the highway. If the line of bollards across a road is short, it will not be visible at z17 and below. If a line of bollards parallel to a road is too close to the road, it will overlap with the road rendering at z17. For this reason, I'd suggest only rendering bollards mapped as ways on z18 and higher.

(The French style shows them from z17, but I don't think they are as concerned with the rendering near the equator. )

Early test renderings (with lines) at z17: z17-common-bollards-after vs z18: z18-common-bollards-after

z17 - only the bollard mapped as a node is shown (it renders above the highway): z17-castle-st-bollards-after compare z19: z19-castle-st-bollards-after

jeisenbe commented 5 years ago

There are two ways to render this. My few tests (as in the first 2 images above) used line renderings, with the line-width set to 3 or 4 pixels (based on zoom level) and line-dasharray: 0.1,8, with line-cap: round - it turns out the French style does the same thing to produce nearly-circular dots, spaced 8 pixels apart.

This looks very similar to the bollard rendering on nodes (which uses a 3 or 4 pixel width circular marker), but does not block the display of other markers. However, this means that sometimes the dots merge together where 2 lines meet, eg:

z19 - traffic circle in Germany with a line of bollards around a central tree z19-modified-french-circle-barrier z18 lines z18-bollard-circle-french

The alternative is to use a circular marker-symbol, identical to that used for bollards mapped as points, and have it spaced 8 pixels apart along the line, with marker-placement: line and marker-spacing: 8. This prevents the dots from touching or overlapping at intersections of lines, or overlapping with other symbols: z19 markers z19-circle-bollards-marker z18 markers z18-circle-bollards-marker

However, since the markers are placed based on the center of the line, rather than starting at one end like a line features, the markers are more likely to be covered by the highway when going across, especially at z18: z18 marker-placement: line z18-castle-st-marker

It's also possible to have a marker placed on the first and last point of the line, with marker-placement: vertex-first and marker-placement: vertex-last - using 2 additional attachments in the same layer. Then the rest of the line can be rendered with marker-placement: line to fill in the points between. But then the dots are not evenly spaced, which doesn't look great: z19 marker-placement: vertex-first & marker-placement: vertex-last z18-vertex-first-last-castle-st z19 marker-placement: vertex -last and line z19-castle-st-vertex

To get a perfect rendering I suppose we would need to generate a set of nodes from the line geometry, adjusting the spacing to be even, but that's probably too complicated for this style (and for my SQL abilities)

jeisenbe commented 5 years ago

Any comments on if the line rendering with line-dasharray or the marker rendering is superior performance-wise?

Also, unless marker-ignore-placement: true is used, the bollard dots will prevent other icons from rendering, for example a gate: z19-gate-blocked-by-bollards

With marker-ignore-placement: true it still renders: z19-marker-ignore-placement

imagico commented 5 years ago

Quick general comment: You should try to avoid confusion between line signatures (however they are produced technically) and individual mapped geometries.

A similar problem was already discussed in #1753.

jeisenbe commented 5 years ago

try to avoid confusion between line signatures (however they are produced technically) and individual mapped geometries.

I'd been thinking about this. Initially I tried significantly increasing the spacing between dots between zoom levels, but this could suggest they represent nodes. By using similar pixel spacing between the dots at z18 and z19 the position of the dots changes in relation to the other mapped features between zoom levels, so this helps to show that it is an abstract pattern.

I think long lines of bollards will not be confused with individually mapped nodes, because of this.

The issue is mainly with very short lines, which are often used crossing a road, where only a few dots will be visible, and perhaps only at z19.

We could select the length of the way and use this to adjust the rendering: short lines (less than 16 pixesl long) could have nodes only rendered on their first and last node, while longer ways would be rendered with marker-placement: line. The first and last node of the way should be co-incident with a bollard (otherwise it's a non-verifiable geometry).

But that might be too much code complexity for a minor problem.

jeisenbe commented 5 years ago

I've tried opening an issue at Mapnik, requesting a way to evenly space markers between vertices of a line: https://github.com/mapnik/mapnik/issues/4082

However, we could try one of the two options above for now: https://github.com/gravitystorm/openstreetmap-carto/issues/1908#issuecomment-482495411

Talkless commented 1 year ago

Rendering way of bollard's still not supported right? https://www.openstreetmap.org/way/1170465069