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

Method AddSrc

generator/address_enricher.cpp:62–104  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

60}
61
62void 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
106void AddressEnricher::ProcessRawEntries(std::string const & path, TFBCollectFn const & fn)
107{

Callers 1

AddAddressesMethod · 0.80

Calls 11

TransformToPointFunction · 0.85
GetMostGenericOsmIdMethod · 0.80
GetParamsMethod · 0.80
IsLineMethod · 0.80
GetTypesMethod · 0.45
emptyMethod · 0.45
GetStreetMethod · 0.45
IsEmptyMethod · 0.45
IsPointMethod · 0.45
GetStringMethod · 0.45
AddMethod · 0.45

Tested by

no test coverage detected