meta { title: "improved INT1 like rendering for nautical charts"; author: "quantenschaum"; version: "0.1"; description: "improvements for https://github.com/OpenNauticalChart/josm/blob/master/INT1_MapCSS.mapcss mean to be used on top of (AFTER) this style"; min-josm-version: 18000; } canvas { fill-color: lightgray; antialiasing: 'full'; default-points: false; default-lines: false; fill-opacity: 1; } node|z-14 { -symbol-shape: none; symbol-size: 1; } node:unconnected { symbol-shape: circle; symbol-size: 6; symbol-fill-color: red; } node|z12-:connection { symbol-shape: circle; symbol-stroke-color: blue; } node:tagged { symbol-shape: circle; symbol-fill-color: green; } node["seamark:type"][!"seamark:seabed_area:surface"] { symbol-size: 5; symbol-shape: none; -symbol-shape: circle; symbol-fill-color: blue; text: none; } node|z12-["seamark:type"][!"seamark:seabed_area:surface"] { text: eval(any(tag("seamark:name"),tag("name"))); text-color: black; font-size: 11; text-anchor-horizontal: center; text-anchor-vertical: below; } way["seamark:type"][!"seamark:seabed_area:surface"] { text: "seamark:name"; text-color: black; font-size: 11; } way { width: default; color: gray; opacity: 0.4; } way[waterway]::int1_water { color: #66f; } way[waterway=fairway]::int1_water { text: eval(any(tag("seamark:name"),tag("name"))); text-color: black; font-size: 11; width: +5; color: white; opacity: 0.8; } relation["seamark:type"=fairway]::int1_water, way["seamark:type"=fairway]:closed::int1_water { text: eval(any(tag("seamark:name"),tag("name"))); text-color: black; font-size: 11; width: 0; fill-color: white; fill-opacity: 0.5; } *[boat?].river::int1_water { casing-width: +10; casing-color: skyblue; } node["seamark:type"=landmark]::int1_landmark { text: none; symbol-size: 10; symbol-shape: square; symbol-fill-color: none; symbol-stroke-color: black; symbol-stroke-width: 2; icon-height: 30; icon-offset-x: 0; icon-offset-y: -12; } node["seamark:landmark:function"=chapel]::int1_landmark, node["seamark:landmark:function"=church]::int1_landmark { icon-height: 25; icon-offset-y: 0; } node["seamark:landmark:category"=windmill]::int1_landmark { icon-height: 18; icon-offset-y: -7; } node["seamark:type"=platform]::int1_platform { symbol-size: 14; symbol-shape: square; symbol-fill-color: none; symbol-stroke-color: black; symbol-stroke-width: 2; } node["seamark:type"=platform]::int1_platform2 { symbol-size: 6; symbol-shape: circle; symbol-fill-color: black; symbol-stroke-color: none; } node["seamark:landmark:conspicuity"=conspicuous]::int1_conspicuous { symbol-size: 8; symbol-shape: circle; symbol-fill-color: red; symbol-stroke-color: none; } way["seamark:type"=navigation_line]::int1_navigation_line { width: 2; } node["depth:exposition"=shoaler]::shoaler1 { icon-image: "https://raw.githubusercontent.com/OpenNauticalChart/josm/master/icons/svg/K/K40.svg"; icon-width: 16; } node["depth:exposition"=shoaler]::shoaler2 { symbol-shape: circle; symbol-size: 16; symbol-fill-color: skyblue; symbol-fill-opacity: 0.7; } node["seamark:type"=rock]::rock_shade { symbol-shape: none; } node["seamark:type"=rock]::rock_obstruction { icon-image: none; } node["seamark:type"=rock][!"seamark:rock:water_level"]::int1_obstruction { icon-image: "https://raw.githubusercontent.com/OpenNauticalChart/josm/master/icons/svg/K/K13.svg"; } node["seamark:type"=rock]["seamark:rock:water_level"=dry].rock::int1_obstruction { icon-image: none; symbol-shape: circle; symbol-size: 6; symbol-fill-color: black; } *["seamark:seabed_area:surface"] { symbol-shape: none; } way["seamark:seabed_area:surface"] { color: green; width: 2; fill-color: gray; } *["seamark:seabed_area:surface"] {set seabed_surface; text: eval( replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace( replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace( join(" ", concat(get(split(";",tag("seamark:seabed_area:quality")),0),"-",get(split(";",tag("seamark:seabed_area:surface")),0)), concat(get(split(";",tag("seamark:seabed_area:quality")),1),"-",get(split(";",tag("seamark:seabed_area:surface")),1)), concat(get(split(";",tag("seamark:seabed_area:quality")),2),"-",get(split(";",tag("seamark:seabed_area:surface")),2)) ), fine, "f"), medium, "m"), coarse, "c"), broken, "bk"), sticky, "sy"), soft, "so"), stiff, "sf"), volcanic, "v"), calcareous, "ca"), hard, "h"), sand, "S"), mud, "M"), clay, "Cy"), silt, "Si"), stones, "St"), gravel, "G"), pebbles, "P"), cobbles, "Cb"), rocky, "R"), boulders, "Bo"), coral, "Co"), shells, "Sh"), lava, "Lv"),"-","") ); } node["depth"]::int1_depth { text: none; } node|z13-["depth"]::int1_depth { text: "depth"; text-color: #555; text-halo-opacity: 0; font-size: 11; -text-anchor-horizontal: right; -text-anchor-vertical: center; } way[contour=depth] { color: #118ac2; width: 1; text: "depth"; text-color: gray; font-size: 11; } way[contour=depth][depth=0] { color: black; } way[contour=depth][depth^="-"] { color: green; } way[contourarea=depth] { width: 0; fill-opacity: 0.8; fill-color: lightblue; } way[contourarea=depth][areatype=-1] { fill-color: #cceccd; } way[contourarea=depth][areatype=0] { fill-color: #a8e6fd; } way[contourarea=depth][areatype=2] { fill-color: #cceffc; } way[contourarea=depth][areatype=5] { fill-color: #e6f7fd; } way[contourarea=depth][areatype=10] { fill-color: white; } relation[contourarea=depth] { width: 1; fill-opacity: 0.8; fill-color: lightblue; } relation[contourarea=depth] way { width: 0; } relation[contourarea=depth][areatype=-1] { fill-color: #cceccd; } relation[contourarea=depth][areatype=0] { fill-color: #a8e6fd; } relation[contourarea=depth][areatype=2] { fill-color: #cceffc; } relation[contourarea=depth][areatype=5] { fill-color: #e6f7fd; } relation[contourarea=depth][areatype=10] { fill-color: white; } node["seamark:type"=pile] { symbol-shape: circle; symbol-size: 6; symbol-fill-color: black; } node["seamark:type"=light_float]::int1_buoy, node["seamark:type"=light_vessel]::int1_buoy, node["seamark:type"^=buoy]::int1_buoy, node["seamark:type"^=beacon]::int1_buoy { icon-image: eval(concat("https://raw.githubusercontent.com/quantenschaum/mapping/refs/heads/icons/", any(replace(replace(replace(tag(concat("seamark:",tag("seamark:type"),":shape")), "lattice",cond(regexp_test(".*;.*",tag(concat("seamark:",tag("seamark:type"),":colour"))),"tower","lattice")),"post","pile"),"pole","pile"), cond(regexp_test("buoy.*",tag("seamark:type")),"spar",cond(regexp_test("light_.*",tag("seamark:type")),"light_float","pile"))),"/", cond(regexp_test(".*;.*",tag(concat("seamark:",tag("seamark:type"),":colour"))), any(tag(concat("seamark:",tag("seamark:type"),":colour_pattern")),"horizontal"),""),"/", any(replace(tag(concat("seamark:",tag("seamark:type"),":colour")),";","_"), "generic"), ".svg")); text: none; icon-height: 60; icon-offset-x: 0; icon-offset-y: 0; } node["seamark:beacon_lateral:shape"=perch]::int1_buoy { icon-image: eval(concat("https://raw.githubusercontent.com/quantenschaum/mapping/refs/heads/icons/perch-",tag("seamark:beacon_lateral:category"),".svg")); } node["seamark:beacon_lateral:shape"=withy]::int1_buoy { icon-image: eval(concat("https://raw.githubusercontent.com/quantenschaum/mapping/refs/heads/icons/withy-",tag("seamark:beacon_lateral:category"),".svg")); } node["seamark:beacon_special_purpose:category"=notice]::int1_buoy { icon-image: eval(concat("https://raw.githubusercontent.com/quantenschaum/mapping/refs/heads/icons/square/", tag(concat("seamark:",tag("seamark:type"),":colour_pattern")),"/", any(replace(tag(concat("seamark:",tag("seamark:type"),":colour")),";","_"), "generic"), ".svg")); icon-height: 100; } node["seamark:beacon_safe_water:shape"=lattice]["seamark:beacon_safe_water:colour"*=";"]::lattice, node["seamark:beacon_special_purpose:shape"=lattice]["seamark:beacon_special_purpose:colour"*=";"]::lattice, node["seamark:beacon_cardinal:shape"=lattice]["seamark:beacon_cardinal:colour"*=";"]::lattice, node["seamark:beacon_isolated_danger:shape"=lattice]["seamark:beacon_isolated_danger:colour"*=";"]::lattice, node["seamark:beacon_lateral:shape"=lattice]["seamark:beacon_lateral:colour"*=";"]::lattice { icon-image: "https://raw.githubusercontent.com/quantenschaum/mapping/refs/heads/icons/lattice/generic.svg"; icon-height: 60; icon-offset-x: 0; icon-offset-y: 0; } node["seamark:type"=mooring]["seamark:mooring:category"=buoy]::int1_buoy { icon-image: eval(concat("https://raw.githubusercontent.com/quantenschaum/mapping/refs/heads/icons/", any(tag(concat("seamark:",tag("seamark:type"),":shape")),"spherical"),"/", cond(regexp_test(".*;.*",tag(concat("seamark:",tag("seamark:type"),":colour"))), any(tag(concat("seamark:",tag("seamark:type"),":colour_pattern")),"horizontal"),""),"/", any(replace(tag(concat("seamark:",tag("seamark:type"),":colour")),";","_"), "generic"), ".svg")); text: none; icon-height: 60; icon-offset-x: 0; icon-offset-y: 0; } node["seamark:type"=mooring]["seamark:mooring:category"=buoy]::int1_topmark { icon-image: "https://raw.githubusercontent.com/quantenschaum/mapping/refs/heads/icons/sphere/generic.svg"; icon-rotation: eval(cond(regexp_test("barrel|super-buoy",tag(concat("seamark:",tag("seamark:type"),":shape"))),0,15/180*3.1415)); icon-height: 60; icon-offset-x: 0; icon-offset-y: eval(cond(regexp_test("can|barrel|spherical|super-buoy|x",any(tag(concat("seamark:",tag("seamark:type"),":shape")),"x")),-8, cond(regexp_test("conical",tag(concat("seamark:",tag("seamark:type"),":shape"))),-11,-21))); } node["seamark:topmark:shape"]::int1_topmark { icon-image: eval(concat("https://raw.githubusercontent.com/quantenschaum/mapping/refs/heads/icons/", replace(replace(replace(replace(replace(replace(tag("seamark:topmark:shape"),"rectangle, vertical","square"),"rectangle, horizontal","square"),"board","square"),"trapezium","triangle point"), ",", ""), " ", "_"), "/", tag("seamark:topmark:colour_pattern"), "/", any(replace(tag("seamark:topmark:colour"),";","_"), "generic"), ".svg")); icon-width: 60; icon-offset-x: 0; icon-offset-y: eval(cond(regexp_test("can|barrel|spherical|super-buoy",tag(concat("seamark:",tag("seamark:type"),":shape"))),-8, cond(regexp_test("conical",tag(concat("seamark:",tag("seamark:type"),":shape"))),-11, cond(regexp_test("light_.*",tag("seamark:type")),-10, -21)))); } node["seamark:type"^=buoy]::int1_topmark { icon-rotation: eval(cond(regexp_test("barrel|super-buoy",tag(concat("seamark:",tag("seamark:type"),":shape"))),0,15/180*3.1415)); } node["seamark:type"^=beacon]::int1_topmark { icon-offset-y: -18; } node["seamark:type"=landmark]::int1_topmark { icon-offset-y: -26; } node["seamark:topmark:shape"=board]::int1_topmark { icon-width: 80; } node["seamark:topmark:shape"^=rectangle]::int1_topmark { icon-width: 80; } node["seamark:daymark:shape"]::int1_daymark { icon-image: eval(concat("https://raw.githubusercontent.com/quantenschaum/mapping/refs/heads/icons/", replace(replace(replace(tag("seamark:daymark:shape"),"board","square"), ",", ""), " ", "_"), "/", tag("seamark:daymark:colour_pattern"), "/", any(replace(tag("seamark:daymark:colour"),";","_"), "generic"), ".svg")); icon-width: 100; icon-offset-x: 0; icon-offset-y: 0; } node["seamark:daymark:shape"=board]::int1_daymark { icon-width: 120; } node["seamark:light:character"]::int1_light, node["seamark:light:colour"*=";"]::int1_light, node["seamark:light:1:colour"]::int1_light { icon-image: "https://raw.githubusercontent.com/quantenschaum/mapping/refs/heads/icons/light/generic.svg"; icon-width: 60; icon-offset-x: 0; icon-offset-y: 0; icon-opacity: 0.7; icon-rotation: eval(45*3.1415/180); } node["seamark:light:colour"]::int1_light { icon-image: eval(concat("https://raw.githubusercontent.com/quantenschaum/mapping/refs/heads/icons/light/",cond(regexp_test(".*;.*",tag("seamark:light:colour")),"generic",tag("seamark:light:colour")),".svg")); icon-width: 60; icon-offset-x: 0; icon-offset-y: 0; icon-opacity: 0.7; icon-rotation: eval(45*3.1415/180); } node["seamark:light:category"=floodlight]::int1_light { icon-image: none; } node["seamark:light:category"=floodlight]::floodlight { icon-image: eval(concat("https://raw.githubusercontent.com/quantenschaum/mapping/refs/heads/icons/floodlight/",any(tag("seamark:light:colour"),"generic"),".svg")); icon-width: 60; icon-offset-x: 0; icon-offset-y: 10; icon-opacity: 0.8; } node["seamark:type"^=light_m]::int1_lighthouse { icon-image: eval(concat("https://raw.githubusercontent.com/quantenschaum/mapping/refs/heads/icons/",tag("seamark:type"),".svg")); icon-width: 60; icon-offset-x: 0; icon-offset-y: 0; } node|z14-["seamark:light:character"]["seamark:light:category"!=floodlight]::light { text: eval(replace(replace(replace(replace(concat( tag("seamark:light:character"),"(", tag("seamark:light:group"),")", replace(replace(replace(replace(replace(replace( tag("seamark:light:colour"), "white","W"), "red","R"), "green","G"), "orange","Or"), "blue","Bu"), "yellow","Y"),".", any(tag("seamark:light:period"),"?"),"s.", any(tag("seamark:light:height"),"?"),"m.", any(tag("seamark:light:range"),"?"),"M", " "),"()","."),".?s",""),".?m",""),".?M","")); text-color: #555; font-size: 11; -font-style: italic; text-anchor-horizontal: left; text-anchor-vertical: center; } way[lightsector] { font-size: 11; color: gray; } way|z13-[lightsector] { text: "name"; text-color: #555; } way[lightsector=arc] { color: #800080; width: 10; } way["lightsector:low"=yes] { dashes: 6,3; } way[lightsector=arc][colour=orange], way[lightsector=arc][colour=yellow], way[lightsector=arc][colour=white] { color: #fab20b; } way[lightsector=arc][colour=red] { color: #ed1c24; } way[lightsector=arc][colour=green] { color: #00a650; } way[lightsector=limit] { color: black; width: 1; dashes: 3,3; } way[lightsector=orientation] { color: black; width: 1; dashes: 6,3; } node["seamark:fog_signal"=yes]::int1_fog_signal, node["seamark:fog_signal:category"]::int1_fog_signal { icon-image: "https://raw.githubusercontent.com/quantenschaum/mapping/refs/heads/icons/fogsignal.svg"; icon-height: 60; icon-offset-x: 0; icon-offset-y: 0; text: "seamark:fog_signal:category"; text-color: #555; font-size: 11; text-anchor-horizontal: center; text-anchor-vertical: center; text-offset-x: -30; text-offset-y: -25; } node|z12-["seamark:radar_reflector"=yes]::int1_radar_reflector { icon-image: "https://raw.githubusercontent.com/quantenschaum/mapping/refs/heads/icons/radar-reflector.svg"; icon-height: 60; icon-offset-x: 0; icon-offset-y: 20; icon-offset-y: eval(cond(regexp_test("can|barrel|spherical|super-buoy",tag(concat("seamark:",tag("seamark:type"),":shape"))),-8, cond(regexp_test("conical",tag(concat("seamark:",tag("seamark:type"),":shape"))),-11, cond(regexp_test("light_.*",tag("seamark:type")),-10, -21)))); } node["seamark:type"^=buoy]::int1_radar_reflector { icon-rotation: eval(cond(regexp_test("barrel|super-buoy",tag(concat("seamark:",tag("seamark:type"),":shape"))),0,15/180*3.1415)); } node["seamark:topmark:shape"]::int1_radar_reflector { icon-offset-y: eval(cond(regexp_test("can|barrel|spherical|super-buoy",tag(concat("seamark:",tag("seamark:type"),":shape"))),-8, cond(regexp_test("conical",tag(concat("seamark:",tag("seamark:type"),":shape"))),-11, cond(regexp_test("light_.*",tag("seamark:type")),-10, -21)))-cond(regexp_test("2.*",tag("seamark:topmark:shape")),14,8)); } node["seamark:topmark:shape"]["seamark:type"^=beacon]::int1_radar_reflector { icon-offset-y: eval(-18-cond(regexp_test("2.*",tag("seamark:topmark:shape")),14,8)); } node|z12-["seamark:radar_transponder:category"]::int1_radar_transponder { symbol-shape: circle; symbol-size: 70; symbol-fill-color: none; symbol-stroke-color: #800080; symbol-stroke-width: 4; symbol-stroke-opacity: 0.5; text: eval(replace(concat(upper(tag("seamark:radar_transponder:category")), "(",tag("seamark:radar_transponder:group"),")"),"()","")); text-color: #800080; font-size: 11; font-weight: bold; text-anchor-horizontal: center; text-anchor-vertical: center; text-offset-x: 0; text-offset-y: 42; } node|z12-["seamark:radio_station:category"]::int1_radio_station { symbol-shape: circle; symbol-size: 70; symbol-fill-color: none; symbol-stroke-color: #800080; symbol-stroke-width: 4; symbol-stroke-opacity: 0.5; text: eval(concat(upper(tag("seamark:radio_station:category")))); text-color: #800080; font-size: 11; font-weight: bold; text-anchor-horizontal: center; text-anchor-vertical: center; text-offset-x: 0; text-offset-y: 42; } way["seamark:type"^=cable_area]::int1_cable { repeat-image: "https://raw.githubusercontent.com/OpenNauticalChart/josm/master/icons/svg/L/L31.svg"; repeat-image-width: 16; repeat-image-spacing: 0; fill-color: #800080; fill-opacity: 0.1; } way["seamark:type"^=pipeline_area]::int1_pipeline { repeat-image: "https://raw.githubusercontent.com/OpenNauticalChart/josm/master/icons/svg/L/L40.svg"; repeat-image-width: 32; repeat-image-spacing: 2; fill-color: #800080; fill-opacity: 0.1; } way[natural=shoal]::shoal, way["seamark:sea_area:category"=shoal]::shoal { color: darkred; width: 2; fill-color: black; fill-opacity: 0.1; } way["seamark:sea_area:category"=shoal]::shoal { dashes: 3.3; } way[natural=shoal][surface=sand]::shoal { fill-color: orange; } way["seamark:type"=dumping_ground] { color: black; width: 2; dashes: 6,3; } *["seamark:type"=restricted_area]:closed { color: magenta; width: 5; } *["seamark:restricted_area:category"*=reserve]:closed, *["seamark:restricted_area:category"*=sanctuary]:closed { color: green; width: 5; } *["seamark:restricted_area:restriction"]:closed { fill-color: magenta; } *["seamark:restricted_area:restriction"*=no_entry]:closed { fill-color: red; } *["seamark:restricted_area:restriction"*=restricted_entry]:closed { fill-color: orange; }