mirror of
https://codeberg.org/comaps/comaps
synced 2026-01-09 22:04:43 +00:00
[styles] Keep using shorter type for simple charging stations
Signed-off-by: Yannik Bloscheck <git@yannikbloscheck.com>
This commit is contained in:
@@ -42,7 +42,7 @@
|
||||
<string name="type.amenity.gambling">Glücksspiel</string>
|
||||
<string name="type.leisure.adult_gaming_centre">Spielhalle für Erwachsene</string>
|
||||
<string name="type.leisure.amusement_arcade">Spielhalle für Unterhaltungsspiele</string>
|
||||
<string name="type.amenity.charging_station.general">Ladestation</string>
|
||||
<string name="type.amenity.charging_station">Ladestation</string>
|
||||
<string name="type.amenity.charging_station.bicycle">Fahrräder</string>
|
||||
<string name="type.amenity.charging_station.motorcycle">Motorräder</string>
|
||||
<string name="type.amenity.charging_station.motorcar">Autos</string>
|
||||
|
||||
@@ -52,7 +52,7 @@
|
||||
<string name="type.amenity.gambling">Gambling</string>
|
||||
<string name="type.leisure.adult_gaming_centre">Adult Gaming Centre</string>
|
||||
<string name="type.leisure.amusement_arcade">Arcade</string>
|
||||
<string name="type.amenity.charging_station.general">Charging Station</string>
|
||||
<string name="type.amenity.charging_station">Charging Station</string>
|
||||
<string name="type.amenity.charging_station.bicycle">Bicycles</string>
|
||||
<string name="type.amenity.charging_station.motorcycle">Motorcycles</string>
|
||||
<string name="type.amenity.charging_station.motorcar">Cars</string>
|
||||
|
||||
@@ -354,7 +354,7 @@
|
||||
"amenity-veterinary": "4Veterinary Doctor|3Veterinary|vet|veterinarian",
|
||||
"amenity-animal_shelter": "6Animal Shelter",
|
||||
"@charging_station": "4Charging Station|charging|charger",
|
||||
"amenity-charging_station-general|@charging_station": "",
|
||||
"amenity-charging_station|@charging_station": "",
|
||||
"amenity-charging_station-bicycle|@charging_station": "4Bicycle Charging Station|Bicycle Charging|Bike Charging",
|
||||
"amenity-charging_station-motorcycle|@charging_station": "5Motorcycle Charging Station|Motorcycle Charging|Motorbike Charging",
|
||||
"amenity-charging_station-motorcar|@charging_station": "3Car Charging Station|Motorcar Charging|Car Charging",
|
||||
|
||||
@@ -1193,7 +1193,7 @@ shop|tyres;1064;
|
||||
craft|beekeeper;1065;
|
||||
amenity|car_wash;1066;
|
||||
amenity|veterinary;1067;
|
||||
amenity|charging_station|general;[amenity=charging_station];;name;int_name;1068;
|
||||
amenity|charging_station;[amenity=charging_station];;name;int_name;1068;
|
||||
amenity|childcare;1069;
|
||||
craft|blacksmith;1070;
|
||||
amenity|bicycle_parking;1071;
|
||||
|
||||
|
Can't render this file because it contains an unexpected character in line 7 and column 16.
|
@@ -85,9 +85,9 @@ landuse-cemetery-christian # area z10- (also has icon z
|
||||
=== 180
|
||||
|
||||
amenity-car_wash # area z15- (also has icon z17-, caption(optional) z17-)
|
||||
amenity-charging_station # area z16- (also has icon z16-, caption(optional) z16-)
|
||||
amenity-charging_station-bicycle # area z16- (also has icon z16-, caption(optional) z16-)
|
||||
amenity-charging_station-carless # area z16- (also has icon z16-, caption(optional) z16-)
|
||||
amenity-charging_station-general # area z16- (also has icon z16-, caption(optional) z16-)
|
||||
amenity-charging_station-motorcar # area z15- (also has icon z14-, caption(optional) z14-)
|
||||
amenity-charging_station-motorcycle # area z16- (also has icon z16-, caption(optional) z16-)
|
||||
amenity-charging_station-small # area z15- (also has icon z15-, caption(optional) z16-)
|
||||
|
||||
@@ -435,7 +435,7 @@ amenity-charging_station-motorcycle # icon z16- (also has captio
|
||||
amenity-charging_station-bicycle # icon z16- (also has caption(optional) z16-, area z16-)
|
||||
=== 3751
|
||||
|
||||
amenity-charging_station-general # icon z16- (also has caption(optional) z16-, area z16-)
|
||||
amenity-charging_station # icon z16- (also has caption(optional) z16-, area z16-)
|
||||
=== 3750
|
||||
|
||||
amenity-charging_station-carless # icon z16- (also has caption(optional) z16-, area z16-)
|
||||
@@ -1712,7 +1712,7 @@ leisure-swimming_pool-private # icon z17- (also has captio
|
||||
# amenity-charging_station-bicycle # caption(optional) z16- (also has icon z16-, area z16-)
|
||||
# === -6249
|
||||
|
||||
# amenity-charging_station-general # caption(optional) z16- (also has icon z16-, area z16-)
|
||||
# amenity-charging_station # caption(optional) z16- (also has icon z16-, area z16-)
|
||||
# === -6250
|
||||
|
||||
# amenity-charging_station-carless # caption(optional) z16- (also has icon z16-, area z16-)
|
||||
|
||||
@@ -86,9 +86,9 @@ landuse-cemetery-christian # area z10- (also has icon z
|
||||
=== 180
|
||||
|
||||
amenity-car_wash # area z15- (also has icon z17-, caption(optional) z17-)
|
||||
amenity-charging_station # area z16- (also has icon z16-, caption(optional) z16-)
|
||||
amenity-charging_station-bicycle # area z16- (also has icon z16-, caption(optional) z16-)
|
||||
amenity-charging_station-carless # area z16- (also has icon z16-, caption(optional) z16-)
|
||||
amenity-charging_station-general # area z16- (also has icon z16-, caption(optional) z16-)
|
||||
amenity-charging_station-motorcar # area z15- (also has icon z14-, caption(optional) z14-)
|
||||
amenity-charging_station-motorcycle # area z16- (also has icon z16-, caption(optional) z16-)
|
||||
amenity-charging_station-small # area z15- (also has icon z15-, caption(optional) z16-)
|
||||
|
||||
@@ -435,7 +435,7 @@ amenity-charging_station-motorcycle # icon z16- (also has captio
|
||||
amenity-charging_station-bicycle # icon z16- (also has caption(optional) z16-, area z16-)
|
||||
=== 3751
|
||||
|
||||
amenity-charging_station-general # icon z16- (also has caption(optional) z16-, area z16-)
|
||||
amenity-charging_station # icon z16- (also has caption(optional) z16-, area z16-)
|
||||
=== 3750
|
||||
|
||||
amenity-charging_station-carless # icon z16- (also has caption(optional) z16-, area z16-)
|
||||
@@ -1715,7 +1715,7 @@ leisure-swimming_pool-private # icon z17- (also has captio
|
||||
# amenity-charging_station-bicycle # caption(optional) z16- (also has icon z16-, area z16-)
|
||||
# === -6249
|
||||
|
||||
# amenity-charging_station-general # caption(optional) z16- (also has icon z16-, area z16-)
|
||||
# amenity-charging_station # caption(optional) z16- (also has icon z16-, area z16-)
|
||||
# === -6250
|
||||
|
||||
# amenity-charging_station-carless # caption(optional) z16- (also has icon z16-, area z16-)
|
||||
|
||||
@@ -33,9 +33,9 @@ amenity-parking-street_side-private # area z15- (also has icon z
|
||||
=== 160
|
||||
|
||||
amenity-car_wash # area z17- (also has icon z17-, caption(optional) z17-)
|
||||
amenity-charging_station # area z16- (also has icon z16-, caption(optional) z16-)
|
||||
amenity-charging_station-bicycle # area z16- (also has icon z16-, caption(optional) z16-)
|
||||
amenity-charging_station-carless # area z16- (also has icon z16-, caption(optional) z16-)
|
||||
amenity-charging_station-general # area z16- (also has icon z16-, caption(optional) z16-)
|
||||
amenity-charging_station-motorcar # area z15- (also has icon z14-, caption(optional) z14-)
|
||||
amenity-charging_station-motorcycle # area z16- (also has icon z16-, caption(optional) z16-)
|
||||
amenity-charging_station-small # area z15- (also has icon z15-, caption(optional) z16-)
|
||||
|
||||
@@ -186,7 +186,7 @@ amenity-charging_station-motorcycle # icon z16- (also has captio
|
||||
amenity-charging_station-bicycle # icon z16- (also has caption(optional) z16-, area z16-)
|
||||
=== 3151
|
||||
|
||||
amenity-charging_station-general # icon z16- (also has caption(optional) z16-, area z16-)
|
||||
amenity-charging_station # icon z16- (also has caption(optional) z16-, area z16-)
|
||||
=== 3150
|
||||
|
||||
amenity-charging_station-carless # icon z16- (also has caption(optional) z16-, area z16-)
|
||||
@@ -809,7 +809,7 @@ entrance-emergency # icon z19- (also has captio
|
||||
# amenity-charging_station-bicycle # caption(optional) z16- (also has icon z16-, area z16-)
|
||||
# === -6849
|
||||
|
||||
# amenity-charging_station-general # caption(optional) z16- (also has icon z16-, area z16-)
|
||||
# amenity-charging_station # caption(optional) z16- (also has icon z16-, area z16-)
|
||||
# === -6850
|
||||
|
||||
# amenity-charging_station-carless # caption(optional) z16- (also has icon z16-, area z16-)
|
||||
|
||||
@@ -351,6 +351,11 @@ private:
|
||||
// - both amenity-charging_station-motorcar and amenity-charging_station-bicycle are left;
|
||||
void LeaveLongestTypes(std::vector<generator::TypeStrings> & matchedTypes)
|
||||
{
|
||||
auto const isChargingStation = [](auto const & lhs, auto const & rhs)
|
||||
{
|
||||
return lhs.size() > 1 && rhs.size() > 1 && lhs.at(1) == "charging_station" && rhs.at(1) == "charging_station" && lhs.at(0) == "amenity" && rhs.at(0) == "amenity";
|
||||
};
|
||||
|
||||
auto const equalPrefix = [](auto const & lhs, auto const & rhs)
|
||||
{
|
||||
size_t const prefixSz = std::min(lhs.size(), rhs.size());
|
||||
@@ -369,8 +374,11 @@ void LeaveLongestTypes(std::vector<generator::TypeStrings> & matchedTypes)
|
||||
return lhs < rhs;
|
||||
};
|
||||
|
||||
auto const isEqual = [&equalPrefix](auto const & lhs, auto const & rhs)
|
||||
auto const isEqual = [&equalPrefix, &isChargingStation](auto const & lhs, auto const & rhs)
|
||||
{
|
||||
if (isChargingStation(lhs, rhs))
|
||||
return false;
|
||||
|
||||
if (equalPrefix(lhs, rhs))
|
||||
{
|
||||
// Keep longest type only, so return equal is true.
|
||||
|
||||
@@ -42,7 +42,7 @@
|
||||
"type.amenity.gambling" = "Glücksspiel";
|
||||
"type.leisure.adult_gaming_centre" = "Spielhalle für Erwachsene";
|
||||
"type.leisure.amusement_arcade" = "Spielhalle für Unterhaltungsspiele";
|
||||
"type.amenity.charging_station.general" = "Ladestation";
|
||||
"type.amenity.charging_station" = "Ladestation";
|
||||
"type.amenity.charging_station.motorcar" = "Autos";
|
||||
"type.amenity.charging_station.motorcycle" = "Motorräder";
|
||||
"type.amenity.charging_station.bicycle" = "Fahrräder";
|
||||
|
||||
@@ -47,7 +47,7 @@
|
||||
"type.amenity.gambling" = "Gambling";
|
||||
"type.leisure.adult_gaming_centre" = "Adult Gaming Centre";
|
||||
"type.leisure.amusement_arcade" = "Arcade";
|
||||
"type.amenity.charging_station.general" = "Charging Station";
|
||||
"type.amenity.charging_station" = "Charging Station";
|
||||
"type.amenity.charging_station.motorcar" = "Cars";
|
||||
"type.amenity.charging_station.motorcycle" = "Motorcycles";
|
||||
"type.amenity.charging_station.bicycle" = "Bicycles";
|
||||
|
||||
@@ -54,7 +54,7 @@
|
||||
"type.amenity.studio" = "Media Studio";
|
||||
"type.leisure.adult_gaming_centre" = "Adult Gaming Centre";
|
||||
"type.leisure.amusement_arcade" = "Arcade";
|
||||
"type.amenity.charging_station.general" = "Charging Station";
|
||||
"type.amenity.charging_station" = "Charging Station";
|
||||
"type.amenity.charging_station.motorcar" = "Cars";
|
||||
"type.amenity.charging_station.motorcycle" = "Motorcycles";
|
||||
"type.amenity.charging_station.bicycle" = "Bicycles";
|
||||
|
||||
@@ -196,15 +196,20 @@ void TypesHolder::SortBySpec()
|
||||
|
||||
std::stable_sort(begin(), end(), [&checker, &getPriority, &isChargingStationChecker, &isChargingStationSmallChecker](uint32_t t1, uint32_t t2)
|
||||
{
|
||||
if (isChargingStationSmallChecker(t1) && !isChargingStationSmallChecker(t2))
|
||||
return false;
|
||||
else if (isChargingStationSmallChecker(t1) && !isChargingStationSmallChecker(t2))
|
||||
return true;
|
||||
|
||||
if (isChargingStationChecker(t1) && !isChargingStationChecker(t2))
|
||||
return true;
|
||||
else if (isChargingStationChecker(t2) && !isChargingStationChecker(t1))
|
||||
return false;
|
||||
if (isChargingStationChecker(t1) && isChargingStationChecker(t2))
|
||||
{
|
||||
if (isChargingStationSmallChecker(t1) && !isChargingStationSmallChecker(t2))
|
||||
return false;
|
||||
else if (!isChargingStationSmallChecker(t1) && isChargingStationSmallChecker(t2))
|
||||
return true;
|
||||
|
||||
uint8_t const t1Level = ftype::GetLevel(t1);
|
||||
uint8_t const t2Level = ftype::GetLevel(t2);
|
||||
if (t1Level == 2 && t2Level != 2)
|
||||
return true;
|
||||
else if (t1Level != 2 && t2Level == 2)
|
||||
return false;
|
||||
}
|
||||
|
||||
int const p1 = getPriority(t1);
|
||||
int const p2 = getPriority(t2);
|
||||
@@ -416,7 +421,7 @@ void FeatureParams::SetRwSubwayType(char const * cityName)
|
||||
FeatureParams::TypesResult FeatureParams::FinishAddingTypesEx()
|
||||
{
|
||||
auto const & cl = classif();
|
||||
auto charingStation = cl.GetTypeByPath({"amenity", "charging_station", "general"});
|
||||
auto charingStation = cl.GetTypeByPath({"amenity", "charging_station"});
|
||||
auto motorcarCharingStation = cl.GetTypeByPath({"amenity", "charging_station", "motorcar"});
|
||||
auto carelessCharingStation = cl.GetTypeByPath({"amenity", "charging_station", "carless"});
|
||||
if (IsTypeExist(charingStation) && !IsTypeExist(motorcarCharingStation) && !IsTypeExist(carelessCharingStation))
|
||||
|
||||
@@ -753,10 +753,10 @@ IsDirectionalChecker::IsDirectionalChecker() : ftypes::BaseChecker(1 /* level */
|
||||
m_types.push_back(c.GetTypeByPath({"lateral"}));
|
||||
}
|
||||
|
||||
IsCharingStationChecker::IsCharingStationChecker() : ftypes::BaseChecker(3 /* level */)
|
||||
IsCharingStationChecker::IsCharingStationChecker() : ftypes::BaseChecker(2 /* level */)
|
||||
{
|
||||
Classificator const & c = classif();
|
||||
m_types.push_back(c.GetTypeByPath({"amenity", "charging_station", "general"}));
|
||||
m_types.push_back(c.GetTypeByPath({"amenity", "charging_station"}));
|
||||
}
|
||||
|
||||
IsCharingStationCarChecker::IsCharingStationCarChecker() : ftypes::BaseChecker(3 /* level */)
|
||||
|
||||
@@ -86,7 +86,6 @@ std::map<std::string, BookmarkMatchInfo> const kFeatureTypeToBookmarkMatchInfo =
|
||||
{"amenity-bureau_de_change", {kml::BookmarkIcon::Exchange, BookmarkBaseType::Exchange}},
|
||||
|
||||
{"amenity-charging_station", {kml::BookmarkIcon::ChargingStation, BookmarkBaseType::Gas}},
|
||||
{"amenity-charging_station-general", {kml::BookmarkIcon::ChargingStation, BookmarkBaseType::Gas}},
|
||||
{"amenity-charging_station-bicycle", {kml::BookmarkIcon::ChargingStation, BookmarkBaseType::Gas}},
|
||||
{"amenity-charging_station-motorcycle", {kml::BookmarkIcon::ChargingStation, BookmarkBaseType::Gas}},
|
||||
{"amenity-charging_station-motorcar", {kml::BookmarkIcon::ChargingStation, BookmarkBaseType::Gas}},
|
||||
|
||||
@@ -228,7 +228,6 @@ private:
|
||||
{{"shop", "money_lender"}, SearchMarkType::Bank},
|
||||
{{"amenity", "fuel"}, SearchMarkType::Fuel},
|
||||
{{"amenity", "charging_station"}, SearchMarkType::ChargingStation},
|
||||
{{"amenity", "charging_station", "general"}, SearchMarkType::ChargingStation},
|
||||
{{"amenity", "charging_station", "bicycle"}, SearchMarkType::ChargingStation},
|
||||
{{"amenity", "charging_station", "motorcycle"}, SearchMarkType::ChargingStation},
|
||||
{{"amenity", "charging_station", "motorcar"}, SearchMarkType::ChargingStation},
|
||||
|
||||
Reference in New Issue
Block a user