mirror of
https://codeberg.org/comaps/comaps
synced 2025-12-19 13:03:36 +00:00
[editor] Lower priority for building in changeset comments
Signed-off-by: map-per <map-per@gmx.de>
This commit is contained in:
@@ -34,7 +34,7 @@ std::string_view constexpr kVowels = "aeiouy";
|
|||||||
|
|
||||||
std::string_view constexpr kMainTags[] = {"amenity", "shop", "tourism", "historic", "craft", "emergency",
|
std::string_view constexpr kMainTags[] = {"amenity", "shop", "tourism", "historic", "craft", "emergency",
|
||||||
"barrier", "highway", "office", "leisure", "waterway", "natural",
|
"barrier", "highway", "office", "leisure", "waterway", "natural",
|
||||||
"place", "entrance", "building", "man_made", "healthcare", "attraction"};
|
"place", "entrance", "man_made", "healthcare", "attraction"};
|
||||||
|
|
||||||
std::string GetTypeForFeature(editor::XMLFeature const & node)
|
std::string GetTypeForFeature(editor::XMLFeature const & node)
|
||||||
{
|
{
|
||||||
@@ -46,7 +46,7 @@ std::string GetTypeForFeature(editor::XMLFeature const & node)
|
|||||||
std::string value = node.GetTagValue(key);
|
std::string value = node.GetTagValue(key);
|
||||||
if (value == "yes")
|
if (value == "yes")
|
||||||
return std::string{key};
|
return std::string{key};
|
||||||
else if (key == "shop" || key == "office" || key == "building" || key == "entrance" || key == "attraction")
|
else if (key == "shop" || key == "office" || key == "entrance" || key == "attraction")
|
||||||
return value.append(" ").append(key); // "convenience shop"
|
return value.append(" ").append(key); // "convenience shop"
|
||||||
else if (!value.empty() && value.back() == 's')
|
else if (!value.empty() && value.back() == 's')
|
||||||
// Remove 's' from the tail: "toilets" -> "toilet".
|
// Remove 's' from the tail: "toilets" -> "toilet".
|
||||||
@@ -60,6 +60,12 @@ std::string GetTypeForFeature(editor::XMLFeature const & node)
|
|||||||
if (node.HasTag("disused:shop") || node.HasTag("disused:amenity"))
|
if (node.HasTag("disused:shop") || node.HasTag("disused:amenity"))
|
||||||
return "vacant business";
|
return "vacant business";
|
||||||
|
|
||||||
|
if (node.HasTag("building"))
|
||||||
|
{
|
||||||
|
std::string value = node.GetTagValue("building");
|
||||||
|
return value == "yes" ? "building" : value.append(" building");
|
||||||
|
}
|
||||||
|
|
||||||
if (node.HasTag("addr:housenumber") || node.HasTag("addr:street") || node.HasTag("addr:postcode"))
|
if (node.HasTag("addr:housenumber") || node.HasTag("addr:street") || node.HasTag("addr:postcode"))
|
||||||
return "address";
|
return "address";
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user