| | 1 | This style visualizes the surface=* and smoothness tags on highways. Currently it does the following: |
| | 2 | |
| | 3 | - show highways that neither have surface=* or smoothness=* as solid black |
| | 4 | |
| | 5 | - with the smoothness tag render a |
| | 6 | - blue thin line for smoothness=excellent |
| | 7 | - move from green (=good) to red (=impassable) for the rest of smoothness values, at the same time thicken the way and use dashed stiles as smoothness values |
| | 8 | |
| | 9 | - with the surface tag render a |
| | 10 | - soft white halo (but only for values paved|asphalt|concrete|concrete_pavers) |
| | 11 | - for the rest render the value with text (light brown for dirt, ground, mud, light green for grass, etc..) |
| | 12 | |
| | 13 | - do not render text for the most common values (excellent, good, asphalt, paved) as they are easily identifyable by color code and would distract from the problem zones |
| | 14 | |
| | 15 | |
| | 16 | Best regards, |
| | 17 | cmuelle8 |
| | 18 | |
| | 19 | |
| | 20 | ps: if you need more styles, or have more professional needs, give me a holler via http://www.openstreetmap.org/message/new/cmuelle8 |
| | 21 | |
| | 22 | |
| | 23 | {{{ |
| | 24 | #!style type="mapcss" |
| | 25 | |
| | 26 | meta |
| | 27 | { |
| | 28 | title: "Surface"; |
| | 29 | description: "Visualize surface=* of objects"; |
| | 30 | version: "[[revision]]_[[date]]"; |
| | 31 | author: "cmuelle8"; |
| | 32 | |
| | 33 | watch-modified: true; |
| | 34 | } |
| | 35 | |
| | 36 | meta[lang=de] |
| | 37 | { |
| | 38 | title: "Oberflächenbeschaffenheit"; |
| | 39 | description: "Oberflächenbeschaffenheit, etwa von Wegen, hervorheben"; |
| | 40 | } |
| | 41 | |
| | 42 | canvas |
| | 43 | { |
| | 44 | background-color: #606060; |
| | 45 | } |
| | 46 | |
| | 47 | |
| | 48 | |
| | 49 | node |
| | 50 | { |
| | 51 | symbol-shape: square; |
| | 52 | symbol-size: 2; |
| | 53 | symbol-stroke-color: white; |
| | 54 | symbol-stroke-opacity: 0.1; |
| | 55 | } |
| | 56 | |
| | 57 | node:connection |
| | 58 | { |
| | 59 | symbol-shape: square; |
| | 60 | symbol-size: 2; |
| | 61 | symbol-stroke-color: white; |
| | 62 | symbol-stroke-opacity: 0.1; |
| | 63 | } |
| | 64 | |
| | 65 | way |
| | 66 | { |
| | 67 | width: 1; |
| | 68 | color: #FF0000; |
| | 69 | opacity: 0.0; |
| | 70 | } |
| | 71 | |
| | 72 | way[landuse]:closed |
| | 73 | { |
| | 74 | fill-color: yellow; |
| | 75 | fill-opacity: 0.02; |
| | 76 | z-index: -0.9; |
| | 77 | } |
| | 78 | |
| | 79 | way[natural]:closed |
| | 80 | { |
| | 81 | fill-color: green; |
| | 82 | fill-opacity: 0.02; |
| | 83 | z-index: -0.9; |
| | 84 | } |
| | 85 | |
| | 86 | way[building]:closed |
| | 87 | { |
| | 88 | width: 2; |
| | 89 | color: magenta; |
| | 90 | opacity: 0.1; |
| | 91 | fill-color: magenta; |
| | 92 | fill-opacity: 0.02; |
| | 93 | z-index: -0.8; |
| | 94 | } |
| | 95 | |
| | 96 | way[highway][area?]:closed |
| | 97 | { |
| | 98 | width: 2; |
| | 99 | color: orange; |
| | 100 | opacity: 0.5; |
| | 101 | fill-color: orange; |
| | 102 | fill-opacity: 0.2; |
| | 103 | z-index: -0.5; |
| | 104 | } |
| | 105 | |
| | 106 | way[highway][!area] |
| | 107 | { |
| | 108 | color: #202020; |
| | 109 | opacity: 1.0; |
| | 110 | z-index: 1.0; |
| | 111 | } |
| | 112 | |
| | 113 | |
| | 114 | |
| | 115 | way[highway][smoothness=impassable] |
| | 116 | { |
| | 117 | width: 4; |
| | 118 | color: eval(rgb((7*0.142*(1-red(prop(color)))) + red(prop(color)), (1*0.142*(1-green(prop(color)))) + green(prop(color)), blue(prop(color)))); |
| | 119 | dashes: list(3,5,2,2,5,3); |
| | 120 | } |
| | 121 | |
| | 122 | way[highway][smoothness=very_horrible] |
| | 123 | { |
| | 124 | width: 4; |
| | 125 | color: eval(rgb((6*0.142*(1-red(prop(color)))) + red(prop(color)), (2*0.142*(1-green(prop(color)))) + green(prop(color)), blue(prop(color)))); |
| | 126 | dashes: list(3,5,2,2,5,3); |
| | 127 | } |
| | 128 | |
| | 129 | way[highway][smoothness=horrible] |
| | 130 | { |
| | 131 | width: 4; |
| | 132 | color: eval(rgb((5*0.142*(1-red(prop(color)))) + red(prop(color)), (3*0.142*(1-green(prop(color)))) + green(prop(color)), blue(prop(color)))); |
| | 133 | dashes: list(3,5,2,2,5,3); |
| | 134 | } |
| | 135 | |
| | 136 | way[highway][smoothness=very_bad] |
| | 137 | { |
| | 138 | width: 3; |
| | 139 | color: eval(rgb((4*0.142*(1-red(prop(color)))) + red(prop(color)), (4*0.142*(1-green(prop(color)))) + green(prop(color)), blue(prop(color)))); |
| | 140 | dashes: list(3,5,2,2); |
| | 141 | } |
| | 142 | |
| | 143 | way[highway][smoothness=bad] |
| | 144 | { |
| | 145 | width: 3; |
| | 146 | color: eval(rgb((3*0.142*(1-red(prop(color)))) + red(prop(color)), (5*0.142*(1-green(prop(color)))) + green(prop(color)), blue(prop(color)))); |
| | 147 | dashes: list(4,4,2,2); |
| | 148 | } |
| | 149 | |
| | 150 | way[highway][smoothness=intermediate] |
| | 151 | { |
| | 152 | width: 2; |
| | 153 | color: eval(rgb((2*0.142*(1-red(prop(color)))) + red(prop(color)), (6*0.142*(1-green(prop(color)))) + green(prop(color)), blue(prop(color)))); |
| | 154 | dashes: list(7,5); |
| | 155 | } |
| | 156 | |
| | 157 | way[highway][smoothness=good] |
| | 158 | { |
| | 159 | color: eval(rgb((1*0.142*(1-red(prop(color)))) + red(prop(color)), (7*0.142*(1-green(prop(color)))) + green(prop(color)), 0.4)); |
| | 160 | dashes: list(10,2); |
| | 161 | } |
| | 162 | |
| | 163 | way[highway][smoothness=excellent] |
| | 164 | { |
| | 165 | color: eval(rgb(red(prop(color)), green(prop(color)), 1.0)); |
| | 166 | } |
| | 167 | |
| | 168 | |
| | 169 | |
| | 170 | way[highway][surface], |
| | 171 | way[highway][smoothness] |
| | 172 | { |
| | 173 | print-text: true; |
| | 174 | text-color: #B0E0EE; |
| | 175 | text-offset: 4; |
| | 176 | } |
| | 177 | |
| | 178 | way[highway][surface=unpaved], |
| | 179 | way[highway][surface=dirt], |
| | 180 | way[highway][surface=ground], |
| | 181 | way[highway][surface=mud] |
| | 182 | { |
| | 183 | text-color: #FFB0B0; |
| | 184 | } |
| | 185 | |
| | 186 | way[highway][surface=grass] |
| | 187 | { |
| | 188 | text-color: #B0FFB0; |
| | 189 | } |
| | 190 | |
| | 191 | way[highway][surface=gravel], |
| | 192 | way[highway][surface=fine_gravel], |
| | 193 | way[highway][surface=pebblestone] |
| | 194 | { |
| | 195 | text-color: #FFFFB0; |
| | 196 | } |
| | 197 | |
| | 198 | way[highway][surface=paved], |
| | 199 | way[highway][surface=asphalt], |
| | 200 | way[highway][surface=concrete], |
| | 201 | way[highway][surface=concrete_pavers] |
| | 202 | { |
| | 203 | print-text: false; |
| | 204 | casing-width: +2; |
| | 205 | casing-color: #7777AA; |
| | 206 | casing-dashes: eval(prop(dashes)); |
| | 207 | } |
| | 208 | |
| | 209 | way[highway][smoothness=excellent], |
| | 210 | way[highway][smoothness=good] |
| | 211 | { |
| | 212 | print-text: false; |
| | 213 | } |
| | 214 | |
| | 215 | way[highway][surface][eval(prop(print-text))] |
| | 216 | { |
| | 217 | font-size: 10; |
| | 218 | font-family: Arial; |
| | 219 | text: "surface"; |
| | 220 | text-position: line; |
| | 221 | z-index: 1.0; |
| | 222 | } |
| | 223 | |
| | 224 | way[highway][smoothness][eval(prop(print-text))] |
| | 225 | { |
| | 226 | font-size: 10; |
| | 227 | text: "smoothness"; |
| | 228 | text-color: #EEE9BF; |
| | 229 | text-position: line; |
| | 230 | z-index: 1.0; |
| | 231 | } |
| | 232 | |
| | 233 | |
| | 234 | }}} |
| | 235 | |
| | 236 | |
| | 237 | sample screenshot: |
| | 238 | |
| | 239 | [[Image(josm-surface-smoothness-mappaint-style.png)]] |