Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIlya Zverev <zverik@textual.ru>2016-07-13 19:09:33 +0300
committerIlya Zverev <zverik@textual.ru>2016-07-13 19:50:43 +0300
commit01686c72103cec6e4c45916d815b8e9cb695f0f1 (patch)
treef1c3ed31ea452f9d00a357040f3fc701cc3479e0 /generator
parent201968fbc3b09b97a08d9176ea0641b32a2af0c7 (diff)
[generator] Mark buildings that have 3D parts inside
Diffstat (limited to 'generator')
-rw-r--r--generator/intermediate_elements.hpp16
-rw-r--r--generator/osm2type.cpp4
-rw-r--r--generator/osm_source.cpp3
-rw-r--r--generator/osm_translator.hpp8
4 files changed, 30 insertions, 1 deletions
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", [&params] { params.AddType(types.Get(CachedTypes::WHEELCHAIR_YES)); }},
+ { "building:part", "no", [&params] { params.AddType(types.Get(CachedTypes::HASPARTS)); }},
+ { "building:parts", "~", [&params] { 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");