| 42 | "place", "entrance", "man_made", "healthcare", "attraction"}; |
| 43 | |
| 44 | std::string GetTypeForFeature(editor::XMLFeature const & node) |
| 45 | { |
| 46 | for (std::string_view const key : kMainTags) |
| 47 | { |
| 48 | if (node.HasTag(key)) |
| 49 | { |
| 50 | // Non-const for RVO. |
| 51 | std::string value = node.GetTagValue(key); |
| 52 | if (value == "yes") |
| 53 | return std::string{key}; |
| 54 | else if (key == "shop" || key == "office" || key == "entrance" || key == "attraction") |
| 55 | return value.append(" ").append(key); // "convenience shop" |
| 56 | else if (!value.empty() && value.back() == 's') |
| 57 | // Remove 's' from the tail: "toilets" -> "toilet". |
| 58 | return value.erase(value.size() - 1); |
| 59 | else if (key == "healthcare" && value == "alternative") |
| 60 | return "alternative medicine"; |
| 61 | return value; |
| 62 | } |
| 63 | } |
| 64 | |
| 65 | if (node.HasTag("disused:shop") || node.HasTag("disused:amenity")) |
| 66 | return "vacant business"; |
| 67 | |
| 68 | if (node.HasTag("building")) |
| 69 | { |
| 70 | std::string value = node.GetTagValue("building"); |
| 71 | return value == "yes" ? "building" : value.append(" building"); |
| 72 | } |
| 73 | |
| 74 | if (node.HasTag("addr:housenumber") || node.HasTag("addr:street") || node.HasTag("addr:postcode")) |
| 75 | return "address"; |
| 76 | |
| 77 | // Did not find any known tags. |
| 78 | return node.HasAnyTags() ? "unknown object" : "empty object"; |
| 79 | } |
| 80 | |
| 81 | std::vector<m2::PointD> NaiveSample(std::vector<m2::PointD> const & source, size_t count) |
| 82 | { |