| 816 | } |
| 817 | |
| 818 | string DeterminePathGrade(OsmElement * p) |
| 819 | { |
| 820 | if (!p->HasTag("highway", "path")) |
| 821 | return {}; |
| 822 | |
| 823 | string scale = p->GetTag("sac_scale"); |
| 824 | string visibility = p->GetTag("trail_visibility"); |
| 825 | |
| 826 | if (scale.empty() && visibility.empty()) |
| 827 | return {}; |
| 828 | |
| 829 | static base::StringIL expertScales = {"alpine_hiking", "demanding_alpine_hiking", "difficult_alpine_hiking"}; |
| 830 | static base::StringIL difficultVisibilities = { |
| 831 | "bad", "poor" // poor is not official |
| 832 | }; |
| 833 | static base::StringIL expertVisibilities = { |
| 834 | "horrible", "no", "very_bad" // very_bad is not official |
| 835 | }; |
| 836 | |
| 837 | if (base::IsExist(expertScales, scale) || base::IsExist(expertVisibilities, visibility)) |
| 838 | return "expert"; |
| 839 | else if (scale == "demanding_mountain_hiking" || base::IsExist(difficultVisibilities, visibility)) |
| 840 | return "difficult"; |
| 841 | |
| 842 | // hiking & mountain_hiking scales, excellent, good, intermediate & unknown visibilities means "no grade" |
| 843 | return {}; |
| 844 | } |
| 845 | |
| 846 | void PreprocessElement(OsmElement * p, CalculateOriginFnT const & calcOrg) |
| 847 | { |
no test coverage detected