MCPcopy Create free account
hub / github.com/comaps/comaps / Load

Method Load

libs/indexer/feature_to_osm.cpp:18–57  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

16{}
17
18bool FeatureIdToGeoObjectIdOneWay::Load()
19{
20 auto const handle = indexer::FindWorld(m_dataSource);
21 if (!handle.IsAlive())
22 {
23 LOG(LWARNING, ("Can't find World map file."));
24 return false;
25 }
26
27 if (handle.GetId() == m_mwmId)
28 return true;
29
30 auto const & cont = handle.GetValue()->m_cont;
31
32 if (!cont.IsExist(FEATURE_TO_OSM_FILE_TAG))
33 {
34 LOG(LWARNING, ("No cities fid bimap in the world map."));
35 return false;
36 }
37
38 bool success = false;
39 try
40 {
41 m_reader = cont.GetReader(FEATURE_TO_OSM_FILE_TAG);
42 success = FeatureIdToGeoObjectIdSerDes::Deserialize(*m_reader.GetPtr(), *this);
43 }
44 catch (Reader::Exception const & e)
45 {
46 LOG(LERROR, ("Can't read cities fid bimap from the world map:", e.Msg()));
47 return false;
48 }
49
50 if (success)
51 {
52 m_mwmId = handle.GetId();
53 return true;
54 }
55
56 return false;
57}
58
59bool FeatureIdToGeoObjectIdOneWay::GetGeoObjectId(FeatureID const & fid, base::GeoObjectId & id)
60{

Callers

nothing calls this directly

Calls 7

FindWorldFunction · 0.85
IsExistMethod · 0.80
IsAliveMethod · 0.45
GetIdMethod · 0.45
GetValueMethod · 0.45
GetReaderMethod · 0.45
GetPtrMethod · 0.45

Tested by

no test coverage detected