| 16 | {} |
| 17 | |
| 18 | bool 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 | |
| 59 | bool FeatureIdToGeoObjectIdOneWay::GetGeoObjectId(FeatureID const & fid, base::GeoObjectId & id) |
| 60 | { |