From dc843e99eb8b27f27d7e4f33c278ed9ea1453f82 Mon Sep 17 00:00:00 2001 From: FinixFighter <19877271+FinixFighter@users.noreply.github.com> Date: Sat, 3 Jul 2021 21:04:44 +0200 Subject: [PATCH] Merge pull request #742 from FinixFighter/master Use contact:mobile tag if phone and contact:phone are missing --- data/editor.config | 1 + editor/editor_config.hpp | 2 +- editor/xml_feature.cpp | 2 +- indexer/feature_meta.cpp | 2 +- indexer/feature_meta.hpp | 2 +- 5 files changed, 5 insertions(+), 4 deletions(-) diff --git a/data/editor.config b/data/editor.config index 108b9e20e9..14aade5421 100644 --- a/data/editor.config +++ b/data/editor.config @@ -40,6 +40,7 @@ + diff --git a/editor/editor_config.hpp b/editor/editor_config.hpp index dbfa5e9d6b..3d702e6912 100644 --- a/editor/editor_config.hpp +++ b/editor/editor_config.hpp @@ -48,7 +48,7 @@ public: void SetConfig(pugi::xml_document const & doc); // TODO(mgsergio): Implement this getter to avoid hard-code in XMLFeature::ApplyPatch. - // It should return [[phone, contact:phone], [website, contact:website, url], ...]. + // It should return [[phone, contact:phone, contact:mobile], [website, contact:website, url], ...]. //vector> GetAlternativeFields() const; private: diff --git a/editor/xml_feature.cpp b/editor/xml_feature.cpp index 38742f3489..992aba6b9a 100644 --- a/editor/xml_feature.cpp +++ b/editor/xml_feature.cpp @@ -168,7 +168,7 @@ string XMLFeature::ToOSMString() const void XMLFeature::ApplyPatch(XMLFeature const & featureWithChanges) { // TODO(mgsergio): Get these alt tags from the config. - vector> const alternativeTags = {{"phone", "contact:phone"}, + vector> const alternativeTags = {{"phone", "contact:phone", "contact:mobile"}, {"website", "contact:website", "url"}, {"fax", "contact:fax"}, {"email", "contact:email"}}; diff --git a/indexer/feature_meta.cpp b/indexer/feature_meta.cpp index d88595bb25..61c124a42d 100644 --- a/indexer/feature_meta.cpp +++ b/indexer/feature_meta.cpp @@ -59,7 +59,7 @@ bool Metadata::TypeFromString(string const & k, Metadata::EType & outType) { if (k == "opening_hours") outType = Metadata::FMD_OPEN_HOURS; - else if (k == "phone" || k == "contact:phone") + else if (k == "phone" || k == "contact:phone" || k == "contact:mobile") outType = Metadata::FMD_PHONE_NUMBER; else if (k == "fax" || k == "contact:fax") outType = Metadata::EType::FMD_FAX_NUMBER; diff --git a/indexer/feature_meta.hpp b/indexer/feature_meta.hpp index 97370e61e3..3dc364aef1 100644 --- a/indexer/feature_meta.hpp +++ b/indexer/feature_meta.hpp @@ -149,7 +149,7 @@ public: FMD_COUNT }; - /// Used to normalize tags like "contact:phone" and "phone" to a common metadata enum value. + /// Used to normalize tags like "contact:phone", "phone" and "contact:mobile" to a common metadata enum value. static bool TypeFromString(std::string const & osmTagKey, EType & outType); static bool IsSponsoredType(EType const & type);