From d281139fd62dfe47b72e9cbbabaf7f289a9969bd Mon Sep 17 00:00:00 2001 From: Konstantin Pastbin Date: Wed, 29 Jan 2025 13:09:18 +0300 Subject: [PATCH] [styles] Add minor power lines and poles Signed-off-by: Konstantin Pastbin --- data/mapcss-mapping.csv | 10 +++++++--- data/strings/types_strings.txt | 5 +++++ data/styles/outdoors/include/Icons.mapcss | 2 ++ data/styles/outdoors/include/Roads.mapcss | 5 +++++ data/styles/outdoors/include/priorities_3_FG.prio.txt | 2 ++ .../outdoors/include/priorities_4_overlays.prio.txt | 1 + generator/generator_tests/osm_type_test.cpp | 6 +++--- 7 files changed, 25 insertions(+), 6 deletions(-) diff --git a/data/mapcss-mapping.csv b/data/mapcss-mapping.csv index b84f574a19..adfdd56cc5 100644 --- a/data/mapcss-mapping.csv +++ b/data/mapcss-mapping.csv @@ -61,6 +61,7 @@ natural|water;6; highway|footway;7; highway|track;8; highway|tertiary;9; +# ~17M usages. power|tower;10; landuse|forest;[landuse=forest],[natural=wood];;name;int_name;11; landuse|grass;12; @@ -97,11 +98,13 @@ moved:highway|road:05.2024;31;highway|road deprecated:highway|track|grade2:04.2024;[highway=track][tracktype=grade2];x;name;int_name;32;highway|track natural|wetland;33; deprecated:highway|track|grade3:04.4024;[highway=track][tracktype=grade3];x;name;int_name;34;highway|track -deprecated:boundary|administrative|8:04.2024;[boundary=administrative][admin_level=8];x;name;int_name;35; +# ~1M usages. +power|minor_line;[power=minor_line][!location];;;;35; amenity|school;36; # Dedicated/segregated cycleways (e.g. segregated paths are converted into cycleways + footways, see osm2type.cpp). highway|cycleway;37; -deprecated:landuse|farm:05.2024;38;landuse|farmland +# ~16M usages. +power|pole;38; moved:amenity|place_of_worship:05.2024;39;amenity|place_of_worship deprecated:highway|track|grade1:04.2024;[highway=track][tracktype=grade1];x;name;int_name;40;highway|track addr:interpolation|odd;41; @@ -149,6 +152,7 @@ landuse|industrial;75; barrier|wall;76; amenity|post_box;77; place|town;78; +# ~1M usages. power|line;[power=line][!location];;name;int_name;79; landuse|farmyard;80; highway|residential|bridge;[highway=residential][bridge?];;name;int_name;81; @@ -299,7 +303,7 @@ waterway|dam;200; amenity|charging_station|motorcar;[amenity=charging_station][motorcar?];;name;int_name;201; leisure|golf_course;202; highway|service|bridge;[highway=service][bridge?];;name;int_name;203; -power|minor_line;204; +deprecated:power|minor_line:01.2017;204;x natural|wetland|marsh;[natural=wetland][wetland=marsh],[natural=marsh];;name;int_name;205; leisure|stadium;206; amenity|doctors;207; diff --git a/data/strings/types_strings.txt b/data/strings/types_strings.txt index 1b4213ba45..8fc3cf1da5 100644 --- a/data/strings/types_strings.txt +++ b/data/strings/types_strings.txt @@ -23104,6 +23104,7 @@ zh-Hant = 變電所 [type.power.tower] + comment = A tower or pylon carrying high voltage electricity cables. en = Power Tower af = Kragmas ar = عمود كهرباء @@ -23143,6 +23144,10 @@ zh-Hans = 高压电塔 zh-Hant = 電塔 + [type.power.pole] + comment = A single pole supporting minor power lines. + en = Power Pole + [type.psurface] en = psurface af = Padoppervlak diff --git a/data/styles/outdoors/include/Icons.mapcss b/data/styles/outdoors/include/Icons.mapcss index ba2541f7a9..250854b61d 100644 --- a/data/styles/outdoors/include/Icons.mapcss +++ b/data/styles/outdoors/include/Icons.mapcss @@ -366,6 +366,8 @@ node|z13[power=tower], {icon-image: mast-m.svg;} node|z14-[power=tower], {icon-image: power-tower-m.svg;} +node|z15-[power=pole], +{icon-image: mast-m.svg;} node|z13-[power=generator][generator:source=wind], area|z13-[power=generator][generator:source=wind], diff --git a/data/styles/outdoors/include/Roads.mapcss b/data/styles/outdoors/include/Roads.mapcss index e675bdc2ae..026dd144e1 100644 --- a/data/styles/outdoors/include/Roads.mapcss +++ b/data/styles/outdoors/include/Roads.mapcss @@ -546,3 +546,8 @@ line|z14-[power=line]::dash, {width: 4; opacity: 0.6;} line|z15-[power=line]::dash, {width: 4.5; opacity: 0.7; dashes: 1,80;} + +line|z15-[power=minor_line], +{color: @powerline; width: 1; opacity: 0.6;} +line|z15-[power=minor_line]::dash, +{color: @powerline; width: 4; opacity: 0.6; dashes: 1,80;} diff --git a/data/styles/outdoors/include/priorities_3_FG.prio.txt b/data/styles/outdoors/include/priorities_3_FG.prio.txt index 208ef8ec33..7f81cd97f8 100644 --- a/data/styles/outdoors/include/priorities_3_FG.prio.txt +++ b/data/styles/outdoors/include/priorities_3_FG.prio.txt @@ -40,9 +40,11 @@ historic-citywalls # line z14- (also has pathte === 360 power-line # line z15- (also has line::dash z15-, pathtext z15-) +power-minor_line === 350 power-line::dash # line::dash z15- (also has line z15-, pathtext z15-) +power-minor_line::dash === 340 highway-cycleway # line z11- (also has pathtext z13-) diff --git a/data/styles/outdoors/include/priorities_4_overlays.prio.txt b/data/styles/outdoors/include/priorities_4_overlays.prio.txt index 44ecc64d12..bf55d7836f 100644 --- a/data/styles/outdoors/include/priorities_4_overlays.prio.txt +++ b/data/styles/outdoors/include/priorities_4_overlays.prio.txt @@ -1206,6 +1206,7 @@ power-plant-gas # icon z17- power-plant-hydro # icon z17- power-plant-solar # icon z17- power-plant-wind # icon z13- (also has caption(optional) z16-) +power-pole power-station # icon z17- (also has caption(optional) z17-) === 230 diff --git a/generator/generator_tests/osm_type_test.cpp b/generator/generator_tests/osm_type_test.cpp index b62259e787..9b158ee839 100644 --- a/generator/generator_tests/osm_type_test.cpp +++ b/generator/generator_tests/osm_type_test.cpp @@ -2165,9 +2165,6 @@ UNIT_CLASS_TEST(TestWithClassificator, OsmType_SimpleTypesSmoke) // {"natural", "vineyard"}, // {"noexit"}, // {"place", "county"}, - // {"power", "generator"}, - // {"power", "minor_line"}, - // {"power", "pole"}, // {"railway", "crossing"}, // {"railway", "razed"}, // {"railway", "siding"}, @@ -2576,7 +2573,10 @@ UNIT_CLASS_TEST(TestWithClassificator, OsmType_SimpleTypesSmoke) {"place", "suburb"}, {"place", "town"}, {"place", "village"}, + {"power", "generator"}, {"power", "line"}, + {"power", "minor_line"}, + {"power", "pole"}, {"power", "station"}, {"power", "substation"}, {"power", "tower"},