| 1596 | } |
| 1597 | |
| 1598 | uint32_t Geocoder::MatchWorld2Country(FeatureID const & id) const |
| 1599 | { |
| 1600 | if (m_context->m_handle.GetId() == id.m_mwmId) |
| 1601 | return id.m_index; |
| 1602 | |
| 1603 | ASSERT(id.IsWorld(), ()); |
| 1604 | // Get source Feature's name and center. |
| 1605 | std::string name; |
| 1606 | m2::PointD pt; |
| 1607 | m_dataSource.ReadFeature([&](FeatureType & ft) |
| 1608 | { |
| 1609 | name = ft.GetName(localisation::kDefaultNameIndex); |
| 1610 | pt = feature::GetCenter(ft); |
| 1611 | }, id); |
| 1612 | |
| 1613 | // Match name and center in the current MwmContext. |
| 1614 | uint32_t resID = kInvalidFeatureId; |
| 1615 | m_context->ForEachFeature({pt, pt}, [&](FeatureType & ft) |
| 1616 | { |
| 1617 | if (resID == kInvalidFeatureId && ft.GetName(localisation::kDefaultNameIndex) == name && |
| 1618 | // Relaxed points comparison because geometry coding in the World and in a Country is different. |
| 1619 | feature::GetCenter(ft).EqualDxDy(pt, kMwmPointAccuracy * 100)) |
| 1620 | { |
| 1621 | resID = ft.GetID().m_index; |
| 1622 | } |
| 1623 | }); |
| 1624 | |
| 1625 | return resID; |
| 1626 | } |
| 1627 | |
| 1628 | void Geocoder::FindPaths(BaseContext & ctx) |
| 1629 | { |
nothing calls this directly
no test coverage detected