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

Method GetTypeInGeocoding

libs/search/geocoder.cpp:1925–1949  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1923}
1924
1925bool Geocoder::GetTypeInGeocoding(BaseContext const & ctx, uint32_t featureId, Model::Type & type)
1926{
1927 if (ctx.m_streets.HasBit(featureId))
1928 {
1929 type = Model::TYPE_STREET;
1930 return true;
1931 }
1932 if (ctx.m_suburbs.HasBit(featureId))
1933 {
1934 type = Model::TYPE_SUBURB;
1935 return true;
1936 }
1937 if (ctx.m_villages.HasBit(featureId))
1938 {
1939 type = Model::TYPE_VILLAGE;
1940 return true;
1941 }
1942
1943 auto feature = m_context->GetFeature(featureId);
1944 if (!feature)
1945 return false;
1946
1947 type = m_model.GetType(*feature);
1948 return true;
1949}
1950} // namespace search
1951
1952#undef TRACE

Callers

nothing calls this directly

Calls 3

HasBitMethod · 0.80
GetFeatureMethod · 0.45
GetTypeMethod · 0.45

Tested by

no test coverage detected