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

brands_loader.hpp « generator - github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: e32eaad8e651a854bcd70dde35912eb75168434a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#pragma once

#include "base/geo_object_id.hpp"

#include <string>
#include <unordered_map>

namespace generator
{
// Loads brand GeoObjectId to brand key map from json.
// |brandsFilename| file example:
//
//------------------------------------------------------
//   {
//    "nodes": {
//      "2132500347": 13,
//      "5321137826": 12
//    },
//    "ways: {
//      "440527172": 13,
//      "149816366": 12
//    },
//    "relations": {
//      "6018309": 13,
//      "6228042": 12
//    }
//   }
//------------------------------------------------------
//
// |translationsFilename| example:
//
//------------------------------------------------------
//    {
//      "12": {
//        "en": ["Subway"],
//        "ru": ["Сабвей", "Сабвэй"]
//      },
//      "13": {
//        "en": ["McDonalds", "Mc Donalds"],
//        "ru": ["Макдоналдс", "Мак Дональдс", "Мак Дональд'с"]
//      }
//    }
//------------------------------------------------------
//
// Which means OSM node 2132500347, OSM way 440527172 and OSM relation 6018309 belong to
// brand with id 13.
// OSM node 5321137826, OSM way 149816366 and OSM relation 6228042 belong to brand with id 12.
// Brand with id 13 has names in English and Russian. The most popular English name is "McDonalds",
// the second most popluar one is "Mc Donalds". The most popular Russian name is "Макдоналдс", then
// "Мак Дональдс", then "Мак Дональд'с".
// Brand with id 12 has names in English and Russian. Name in English is "Subway". The most popular Russian
// name is "Сабвей", then "Сабвэй".

bool LoadBrands(std::string const & brandsFilename, std::string const & translationsFilename,
                std::unordered_map<base::GeoObjectId, std::string> & brands);
}  // namespace generator