diff --git a/data/classificator.txt b/data/classificator.txt index 7c0682b8fb..4db67828ab 100644 --- a/data/classificator.txt +++ b/data/classificator.txt @@ -171,6 +171,7 @@ world + building + address - garage - + has_parts - train_station - {} building:part - diff --git a/data/drules_proto.bin b/data/drules_proto.bin index ea409b0e54..be4aad6b7c 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 cf8103fa90..95afea11f7 100644 --- a/data/drules_proto.txt +++ b/data/drules_proto.txt @@ -12422,6 +12422,86 @@ cont { } } } +cont { + name: "building-has_parts" + element { + scale: 14 + area { + color: 2160707771 + priority: 1298 + } + } + element { + scale: 15 + area { + color: 1724500155 + priority: 1298 + } + } + element { + scale: 16 + area { + color: 868862139 + priority: 1352 + } + caption { + primary { + height: 9 + color: 6645086 + text: "addr:housename" + } + priority: 15351 + } + } + element { + scale: 17 + area { + color: 12763315 + priority: 1352 + } + caption { + primary { + height: 9 + color: 6381914 + } + secondary { + height: 8 + color: 6381914 + offset_y: 20 + text: "int_name" + } + priority: 15351 + } + } + element { + scale: 18 + area { + color: 12763315 + priority: 1352 + } + caption { + primary { + height: 11 + color: 6381914 + } + priority: 15351 + } + } + element { + scale: 19 + area { + color: 12763315 + priority: 1352 + } + caption { + primary { + height: 11 + color: 6381914 + } + priority: 15351 + } + } +} cont { name: "building-train_station" element { diff --git a/data/drules_proto_clear.bin b/data/drules_proto_clear.bin index 27c651e501..a47eda1918 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 cd9194a44c..a3a0399640 100644 --- a/data/drules_proto_clear.txt +++ b/data/drules_proto_clear.txt @@ -9944,6 +9944,86 @@ cont { } } } +cont { + name: "building-has_parts" + element { + scale: 14 + area { + color: 2160707771 + priority: 1298 + } + } + element { + scale: 15 + area { + color: 1724500155 + priority: 1298 + } + } + element { + scale: 16 + area { + color: 868862139 + priority: 1352 + } + caption { + primary { + height: 9 + color: 6645086 + text: "addr:housename" + } + priority: 15351 + } + } + element { + scale: 17 + area { + color: 12763315 + priority: 1352 + } + caption { + primary { + height: 9 + color: 6381914 + } + secondary { + height: 8 + color: 6381914 + offset_y: 20 + text: "int_name" + } + priority: 15351 + } + } + element { + scale: 18 + area { + color: 12763315 + priority: 1352 + } + caption { + primary { + height: 11 + color: 6381914 + } + priority: 15351 + } + } + element { + scale: 19 + area { + color: 12763315 + priority: 1352 + } + caption { + primary { + height: 11 + color: 6381914 + } + priority: 15351 + } + } +} cont { name: "building-train_station" element { diff --git a/data/drules_proto_dark.bin b/data/drules_proto_dark.bin index 0d519fdc20..3d1c96b743 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 2e0205992b..969c698d6b 100644 --- a/data/drules_proto_dark.txt +++ b/data/drules_proto_dark.txt @@ -9944,6 +9944,86 @@ cont { } } } +cont { + name: "building-has_parts" + element { + scale: 14 + area { + color: 2149720610 + priority: 1298 + } + } + element { + scale: 15 + area { + color: 1713512994 + priority: 1298 + } + } + element { + scale: 16 + area { + color: 857874978 + priority: 1352 + } + caption { + primary { + height: 9 + color: 5592405 + text: "addr:housename" + } + priority: 15351 + } + } + element { + scale: 17 + area { + color: 3355443 + priority: 1352 + } + caption { + primary { + height: 9 + color: 5592405 + } + secondary { + height: 8 + color: 5592405 + offset_y: 20 + text: "int_name" + } + priority: 15351 + } + } + element { + scale: 18 + area { + color: 3355443 + priority: 1352 + } + caption { + primary { + height: 11 + color: 5592405 + } + priority: 15351 + } + } + element { + scale: 19 + area { + color: 3355443 + priority: 1352 + } + caption { + primary { + height: 11 + color: 5592405 + } + priority: 15351 + } + } +} cont { name: "building-train_station" element { diff --git a/data/drules_proto_legacy.bin b/data/drules_proto_legacy.bin index 0a64b64bfd..57b2cb9d85 100644 Binary files a/data/drules_proto_legacy.bin and b/data/drules_proto_legacy.bin differ diff --git a/data/drules_proto_legacy.txt b/data/drules_proto_legacy.txt index 13e2eb31c7..f059bcddca 100644 --- a/data/drules_proto_legacy.txt +++ b/data/drules_proto_legacy.txt @@ -9213,6 +9213,96 @@ cont { } } } +cont { + name: "building-has_parts" + element { + scale: 15 + area { + color: 13487540 + priority: 1001 + } + } + element { + scale: 16 + area { + color: 13487540 + priority: 1001 + } + caption { + primary { + height: 10 + color: 8421488 + } + secondary { + height: 11 + color: 8421488 + offset_y: 20 + text: "int_name" + } + priority: 15000 + } + } + element { + scale: 17 + area { + color: 13487540 + priority: 1001 + } + caption { + primary { + height: 11 + color: 4210752 + } + secondary { + height: 11 + color: 4210752 + offset_y: 20 + text: "int_name" + } + priority: 15000 + } + } + element { + scale: 18 + area { + color: 13487540 + priority: 1001 + } + caption { + primary { + height: 11 + color: 4210752 + } + secondary { + height: 11 + color: 4210752 + offset_y: 20 + text: "int_name" + } + priority: 15000 + } + } + element { + scale: 19 + area { + color: 13487540 + priority: 1001 + } + caption { + primary { + height: 11 + color: 4210752 + } + secondary { + height: 11 + color: 4210752 + offset_y: 20 + text: "int_name" + } + priority: 15000 + } + } +} cont { name: "building-train_station" element { diff --git a/data/mapcss-mapping.csv b/data/mapcss-mapping.csv index b973cff873..5c5cbfa4fa 100644 --- a/data/mapcss-mapping.csv +++ b/data/mapcss-mapping.csv @@ -1121,3 +1121,4 @@ psurface|unpaved_bad;1120; wheelchair|yes;1121; wheelchair|no;1122; wheelchair|limited;1123; +building|has_parts;1124; diff --git a/data/types.txt b/data/types.txt index f91d27d4a3..8d2e670f83 100644 --- a/data/types.txt +++ b/data/types.txt @@ -1121,3 +1121,4 @@ psurface|unpaved_bad wheelchair|yes wheelchair|no wheelchair|limited +building|has_parts diff --git a/data/visibility.txt b/data/visibility.txt index 042790f3b6..c0f4049f84 100644 --- a/data/visibility.txt +++ b/data/visibility.txt @@ -171,6 +171,7 @@ world 00000000000000000000 + building 00000000000000011111 + address 00000000000000001111 - garage 00000000000000011111 - + has_parts 00000000000000011111 - train_station 00000000000000011111 - {} building:part 00000000000000011111 - diff --git a/generator/intermediate_elements.hpp b/generator/intermediate_elements.hpp index b05aefee26..8267f1599a 100644 --- a/generator/intermediate_elements.hpp +++ b/generator/intermediate_elements.hpp @@ -110,6 +110,22 @@ public: toDo(ways[i].first, ways[i].second); } + string GetNodeRole(uint64_t const id) const + { + for (size_t i = 0; i < nodes.size(); ++i) + if (nodes[i].first == id) + return nodes[i].second; + return string(); + } + + string GetWayRole(uint64_t const id) const + { + for (size_t i = 0; i < ways.size(); ++i) + if (ways[i].first == id) + return ways[i].second; + return string(); + } + void Swap(RelationElement & rhs) { nodes.swap(rhs.nodes); diff --git a/generator/osm2type.cpp b/generator/osm2type.cpp index afa8e22b03..da9d63210d 100644 --- a/generator/osm2type.cpp +++ b/generator/osm2type.cpp @@ -217,6 +217,7 @@ namespace ftype public: enum EType { ENTRANCE, HIGHWAY, ADDRESS, ONEWAY, PRIVATE, LIT, NOFOOT, YESFOOT, NOBICYCLE, YESBICYCLE, BICYCLE_BIDIR, SURFPGOOD, SURFPBAD, SURFUGOOD, SURFUBAD, + HASPARTS, RW_STATION, RW_STATION_SUBWAY, WHEELCHAIR_YES }; CachedTypes() @@ -233,6 +234,7 @@ namespace ftype {"hwtag", "nobicycle"}, {"hwtag", "yesbicycle"}, {"hwtag", "bidir_bicycle"}, {"psurface", "paved_good"}, {"psurface", "paved_bad"}, {"psurface", "unpaved_good"}, {"psurface", "unpaved_bad"}, + {"building", "has_parts"} }; for (auto const & e : arr) m_types.push_back(c.GetTypeByPath(e)); @@ -548,6 +550,8 @@ namespace ftype TagProcessor(p).ApplyRules ({ { "wheelchair", "designated", [¶ms] { params.AddType(types.Get(CachedTypes::WHEELCHAIR_YES)); }}, + { "building:part", "no", [¶ms] { params.AddType(types.Get(CachedTypes::HASPARTS)); }}, + { "building:parts", "~", [¶ms] { params.AddType(types.Get(CachedTypes::HASPARTS)); }}, }); bool highwayDone = false; diff --git a/generator/osm_source.cpp b/generator/osm_source.cpp index 6d62f44780..236303b92f 100644 --- a/generator/osm_source.cpp +++ b/generator/osm_source.cpp @@ -134,7 +134,8 @@ public: { string const & relationType = e.GetType(); if (!(relationType == "multipolygon" || relationType == "route" || - relationType == "boundary" || relationType == "associatedStreet")) + relationType == "boundary" || relationType == "associatedStreet" || + relationType == "building")) return; m_relations.Write(id, e); diff --git a/generator/osm_translator.hpp b/generator/osm_translator.hpp index bf5595c426..f312752518 100644 --- a/generator/osm_translator.hpp +++ b/generator/osm_translator.hpp @@ -207,6 +207,14 @@ protected: if (TBase::IsSkipRelation(type) || type == "route") return; + if (type == "building") + { + // If this way has "outline" role, add [building=has_parts] type. + if (e.GetWayRole(m_current->id) == "outline") + TBase::AddCustomTag({"building", "has_parts"}); + return; + } + bool const isBoundary = (type == "boundary") && IsAcceptBoundary(e); bool const processAssociatedStreet = type == "associatedStreet" && TBase::IsKeyTagExists("addr:housenumber") && !TBase::IsKeyTagExists("addr:street");