| 60 | } |
| 61 | |
| 62 | void AddressEnricher::AddSrc(feature::FeatureBuilder && fb) |
| 63 | { |
| 64 | auto const osmID = fb.GetMostGenericOsmId(); |
| 65 | auto const & params = fb.GetParams(); |
| 66 | auto const & types = fb.GetTypes(); |
| 67 | |
| 68 | bool const hasStreet = !params.GetStreet().empty(); |
| 69 | |
| 70 | if (hasStreet && !params.house.IsEmpty()) |
| 71 | { |
| 72 | if (fb.IsLine()) |
| 73 | { |
| 74 | LOG(LERROR, ("Linear address FB:", osmID)); |
| 75 | return; |
| 76 | } |
| 77 | else |
| 78 | TransformToPoint(fb); |
| 79 | } |
| 80 | else if (ftypes::IsStreetOrSquareChecker::Instance()(types)) |
| 81 | { |
| 82 | // Skip node "squares" for matching, as far as we make addr:interpolation FBs. |
| 83 | // https://www.openstreetmap.org/node/7315145526 |
| 84 | if (fb.IsPoint()) |
| 85 | { |
| 86 | LOG(LWARNING, ("Point street FB:", osmID)); |
| 87 | return; |
| 88 | } |
| 89 | |
| 90 | std::string_view name; |
| 91 | if (params.name.GetString(localisation::kDefaultNameIndex, name)) |
| 92 | CHECK(!name.empty(), (osmID)); |
| 93 | else if (params.ref.empty()) |
| 94 | return; |
| 95 | } |
| 96 | else if (hasStreet && ftypes::IsAddressInterpolChecker::Instance()(types)) |
| 97 | { |
| 98 | CHECK(!params.ref.empty(), (osmID)); |
| 99 | } |
| 100 | else |
| 101 | return; |
| 102 | |
| 103 | m_srcTree.Add(std::move(fb)); |
| 104 | } |
| 105 | |
| 106 | void AddressEnricher::ProcessRawEntries(std::string const & path, TFBCollectFn const & fn) |
| 107 | { |
no test coverage detected