| 58 | } |
| 59 | |
| 60 | uint8_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 |