diff options
author | Sergey Magidovich <mgsergio@mapswithme.com> | 2015-12-23 17:10:09 +0300 |
---|---|---|
committer | Sergey Yershov <yershov@corp.mail.ru> | 2016-03-23 16:04:06 +0300 |
commit | 0cd90b502238a889535400b9d8344aea9a95488a (patch) | |
tree | ce57b8f592b3c155d5d1cff43f12956c57dcb282 /indexer/feature.cpp | |
parent | e4f10f150243b954f844a84bca2608f5954d8f23 (diff) |
Implement type of a FeatureType serialization.
Diffstat (limited to 'indexer/feature.cpp')
-rw-r--r-- | indexer/feature.cpp | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/indexer/feature.cpp b/indexer/feature.cpp index 718f21a246..b340312568 100644 --- a/indexer/feature.cpp +++ b/indexer/feature.cpp @@ -1,9 +1,11 @@ +#include "indexer/classificator.hpp" #include "indexer/feature.hpp" #include "indexer/classificator.hpp" #include "indexer/feature_algo.hpp" #include "indexer/feature_loader_base.hpp" #include "indexer/feature_visibility.hpp" +#include "indexer/osm_editor.hpp" #include "geometry/distance.hpp" #include "geometry/robust_orientation.hpp" @@ -12,6 +14,8 @@ #include "base/range_iterator.hpp" +#include "std/algorithm.hpp" + using namespace feature; /////////////////////////////////////////////////////////////////////////////////////////////////// @@ -58,12 +62,8 @@ FeatureType FeatureType::FromXML(editor::XMLFeature const & xml) // EGeomType - // for (auto const i : my::Range(feature.GetTypesCount())) - // m_types[i] = - // Does the order matter? If so what order should be? - // TODO(mgsergio): Only features with single type are currently supported. - // TODO(mgsergio): Replace hardcode with real values. - feature.m_types[0] = classif().GetTypeByPath({"amenity", "atm"}); + auto const & types = osm::Editor::Instance().GetTypesOfFeature(xml); + copy(begin(types), end(types), begin(feature.m_types)); feature.m_bTypesParsed = true; for (auto const i : my::Range(1u, static_cast<uint32_t>(feature::Metadata::FMD_COUNT))) @@ -105,12 +105,12 @@ editor::XMLFeature FeatureType::ToXML() const // feature.m_params.layer = // feature.m_params.rank = - // for (auto const i : my::Range(feature.GetTypesCount())) - // m_types[i] = - // Does the order matter? If so what order should be? - // TODO(mgsergio): Only features with single type are currently supported. ParseTypes(); - feature.SetTagValue("amenity", "atm"); // TODO(mgsergio): Replace hardcode with real values. + for (auto const i : my::Range(GetTypesCount())) + { + for (auto const & tag : osm::Editor::Instance().GetTagsForType(m_types[i])) + feature.SetTagValue(tag.first, tag.second); + } for (auto const type : m_metadata.GetPresentTypes()) { |