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

Method CollectFeature

generator/metalines_builder.cpp:177–193  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

175}
176
177void MetalinesBuilder::CollectFeature(FeatureBuilder const & feature, OsmElement const & element)
178{
179 if (!feature.IsLine())
180 return;
181
182 static auto const highwayType = classif().GetTypeByPath({"highway"});
183 if (!feature.HasType(highwayType, 1 /* level */) || element.Nodes().front() == element.Nodes().back())
184 return;
185
186 auto const & params = feature.GetParams();
187 auto const name = feature.GetName();
188 if (name.empty() && params.ref.empty())
189 return;
190
191 WriteVarUint(*m_writer, static_cast<uint64_t>(std::hash<std::string>{}(std::string(name) + '\0' + params.ref)));
192 LineString(element).Serialize(*m_writer);
193}
194
195void MetalinesBuilder::Finish()
196{

Callers

nothing calls this directly

Calls 12

WriteVarUintFunction · 0.85
LineStringClass · 0.85
IsLineMethod · 0.80
GetTypeByPathMethod · 0.80
frontMethod · 0.80
NodesMethod · 0.80
backMethod · 0.80
GetParamsMethod · 0.80
HasTypeMethod · 0.45
GetNameMethod · 0.45
emptyMethod · 0.45
SerializeMethod · 0.45

Tested by

no test coverage detected