diff --git a/data/categories.txt b/data/categories.txt index 7b5a8e780e..5aeed492f3 100644 --- a/data/categories.txt +++ b/data/categories.txt @@ -1477,7 +1477,7 @@ ro:cimitir nb:gravplass fi:hautausmaa -amenity-hospital|amenity-doctors +amenity-hospital|amenity-doctors|amenity-dentist|amenity-clinic en:3hospital|clinic|3doctor|U+1F691|U+1F3E5|U+1F489|U+1F48A ru:3больница|3госпиталь|врач|доктор uk:3лікарня|клініка|лікар|травмпункт diff --git a/data/classificator.txt b/data/classificator.txt index 67f0366622..aef28b6a39 100644 --- a/data/classificator.txt +++ b/data/classificator.txt @@ -33,7 +33,9 @@ world + car_sharing - casino - cinema - + clinic - college - + dentist - doctors - drinking_water - embassy - @@ -110,6 +112,7 @@ world + bollard - city_wall - cycle_barrier - + entrance - fence - gate - hedge - diff --git a/data/drules_proto.bin b/data/drules_proto.bin index 91047df969..0ddcb20eb1 100644 Binary files a/data/drules_proto.bin and b/data/drules_proto.bin differ diff --git a/data/drules_proto.txt b/data/drules_proto.txt index d6150d7e70..a3a40218fe 100644 --- a/data/drules_proto.txt +++ b/data/drules_proto.txt @@ -2047,6 +2047,45 @@ cont { } } } +cont { + name: "amenity-clinic" + element { + scale: 17 + caption { + primary { + height: 11 + color: 4473924 + stroke_color: 16777215 + offset_y: 10 + } + priority: 15003 + } + } + element { + scale: 18 + caption { + primary { + height: 11 + color: 4473924 + stroke_color: 16777215 + offset_y: 10 + } + priority: 15003 + } + } + element { + scale: 19 + caption { + primary { + height: 11 + color: 4473924 + stroke_color: 16777215 + offset_y: 10 + } + priority: 15003 + } + } +} cont { name: "amenity-college" element { @@ -2138,6 +2177,45 @@ cont { } } } +cont { + name: "amenity-dentist" + element { + scale: 17 + caption { + primary { + height: 11 + color: 4473924 + stroke_color: 16777215 + offset_y: 10 + } + priority: 15003 + } + } + element { + scale: 18 + caption { + primary { + height: 11 + color: 4473924 + stroke_color: 16777215 + offset_y: 10 + } + priority: 15003 + } + } + element { + scale: 19 + caption { + primary { + height: 11 + color: 4473924 + stroke_color: 16777215 + offset_y: 10 + } + priority: 15003 + } + } +} cont { name: "amenity-doctors" element { @@ -5472,6 +5550,30 @@ cont { } } } +cont { + name: "barrier-entrance" + element { + scale: 17 + symbol { + name: "gate" + priority: 16000 + } + } + element { + scale: 18 + symbol { + name: "gate" + priority: 16000 + } + } + element { + scale: 19 + symbol { + name: "gate" + priority: 16000 + } + } +} cont { name: "barrier-fence" element { diff --git a/data/drules_proto_clear.bin b/data/drules_proto_clear.bin index 799ea68561..a81c6ca483 100644 Binary files a/data/drules_proto_clear.bin and b/data/drules_proto_clear.bin differ diff --git a/data/drules_proto_clear.txt b/data/drules_proto_clear.txt index 2894bbae3c..e1246a99c0 100644 --- a/data/drules_proto_clear.txt +++ b/data/drules_proto_clear.txt @@ -1650,6 +1650,69 @@ cont { } } } +cont { + name: "amenity-clinic" + element { + scale: 16 + symbol { + name: "hospital-m" + priority: 16728 + } + caption { + primary { + height: 10 + color: 4473924 + offset_y: 8 + } + priority: 15728 + } + } + element { + scale: 17 + symbol { + name: "hospital-l" + priority: 16728 + } + caption { + primary { + height: 10 + color: 4473924 + offset_y: 8 + } + priority: 15728 + } + } + element { + scale: 18 + symbol { + name: "hospital-l" + priority: 16728 + } + caption { + primary { + height: 10 + color: 4473924 + offset_y: 8 + } + priority: 15728 + } + } + element { + scale: 19 + symbol { + name: "hospital-l" + priority: 16728 + } + caption { + primary { + height: 10 + color: 4473924 + offset_y: 8 + } + priority: 15728 + } + } +} cont { name: "amenity-college" element { @@ -1714,11 +1777,119 @@ cont { } } cont { - name: "amenity-doctors" + name: "amenity-dentist" + element { + scale: 16 + symbol { + name: "hospital-m" + priority: 16728 + } + caption { + primary { + height: 10 + color: 4473924 + offset_y: 8 + } + priority: 15728 + } + } + element { + scale: 17 + symbol { + name: "hospital-l" + priority: 16728 + } + caption { + primary { + height: 10 + color: 4473924 + offset_y: 8 + } + priority: 15728 + } + } + element { + scale: 18 + symbol { + name: "hospital-l" + priority: 16728 + } + caption { + primary { + height: 10 + color: 4473924 + offset_y: 8 + } + priority: 15728 + } + } element { scale: 19 symbol { - name: "none" + name: "hospital-l" + priority: 16728 + } + caption { + primary { + height: 10 + color: 4473924 + offset_y: 8 + } + priority: 15728 + } + } +} +cont { + name: "amenity-doctors" + element { + scale: 16 + symbol { + name: "hospital-m" + priority: 16728 + } + caption { + primary { + height: 10 + color: 4473924 + offset_y: 8 + } + priority: 15728 + } + } + element { + scale: 17 + symbol { + name: "hospital-l" + priority: 16728 + } + caption { + primary { + height: 10 + color: 4473924 + offset_y: 8 + } + priority: 15728 + } + } + element { + scale: 18 + symbol { + name: "hospital-l" + priority: 16728 + } + caption { + primary { + height: 10 + color: 4473924 + offset_y: 8 + } + priority: 15728 + } + } + element { + scale: 19 + symbol { + name: "hospital-l" priority: 16728 } caption { @@ -22311,7 +22482,7 @@ cont { } caption { primary { - height: 12 + height: 13 color: 3372834 } priority: 15169 @@ -22554,6 +22725,15 @@ cont { } priority: 15169 } + apply_if: "name" + } + element { + scale: 17 + area { + color: 11189094 + priority: 1170 + } + apply_if: "!name" } element { scale: 18 @@ -22565,6 +22745,15 @@ cont { name: "park-m" priority: 16169 } + apply_if: "name" + } + element { + scale: 18 + area { + color: 11189094 + priority: 1170 + } + apply_if: "!name" } element { scale: 19 @@ -22576,6 +22765,15 @@ cont { name: "park-m" priority: 16169 } + apply_if: "name" + } + element { + scale: 19 + area { + color: 11189094 + priority: 1170 + } + apply_if: "!name" } } cont { @@ -22668,6 +22866,15 @@ cont { } priority: 15169 } + apply_if: "name" + } + element { + scale: 17 + area { + color: 11189094 + priority: 1170 + } + apply_if: "!name" } element { scale: 18 @@ -22679,6 +22886,15 @@ cont { name: "park-m" priority: 16169 } + apply_if: "name" + } + element { + scale: 18 + area { + color: 11189094 + priority: 1170 + } + apply_if: "!name" } element { scale: 19 @@ -22690,6 +22906,15 @@ cont { name: "park-m" priority: 16169 } + apply_if: "name" + } + element { + scale: 19 + area { + color: 11189094 + priority: 1170 + } + apply_if: "!name" } } cont { @@ -22782,6 +23007,15 @@ cont { } priority: 15169 } + apply_if: "name" + } + element { + scale: 17 + area { + color: 11189094 + priority: 1170 + } + apply_if: "!name" } element { scale: 18 @@ -22793,6 +23027,15 @@ cont { name: "park-m" priority: 16169 } + apply_if: "name" + } + element { + scale: 18 + area { + color: 11189094 + priority: 1170 + } + apply_if: "!name" } element { scale: 19 @@ -22804,6 +23047,15 @@ cont { name: "park-m" priority: 16169 } + apply_if: "name" + } + element { + scale: 19 + area { + color: 11189094 + priority: 1170 + } + apply_if: "!name" } } cont { @@ -22896,6 +23148,15 @@ cont { } priority: 15169 } + apply_if: "name" + } + element { + scale: 17 + area { + color: 11189094 + priority: 1170 + } + apply_if: "!name" } element { scale: 18 @@ -22907,6 +23168,15 @@ cont { name: "park-m" priority: 16169 } + apply_if: "name" + } + element { + scale: 18 + area { + color: 11189094 + priority: 1170 + } + apply_if: "!name" } element { scale: 19 @@ -22918,6 +23188,15 @@ cont { name: "park-m" priority: 16169 } + apply_if: "name" + } + element { + scale: 19 + area { + color: 11189094 + priority: 1170 + } + apply_if: "!name" } } cont { diff --git a/data/drules_proto_dark.bin b/data/drules_proto_dark.bin index 6ce899a6b3..8cd9eb0b43 100644 Binary files a/data/drules_proto_dark.bin and b/data/drules_proto_dark.bin differ diff --git a/data/drules_proto_dark.txt b/data/drules_proto_dark.txt index a66437a361..2940760638 100644 --- a/data/drules_proto_dark.txt +++ b/data/drules_proto_dark.txt @@ -1650,6 +1650,69 @@ cont { } } } +cont { + name: "amenity-clinic" + element { + scale: 16 + symbol { + name: "hospital-m" + priority: 16728 + } + caption { + primary { + height: 10 + color: 5592405 + offset_y: 8 + } + priority: 15728 + } + } + element { + scale: 17 + symbol { + name: "hospital-l" + priority: 16728 + } + caption { + primary { + height: 10 + color: 5592405 + offset_y: 8 + } + priority: 15728 + } + } + element { + scale: 18 + symbol { + name: "hospital-l" + priority: 16728 + } + caption { + primary { + height: 10 + color: 5592405 + offset_y: 8 + } + priority: 15728 + } + } + element { + scale: 19 + symbol { + name: "hospital-l" + priority: 16728 + } + caption { + primary { + height: 10 + color: 5592405 + offset_y: 8 + } + priority: 15728 + } + } +} cont { name: "amenity-college" element { @@ -1714,11 +1777,119 @@ cont { } } cont { - name: "amenity-doctors" + name: "amenity-dentist" + element { + scale: 16 + symbol { + name: "hospital-m" + priority: 16728 + } + caption { + primary { + height: 10 + color: 5592405 + offset_y: 8 + } + priority: 15728 + } + } + element { + scale: 17 + symbol { + name: "hospital-l" + priority: 16728 + } + caption { + primary { + height: 10 + color: 5592405 + offset_y: 8 + } + priority: 15728 + } + } + element { + scale: 18 + symbol { + name: "hospital-l" + priority: 16728 + } + caption { + primary { + height: 10 + color: 5592405 + offset_y: 8 + } + priority: 15728 + } + } element { scale: 19 symbol { - name: "none" + name: "hospital-l" + priority: 16728 + } + caption { + primary { + height: 10 + color: 5592405 + offset_y: 8 + } + priority: 15728 + } + } +} +cont { + name: "amenity-doctors" + element { + scale: 16 + symbol { + name: "hospital-m" + priority: 16728 + } + caption { + primary { + height: 10 + color: 5592405 + offset_y: 8 + } + priority: 15728 + } + } + element { + scale: 17 + symbol { + name: "hospital-l" + priority: 16728 + } + caption { + primary { + height: 10 + color: 5592405 + offset_y: 8 + } + priority: 15728 + } + } + element { + scale: 18 + symbol { + name: "hospital-l" + priority: 16728 + } + caption { + primary { + height: 10 + color: 5592405 + offset_y: 8 + } + priority: 15728 + } + } + element { + scale: 19 + symbol { + name: "hospital-l" priority: 16728 } caption { @@ -22311,7 +22482,7 @@ cont { } caption { primary { - height: 12 + height: 13 color: 1131520 } priority: 15169 @@ -22554,6 +22725,15 @@ cont { } priority: 15169 } + apply_if: "name" + } + element { + scale: 17 + area { + color: 1122816 + priority: 1170 + } + apply_if: "!name" } element { scale: 18 @@ -22565,6 +22745,15 @@ cont { name: "park-m" priority: 16169 } + apply_if: "name" + } + element { + scale: 18 + area { + color: 1122816 + priority: 1170 + } + apply_if: "!name" } element { scale: 19 @@ -22576,6 +22765,15 @@ cont { name: "park-m" priority: 16169 } + apply_if: "name" + } + element { + scale: 19 + area { + color: 1122816 + priority: 1170 + } + apply_if: "!name" } } cont { @@ -22668,6 +22866,15 @@ cont { } priority: 15169 } + apply_if: "name" + } + element { + scale: 17 + area { + color: 1122816 + priority: 1170 + } + apply_if: "!name" } element { scale: 18 @@ -22679,6 +22886,15 @@ cont { name: "park-m" priority: 16169 } + apply_if: "name" + } + element { + scale: 18 + area { + color: 1122816 + priority: 1170 + } + apply_if: "!name" } element { scale: 19 @@ -22690,6 +22906,15 @@ cont { name: "park-m" priority: 16169 } + apply_if: "name" + } + element { + scale: 19 + area { + color: 1122816 + priority: 1170 + } + apply_if: "!name" } } cont { @@ -22782,6 +23007,15 @@ cont { } priority: 15169 } + apply_if: "name" + } + element { + scale: 17 + area { + color: 1122816 + priority: 1170 + } + apply_if: "!name" } element { scale: 18 @@ -22793,6 +23027,15 @@ cont { name: "park-m" priority: 16169 } + apply_if: "name" + } + element { + scale: 18 + area { + color: 1122816 + priority: 1170 + } + apply_if: "!name" } element { scale: 19 @@ -22804,6 +23047,15 @@ cont { name: "park-m" priority: 16169 } + apply_if: "name" + } + element { + scale: 19 + area { + color: 1122816 + priority: 1170 + } + apply_if: "!name" } } cont { @@ -22896,6 +23148,15 @@ cont { } priority: 15169 } + apply_if: "name" + } + element { + scale: 17 + area { + color: 1122816 + priority: 1170 + } + apply_if: "!name" } element { scale: 18 @@ -22907,6 +23168,15 @@ cont { name: "park-m" priority: 16169 } + apply_if: "name" + } + element { + scale: 18 + area { + color: 1122816 + priority: 1170 + } + apply_if: "!name" } element { scale: 19 @@ -22918,6 +23188,15 @@ cont { name: "park-m" priority: 16169 } + apply_if: "name" + } + element { + scale: 19 + area { + color: 1122816 + priority: 1170 + } + apply_if: "!name" } } cont { diff --git a/data/mapcss-mapping.csv b/data/mapcss-mapping.csv index 52749c8664..6c1ce39f9f 100644 --- a/data/mapcss-mapping.csv +++ b/data/mapcss-mapping.csv @@ -1033,3 +1033,6 @@ railway|subway_entrance|madrid;[railway=subway_entrance][city=madrid];;name;int_ railway|subway_entrance|roma;[railway=subway_entrance][city=roma];;name;int_name;1033; railway|subway_entrance|spb;[railway=subway_entrance][city=spb];;name;int_name;1034; aerialway|drag_lift;[aerialway=drag_lift];;name;int_name;1035; +amenity|dentist;[amenity=dentist];;name;int_name;1036; +amenity|clinic;[amenity=clinic];;name;int_name;1037; +barrier|entrance;[barrier=entrance];;name;int_name;1038; diff --git a/data/styles/clear/include/POI.mapcss b/data/styles/clear/include/POI.mapcss index 78bccd0e9c..04efa7450a 100644 --- a/data/styles/clear/include/POI.mapcss +++ b/data/styles/clear/include/POI.mapcss @@ -81,7 +81,15 @@ node|z16[amenity=theatre], area|z16[amenity=theatre] { icon-image: theatre-m.svg node|z16[amenity=kindergarten], area|z16[amenity=kindergarten] { icon-image: kindergarten-m.svg; text-offset: 8; font-size: 10; text: name; text-color: @poi_label; } node|z16[amenity=school], area|z16[amenity=school] { icon-image: school-m.svg; text-offset: 8; font-size: 10; text: name; text-color: @poi_label; } node|z16[amenity=college], area|z16[amenity=college] { icon-image: college-m.svg; text-offset: 8; font-size: 10; text: name; text-color: @poi_label; } -node|z16[amenity=hospital], area|z16[amenity=hospital] { icon-image: hospital-m.svg; text-offset: 8; font-size: 10; text: name; text-color: @poi_label; } + +node|z16[amenity=hospital], area|z16[amenity=hospital], +node|z16[amenity=doctors], area|z16[amenity=doctors], +node|z16[amenity=dentist], area|z16[amenity=dentist], +node|z16[amenity=clinic], area|z16[amenity=clinic], +{ + icon-image: hospital-m.svg; text-offset: 8; font-size: 10; text: name; text-color: @poi_label; +} + node|z16[amenity=university], area|z16[amenity=university] { icon-image: college-m.svg; text-offset: 8; font-size: 10; text: name; text-color: @poi_label; z-index: 4; } node|z16[amenity=fuel], area|z16[amenity=fuel] { icon-image: fuel-m.svg; text-offset: 8; font-size: 10; text: name; text-color: @poi_label; } node|z16-[natural=spring],area|z16-[natural=spring]{ icon-image: drinking-water-m.svg; z-index: 1000; text-offset:8; font-size: 10; text: name; text-color: @poi_label; z-index: 100; } @@ -92,7 +100,15 @@ node|z17[amenity=theatre], area|z17[amenity=theatre] { icon-image: theatre-l.svg node|z17[amenity=kindergarten], area|z17[amenity=kindergarten] { icon-image: kindergarten-l.svg; text-offset: 8; font-size: 10; text: name; text-color: @poi_label; } node|z17[amenity=school], area|z17[amenity=school] { icon-image: school-l.svg; text-offset: 8; font-size: 10; text: name; text-color: @poi_label; } node|z17[amenity=college], area|z17[amenity=college] { icon-image: college-l.svg; text-offset: 8; font-size: 10; text: name; text-color: @poi_label; } -node|z17[amenity=hospital], area|z17[amenity=hospital] { icon-image: hospital-l.svg; text-offset: 8; font-size: 10; text: name; text-color: @poi_label; } + +node|z17[amenity=hospital], area|z17[amenity=hospital], +node|z17[amenity=doctors], area|z17[amenity=doctors], +node|z17[amenity=dentist], area|z17[amenity=dentist], +node|z17[amenity=clinic], area|z17[amenity=clinic], +{ + icon-image: hospital-l.svg; text-offset: 8; font-size: 10; text: name; text-color: @poi_label; +} + node|z17[amenity=university], area|z17[amenity=university] { icon-image: college-l.svg; text-offset: 8; font-size: 10; text: name; text-color: @poi_label; z-index: 4; } node|z17[amenity=cinema], area|z17[amenity=cinema] { icon-image: cinema-l.svg; text-offset: 8; font-size: 10; text: name; text-color: @poi_label; } @@ -114,7 +130,15 @@ node|z18-[amenity=theatre], area|z18-[amenity=theatre] { icon-image: theatre-l.s node|z18-[amenity=kindergarten], area|z18-[amenity=kindergarten] { icon-image: kindergarten-l.svg; text-offset: 8; font-size: 10; text: name; text-color: @poi_label; } node|z18-[amenity=school], area|z18-[amenity=school] { icon-image: school-l.svg; text-offset: 8; font-size: 10; text: name; text-color: @poi_label; } node|z18-[amenity=college], area|z18-[amenity=college] { icon-image: college-l.svg; text-offset: 8; font-size: 10; text: name; text-color: @poi_label; } -node|z18-[amenity=hospital], area|z18-[amenity=hospital] { icon-image: hospital-l.svg; text-offset: 8; font-size: 10; text: name; text-color: @poi_label; } + +node|z18-[amenity=hospital], area|z18-[amenity=hospital], +node|z18-[amenity=doctors], area|z18-[amenity=doctors], +node|z18-[amenity=dentist], area|z18-[amenity=dentist], +node|z18-[amenity=clinic], area|z18-[amenity=clinic], +{ + icon-image: hospital-l.svg; text-offset: 8; font-size: 10; text: name; text-color: @poi_label; +} + node|z18-[amenity=university], area|z18-[amenity=university] { icon-image: college-l.svg; text-offset: 8; font-size: 10; text: name; text-color: @poi_label; z-index: 5; } node|z18-[amenity=cinema], area|z18-[amenity=cinema] { icon-image: cinema-l.svg; text-offset: 8; font-size: 10; text: name; text-color: @poi_label; } node|z18-[amenity=bank], area|z18-[amenity=bank] { z-index: 4500; icon-image: bank-l.svg; text-offset: 8; font-size: 10; text: name; text-color: @poi_label; } @@ -179,9 +203,6 @@ node|z18-[sport=gymnastics] { icon-image: pitch-l.svg; text-offset: 8; font-size node|z16-[highway=speed_camera] { icon-image: speedcam-m.svg; z-index: 7000; } -node|z16[building=hospital], area|z16[building=hospital] { icon-image: hospital-m.svg; text-offset: 8; font-size: 10; text: name; text-color: @poi_label; } -node|z17-[building=hospital], area|z17-[building=hospital] { icon-image: hospital-l.svg; text-offset: 8; font-size: 10; text: name; text-color: @poi_label; } - /* PARKINGS */ area|z16-[amenity=parking] {fill-color: @parking;fill-oppacity:1;z-index: 0;} diff --git a/data/styles/legacy/include/base_other.mapcss b/data/styles/legacy/include/base_other.mapcss index 16159749f8..02268a5f27 100644 --- a/data/styles/legacy/include/base_other.mapcss +++ b/data/styles/legacy/include/base_other.mapcss @@ -1213,7 +1213,9 @@ node|z17-[tourism=information][office] icon-image: information-office.svg; } area|z17-[barrier=gate], -node|z17-[barrier=gate] +node|z17-[barrier=gate], +area|z17-[barrier=entrance], +node|z17-[barrier=entrance], { icon-image: gate.svg; } diff --git a/data/types.txt b/data/types.txt index 99a8ada0e1..2cf812f9b9 100644 --- a/data/types.txt +++ b/data/types.txt @@ -1033,3 +1033,6 @@ railway|subway_entrance|madrid railway|subway_entrance|roma railway|subway_entrance|spb aerialway|drag_lift +amenity|dentist +amenity|clinic +barrier|entrance diff --git a/data/visibility.txt b/data/visibility.txt index e1c99f36ad..0143b05b16 100644 --- a/data/visibility.txt +++ b/data/visibility.txt @@ -33,7 +33,9 @@ world 00000000000000000000 + car_sharing 00000000000000001111 - casino 00000000000000000111 - cinema 00000000000000001111 - + clinic 00000000000000000111 - college 00000000000001111111 - + dentist 00000000000000000111 - doctors 00000000000000001111 - drinking_water 00000000000000000111 - embassy 00000000000000001111 - @@ -110,6 +112,7 @@ world 00000000000000000000 + bollard 00000000000000001111 - city_wall 00000000000000001111 - cycle_barrier 00000000000000000000 - + entrance 00000000000000000111 - fence 00000000000000001111 - gate 00000000000000000111 - hedge 00000000000000001111 - diff --git a/generator/generator_tests/osm_type_test.cpp b/generator/generator_tests/osm_type_test.cpp index 35e0c58190..1054ad0ca0 100644 --- a/generator/generator_tests/osm_type_test.cpp +++ b/generator/generator_tests/osm_type_test.cpp @@ -728,3 +728,58 @@ UNIT_TEST(OsmType_Subway) TEST(params.IsTypeExist(GetType({"railway", "station", "subway", "london"})), (params)); } } + +UNIT_TEST(OsmType_Hospital) +{ + { + char const * arr[][2] = { + { "building", "hospital" }, + }; + + OsmElement e; + FillXmlElement(arr, ARRAY_SIZE(arr), &e); + + FeatureParams params; + ftype::GetNameAndType(&e, params); + + TEST_EQUAL(params.m_Types.size(), 1, (params)); + TEST(params.IsTypeExist(GetType({"building"})), (params)); + } + + { + char const * arr[][2] = { + { "building", "yes" }, + { "amenity", "hospital" }, + }; + + OsmElement e; + FillXmlElement(arr, ARRAY_SIZE(arr), &e); + + FeatureParams params; + ftype::GetNameAndType(&e, params); + + TEST_EQUAL(params.m_Types.size(), 2, (params)); + TEST(params.IsTypeExist(GetType({"building"})), (params)); + TEST(params.IsTypeExist(GetType({"amenity", "hospital"})), (params)); + } +} + +UNIT_TEST(OsmType_Entrance) +{ + { + char const * arr[][2] = { + { "building", "entrance" }, + { "barrier", "entrance" }, + }; + + OsmElement e; + FillXmlElement(arr, ARRAY_SIZE(arr), &e); + + FeatureParams params; + ftype::GetNameAndType(&e, params); + + TEST_EQUAL(params.m_Types.size(), 2, (params)); + TEST(params.IsTypeExist(GetType({"entrance"})), (params)); + TEST(params.IsTypeExist(GetType({"barrier", "entrance"})), (params)); + } +} diff --git a/generator/osm2type.cpp b/generator/osm2type.cpp index e0f1e299aa..e9679306ba 100644 --- a/generator/osm2type.cpp +++ b/generator/osm2type.cpp @@ -302,10 +302,10 @@ namespace ftype // Next objects trying to find by value first. ClassifObjectPtr pObj = - ForEachTagEx(p, skipRows, [&](string const & k, string const & v) + ForEachTagEx(p, skipRows, [¤t](string const & k, string const & v) { if (!NeedMatchValue(k, v)) - return ClassifObjectPtr(0, 0); + return ClassifObjectPtr(); return current->BinaryFind(v); }); @@ -389,7 +389,7 @@ namespace ftype return string(); } - void PreprocessElement(OsmElement * p, FeatureParams & params) + void PreprocessElement(OsmElement * p) { bool hasLayer = false; char const * layer = nullptr; @@ -404,6 +404,9 @@ namespace ftype { "layer", "*", [&hasLayer] { hasLayer = true; }}, { "railway", "subway_entrance", [&isSubwayEntrance] { isSubwayEntrance = true; }}, + + /// @todo Unfortunatelly, it's not working in many cases (route=subway, transport=subway). + /// Actually, it's better to process subways after feature types assignment. { "station", "subway", [&isSubwayStation] { isSubwayStation = true; }}, }); @@ -507,7 +510,7 @@ namespace ftype void GetNameAndType(OsmElement * p, FeatureParams & params) { // Stage1: Preprocess tags. - PreprocessElement(p, params); + PreprocessElement(p); // Stage2: Process feature name on all languages. ForEachTag(p, NamesExtractor(params)); @@ -518,9 +521,10 @@ namespace ftype { "atm", "yes", [](string & k, string & v) { k.swap(v); k = "amenity"; }}, { "restaurant", "yes", [](string & k, string & v) { k.swap(v); k = "amenity"; }}, { "hotel", "yes", [](string & k, string & v) { k.swap(v); k = "tourism"; }}, - { "addr:housename", "*", [¶ms](string & k, string & v) { params.AddHouseName(v); k.clear(); v.clear();}}, - { "addr:street", "*", [¶ms](string & k, string & v) { params.AddStreetAddress(v); k.clear(); v.clear();}}, - { "addr:flats", "*", [¶ms](string & k, string & v) { params.flats = v; k.clear(); v.clear();}}, + { "building", "entrance", [](string & k, string & v) { k.swap(v); v = "yes"; }}, + { "addr:housename", "*", [¶ms](string & k, string & v) { params.AddHouseName(v); k.clear(); v.clear(); }}, + { "addr:street", "*", [¶ms](string & k, string & v) { params.AddStreetAddress(v); k.clear(); v.clear(); }}, + { "addr:flats", "*", [¶ms](string & k, string & v) { params.flats = v; k.clear(); v.clear(); }}, { "addr:housenumber", "*", [¶ms](string & k, string & v) { // Treat "numbers" like names if it's not an actual number. @@ -535,8 +539,7 @@ namespace ftype uint64_t n; if (strings::to_uint64(v, n)) params.rank = static_cast(log(double(n)) / log(1.1)); - k.clear(); - v.clear(); + k.clear(); v.clear(); }}, { "ref", "*", [¶ms](string & k, string & v) { @@ -556,7 +559,7 @@ namespace ftype }}, }); - // Stage4: Match tags to classificator for find feature types. + // Stage4: Match tags in classificator to find feature types. MatchTypes(p, params); // Stage5: Postprocess feature types.