diff --git a/cycle_directions.json b/cycle_directions.json new file mode 100644 index 0000000..19cc33a --- /dev/null +++ b/cycle_directions.json @@ -0,0 +1,125 @@ +{ + "type": "overpass", + "name": { + "de": "Radwegrichtungen", + "en": "Cycleway Directions" + }, + "query": { + "14": [ + "(", + "way[highway=cycleway];", + "way[cycleway];", + "way[\"cycleway:left\"];", + "way[\"cycleway:right\"];", + ")" + ] + }, + "feature": { + "pre": [ + "{% set oneway = 0 %}", + "{% if tags.oneway in [ 'yes', '1' ] %}{% set oneway = 1 %}", + "{% elseif tags.oneway in [ '-1' ] %}{% set oneway = -1 %}", + "{% endif %}", + "", + "{% set driving_side = 'right' %}" + ], + "markerSymbol": null, + "listMarkerSymbol": "line", + "styles": "default,left,right", + "style": { + "color": [ + "{% if tags.highway == 'cycleway' %}", + "#007f00", + "{% endif %}" + ], + "text": [ + "{% if tags.highway == 'cycleway' and oneway == 1 %}", + "🡪 ", + "{% elseif tags.highway == 'cycleway' and oneway == -1 %}", + "🡨 ", + "{% elseif oneway == 1 and tags.cycleway in [ 'opposite' ] %}", + "🡨🡺 ", + "{% elseif oneway == 1 and not tags.cycleway and not attribute(tags, 'cycleway:left') and not attribute(tags, 'cycleway:right') and attribute(tags, 'oneway:bicycle') == 'no' %}", + "🡨🡺 ", + "{% elseif oneway == -1 and tags.cycleway in [ 'opposite' ] %}", + "🡸🡪 ", + "{% elseif oneway == 1 and not tags.cycleway and not attribute(tags, 'cycleway:left') and not attribute(tags, 'cycleway:right') and attribute(tags, 'oneway:bicycle') == 'no' %}", + "🡸🡪 ", + "{% elseif oneway == 1 %}", + "🡺 ", + "{% elseif oneway == -1 %}", + "🡸 ", + "{% endif %}", + "" + ], + "textRepeat": "1" + }, + "style:highlight": null, + "style:left": { + "color": [ + "{% if tags.oneway in [ 'yes', '1' ] and tags.cycleway in [ 'opposite_lane' ] %}", + "#00ff00", + "{% elseif tags.oneway in [ 'yes', '1' ] and tags.cycleway in [ 'opposite_track' ] %}", + "#00af00", + "{% endif %}" + ], + "offset": "-3", + "text": [ + "{% if attribute(tags, 'cycleway:left') in [ 'lane', 'shared_lane', 'track' ] %}", + "🡪 ", + "{% elseif attribute(tags, 'cycleway:left') in [ 'opposite_lane', 'opposite_track' ] %}", + "🡨 ", + "{% elseif driving_side == 'right' and oneway <= 0 and tags.cycleway in [ 'lane', 'shared_lane', 'track' ] %}", + "🡪 ", + "{% elseif driving_side == 'left' and oneway >= 0 and tags.cycleway in [ 'lane', 'shared_lane', 'track' ] %}", + "🡨 ", + "{% elseif driving_side == 'right' and oneway <= 0 and tags.cycleway in [ 'opposite_lane', 'opposite_track' ] %}", + "🡨 ", + "{% elseif driving_side == 'left' and oneway >= 0 and tags.cycleway in [ 'opposite_lane', 'opposite_track' ] %}", + "🡪 ", + "{% endif %}" + ] + }, + "style:right": { + "color": [ + "{% if tags.cycleway in [ 'lane' ] or attribute(tags, 'cycleway:right') in [ 'lane', 'opposite_lane' ] %}", + "#00ff00", + "{% elseif tags.cycleway in [ 'track' ] or attribute(tags, 'cycleway:right') in [ 'track', 'opposite_track' ] %}", + "#00af00", + "{% endif %}" + ], + "offset": "3", + "text": [ + "{% if attribute(tags, 'cycleway:right') in [ 'lane', 'shared_lane', 'track' ] %}", + "🡪 ", + "{% elseif attribute(tags, 'cycleway:right') in [ 'opposite_lane', 'opposite_track' ] %}", + "🡨 ", + "{% elseif driving_side == 'right' and oneway >= 0 and tags.cycleway in [ 'lane', 'shared_lane', 'track' ] %}", + "🡪 ", + "{% elseif driving_side == 'left' and oneway <= 0 and tags.cycleway in [ 'lane', 'shared_lane', 'track' ] %}", + "🡨 ", + "{% elseif driving_side == 'right' and oneway >= 0 and tags.cycleway in [ 'opposite_lane', 'opposite_track' ] %}", + "🡨 ", + "{% elseif driving_side == 'left' and oneway <= 0 and tags.cycleway in [ 'opposite_lane', 'opposite_track' ] %}", + "🡪 ", + "{% endif %}" + ] + } + }, + "info": [ + "", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + "
{{ markerLine(evaluate({ \"highway\": \"cycleway\" }))|raw }}{{ tagTrans('highway', 'cycleway') }}
{{ markerLine(evaluate({ \"cycleway\": \"track\" }))|raw }}{{ tagTrans('cycleway', 'track') }}
{{ markerLine(evaluate({ \"cycleway\": \"lane\" }))|raw }}{{ tagTrans('cycleway', 'lane') }}
" + ] +}