From 5cd6a12e0eadab0dcf82fd4e64d4188d5fd3a1f6 Mon Sep 17 00:00:00 2001 From: vng Date: Thu, 14 Jun 2012 17:27:27 -0700 Subject: [PATCH] [styles] Add new type "building-address" for isolated house numbers (a lot of this stuff in Praha). --- data/classificator.txt | 1 + data/drules_proto.txt | 31 +++++++++++++++++++++++++++++++ data/types.txt | 2 ++ data/visibility.txt | 1 + generator/osm2type.cpp | 15 +++++++++++++++ 5 files changed, 50 insertions(+) diff --git a/data/classificator.txt b/data/classificator.txt index c91938ab07..9ac5454d79 100644 --- a/data/classificator.txt +++ b/data/classificator.txt @@ -342,6 +342,7 @@ world + {} building 6|1|15|39 7|1|15|40 10|1|15|44 11|1|15|44 12|1|45|188 13|1|51|198 13|2|0|199 14|1|69|260 14|2|3|261 15|1|70|364 15|2|4|365 16|1|71|679 16|2|5|680 17|1|71|720 17|2|2|721 17|3|18|11829 17|3|19|11830 17|3|20|11831 17|3|21|11832 + entrance - + address - {} waterway + riverbank 6|1|16|40 7|1|16|41 8|1|9|31 9|1|9|31 10|1|16|45 11|1|16|45 12|1|21|75 13|1|26|85 14|1|32|123 15|1|36|128 16|1|36|130 17|1|36|132 - diff --git a/data/drules_proto.txt b/data/drules_proto.txt index 239f498fb3..6c99736c0d 100644 --- a/data/drules_proto.txt +++ b/data/drules_proto.txt @@ -4778,6 +4778,37 @@ cont { } } } +cont { + name: "building-address" + element { + scale: 16 + caption { + primary { + height: 11 + color: 0x808070 + } + secondary { + height: 11 + color: 0x808070 + } + priority: 11832 + } + } + element { + scale: 17 + caption { + primary { + height: 11 + color: 0x404040 + } + secondary { + height: 11 + color: 0x404040 + } + priority: 11832 + } + } +} cont { name: "communication-line" element { diff --git a/data/types.txt b/data/types.txt index 094f74e686..8eb952ecf6 100644 --- a/data/types.txt +++ b/data/types.txt @@ -746,3 +746,5 @@ tourism|guest_house tourism|motel boundary|administrative|4|state + +building|address diff --git a/data/visibility.txt b/data/visibility.txt index d5c911e5fc..b880ac0dd3 100644 --- a/data/visibility.txt +++ b/data/visibility.txt @@ -144,6 +144,7 @@ world 000000000000000000 + national_park 000000000011111111 - {} building 000000000000000111 + + address 000000000000000011 - entrance 000000000000000001 - {} communication 000000000000000000 + diff --git a/generator/osm2type.cpp b/generator/osm2type.cpp index 6dab6b7edc..91a67e02ba 100644 --- a/generator/osm2type.cpp +++ b/generator/osm2type.cpp @@ -306,6 +306,13 @@ namespace ftype // }; //#endif + uint32_t GetAddressType() + { + static char const * arr[] = { "building", "address" }; + static uint32_t const res = classif().GetTypeByPath(vector(arr, arr + 2)); + return res; + } + void GetNameAndType(XMLElement * p, FeatureParams & params) { //#ifdef DEBUG @@ -365,6 +372,14 @@ namespace ftype skipRootKeys.insert(path[0]->GetName()); } while (true); + + if (!params.IsValid() && !params.house.IsEmpty()) + { + params.name.Clear(); + // If we have address (house name or number), we should assign valid type. + // There are a lot of features like this in Czech Republic. + params.AddType(GetAddressType()); + } } uint32_t GetBoundaryType2()