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

Function GetAdminLevel

generator/osm_element_helpers.cpp:60–73  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

58}
59
60uint8_t GetAdminLevel(OsmElement const & elem)
61{
62 auto const str = elem.GetTag("admin_level");
63 if (!str.empty())
64 {
65 int res = 0;
66 if (strings::to_int(str, res) && res > 0 && res < 13)
67 return static_cast<uint8_t>(res);
68
69 // There are too many custom admin_level value.
70 // LOG(LWARNING, ("Failed to get admin_level from", str, elem.m_id));
71 }
72 return 0;
73}
74
75} // namespace osm_element
76} // namespace generator

Callers 1

LocalityMethod · 0.85

Calls 3

to_intFunction · 0.85
GetTagMethod · 0.80
emptyMethod · 0.45

Tested by

no test coverage detected