diff options
author | Alex Zolotarev <alex@maps.me> | 2016-02-18 15:44:43 +0300 |
---|---|---|
committer | Sergey Yershov <yershov@corp.mail.ru> | 2016-03-23 16:50:49 +0300 |
commit | f15a30063e062be38ce46c83604d0cc50215b12a (patch) | |
tree | 50cc2e6619f1a5cc533b16db05ed2aaa5e413e51 /indexer/feature.cpp | |
parent | f57bc232e675ae628a4342463cfa620501e0dddb (diff) |
Patch FeatureType with EditableFeature.
Diffstat (limited to 'indexer/feature.cpp')
-rw-r--r-- | indexer/feature.cpp | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/indexer/feature.cpp b/indexer/feature.cpp index 00e88cfd2c..a9e4b533d8 100644 --- a/indexer/feature.cpp +++ b/indexer/feature.cpp @@ -91,6 +91,29 @@ void FeatureType::ApplyPatch(editor::XMLFeature const & xml) m_bHeader2Parsed = true; } +void FeatureType::ApplyPatch(osm::EditableMapObject const & emo) +{ + if (feature::GEOM_POINT == GetFeatureType()) + m_center = emo.GetMercator(); + + m_params.name = emo.GetName(); + string const & house = emo.GetHouseNumber(); + if (house.empty()) + m_params.house.Clear(); + else + m_params.house.Set(house); + m_bCommonParsed = true; + + m_metadata = emo.GetMetadata(); + m_bMetadataParsed = true; + + uint32_t typesCount = 0; + for (uint32_t const type : emo.GetTypes()) + m_types[typesCount++] = type; + m_header = CalculateHeader(typesCount, Header() & HEADER_GEOTYPE_MASK, m_params); + m_bHeader2Parsed = true; +} + editor::XMLFeature FeatureType::ToXML() const { editor::XMLFeature feature(GetFeatureType() == feature::GEOM_POINT |