| 31 | using namespace routing; |
| 32 | |
| 33 | std::unique_ptr<IndexGraph> CreateIndexGraph(std::string const & mwmPath, std::string const & country, |
| 34 | CountryParentNameGetterFn const & countryParentNameGetterFn) |
| 35 | { |
| 36 | std::shared_ptr<VehicleModelInterface> vehicleModel = |
| 37 | CarModelFactory(countryParentNameGetterFn).GetVehicleModelForCountry(country); |
| 38 | |
| 39 | MwmValue mwmValue(platform::LocalCountryFile::MakeTemporary(mwmPath)); |
| 40 | |
| 41 | auto graph = |
| 42 | std::make_unique<IndexGraph>(std::make_shared<Geometry>(GeometryLoader::CreateFromFile(mwmPath, vehicleModel)), |
| 43 | EdgeEstimator::Create(VehicleType::Car, *vehicleModel, nullptr /* trafficStash */, |
| 44 | nullptr /* dataSource */, nullptr /* numMvmIds */)); |
| 45 | |
| 46 | DeserializeIndexGraph(mwmValue, VehicleType::Car, *graph); |
| 47 | return graph; |
| 48 | } |
| 49 | |
| 50 | void SerializeRestrictions(RestrictionCollector & restrictionCollector, std::string const & mwmPath) |
| 51 | { |