SomeoneElseOSM / SomeoneElse-style

An "England and Wales rural pedestrian" focused OSM-based map style. Example at https://map.atownsend.org.uk/maps/map/map.html . This is the tag preprocessing part of the style.
GNU General Public License v3.0
9 stars 3 forks source link

Adding hazard warnings to paths #7

Open SK53 opened 4 years ago

SK53 commented 4 years ago

Recent discussion on tagging reminded me that I'd made some very basic experimentation with ideas of how to add hazard warnings to a Carto-Csst style.

I was mainly interested in two types of paths:

I thought there were potentially two types of annotation which could be used to make these clearer:

My very crude approach has been to create a separate hazard layer. This potentially allows ways to be merged so that a single symbol could be shown at smaller scales, as well as creating generic warning text (although this probably should be handled by LUA in the end).

I used "marker-placement: line" with a representative SVG triangle, and "text-placement:line" for the warning text. Both were given a transform to offset them from the line (preferably one on the other side of the line from any name or ref text). This is presumably similar to how you do walking routes, albeit cruder.

I actually cannabilised files I was using to try & add direction arrows on waterways, hence use of [waterway] in second part which contained "stream" or "river".

hazard {

line-width:0; line-color:white;

marker-placement: line; marker-spacing: 150; marker-height: 12; marker-transform: translate(0,15), scale(2,2); marker-file: url("symbols/triangle-stroked-15.svg"); marker-fill: #ff0000; marker-max-error: 0.5;

text-name: "[waterway]"; text-face-name: 'Open Sans Bold'; text-size: 10; text-placement: line; text-spacing: 300; text-dy: -10; text-fill: #ff8800;

marker-fill: #aa0000; }

I failed to find a way to get the triangle to always be upwards with the marker-placement which was where I left it.

Anyway thought I'd actually document these ideas in case you can see a way of taking them further.

SomeoneElseOSM commented 1 year ago

Just a quick note about what's currently implemented at https://map.atownsend.org.uk/maps/map/map.html :

SomeoneElseOSM commented 1 year ago

Just to link to a few other things:

This is a diary entry that discusses some of this. There's a comment on that that links to https://wiki.openstreetmap.org/wiki/United_States/Trail_Access_Project#Suggested_Tagging and discusses how this maps align with those suggestions.

There is a related discussion about "obstacle" here

SomeoneElseOSM commented 5 months ago

(not directly hazard but) this is definitely worth a read.