From fcd1074999ade74327b31ee95f870d4573bf588b Mon Sep 17 00:00:00 2001 From: Sergey Yershov Date: Fri, 4 Sep 2015 14:18:19 +0300 Subject: [PATCH] Skip some tag before process them --- generator/osm_element.cpp | 36 ++++++++++++++++++++++++++++++++++++ generator/osm_element.hpp | 2 +- 2 files changed, 37 insertions(+), 1 deletion(-) diff --git a/generator/osm_element.cpp b/generator/osm_element.cpp index 28a0b5629d..a04f4bb7d3 100644 --- a/generator/osm_element.cpp +++ b/generator/osm_element.cpp @@ -29,6 +29,42 @@ string DebugPrint(OsmElement::EntityType e) } } +#define SKIP_KEY(key) if (strncmp(k.data(), key, sizeof(key)-1) == 0) return; + +void OsmElement::AddTag(string const & k, string const & v) +{ + // OSM technical info tags + SKIP_KEY("created_by"); + SKIP_KEY("source"); + SKIP_KEY("odbl"); + SKIP_KEY("note"); + SKIP_KEY("fixme"); + SKIP_KEY("iemv"); + + // Skip tags for speedup, now we don't use it + SKIP_KEY("not:"); + SKIP_KEY("seamark"); // http://wiki.openstreetmap.org/wiki/OpenSeaMap/Seamark_Tag_Values + SKIP_KEY("artist_name"); + SKIP_KEY("historic"); // http://wiki.openstreetmap.org/wiki/Historic + SKIP_KEY("whitewater"); // http://wiki.openstreetmap.org/wiki/Whitewater_sports + + + // In future we can use this tags for improve our search + SKIP_KEY("old_name"); + SKIP_KEY("alt_name"); + SKIP_KEY("nat_name"); + SKIP_KEY("reg_name"); + SKIP_KEY("loc_name"); + SKIP_KEY("lock_name"); + SKIP_KEY("local_name"); + SKIP_KEY("short_name"); + SKIP_KEY("official_name"); + + + m_tags.emplace_back(k, v); +} + + string OsmElement::ToString(string const & shift) const { stringstream ss; diff --git a/generator/osm_element.hpp b/generator/osm_element.hpp index 3cc7e74062..20799d90be 100644 --- a/generator/osm_element.hpp +++ b/generator/osm_element.hpp @@ -123,12 +123,12 @@ struct OsmElement ); } - void AddTag(string const & k, string const & v) { m_tags.emplace_back(k, v); } void AddNd(uint64_t ref) { m_nds.emplace_back(ref); } void AddMember(uint64_t ref, EntityType type, string const & role) { m_members.emplace_back(ref, type, role); } + void AddTag(string const & k, string const & v); }; string DebugPrint(OsmElement const & e);