From 384cf20b33f173da25e6fe2fe0388a3685ece6ec Mon Sep 17 00:00:00 2001
From: Jeroen Hoek <mail@jeroenhoek.nl>
Date: Thu, 18 May 2023 18:29:07 +0200
Subject: [PATCH] Deprecated tag `parking:orientation`

`parking:orientation` is replaced by `orientation`. This commit
introduces a depracation warning and updates the preset.
---
 resources/data/defaultpresets.xml          |  4 ++--
 resources/data/validator/deprecated.mapcss | 19 +++++++++++++++++++
 resources/data/validator/ignoretags.cfg    |  1 +
 3 files changed, 22 insertions(+), 2 deletions(-)

diff --git a/resources/data/defaultpresets.xml b/resources/data/defaultpresets.xml
index b8bd02683..97bfd33e6 100644
--- a/resources/data/defaultpresets.xml
+++ b/resources/data/defaultpresets.xml
@@ -2773,7 +2773,7 @@
             <reference ref="supervised_lit_oh" />
             <space />
             <label text="Only for street side parking: "/>
-            <combo key="parking:orientation" text="Orientation" values="diagonal,parallel,perpendicular" />
+            <combo key="orientation" text="Orientation" values="diagonal,parallel,perpendicular" />
         </item> <!-- Parking -->
         <item name="Parking Space" icon="presets/vehicle/parking/parking_space.svg" type="node,closedway" preset_name_label="true">
             <link wiki="Tag:amenity=parking_space" />
@@ -2976,7 +2976,7 @@
             <check key="covered" text="Covered (with roof)" />
             <space />
             <label text="Only for street side parking: "/>
-            <combo key="parking:orientation" text="Orientation" values="diagonal,parallel,perpendicular" />
+            <combo key="orientation" text="Orientation" values="diagonal,parallel,perpendicular" />
         </item> <!-- Parking -->
         <item name="Motorcycle Dealer" icon="presets/vehicle/motorbike.svg" type="node,closedway,multipolygon" preset_name_label="true">
             <link wiki="Tag:shop=motorcycle" />
diff --git a/resources/data/validator/deprecated.mapcss b/resources/data/validator/deprecated.mapcss
index 5a195d181..1a5aa2c04 100644
--- a/resources/data/validator/deprecated.mapcss
+++ b/resources/data/validator/deprecated.mapcss
@@ -2464,4 +2464,23 @@ way[shoulder=none] {
   assertNoMatch: "node historic=archaeological_site site_type2=fortification";
 }
 
+/* Tag was renamed, see #22957 */
+area[parking:orientation][!orientation][amenity=parking] {
+  throwWarning: tr("{0} is deprecated", "{0.tag}");
+  group: tr("deprecated tagging");
+  suggestAlternative: "{1.key}={0.value}";
+  fixChangeKey: "{0.key} => {1.key}";
+}
+area[parking:orientation][orientation]["parking:orientation"=*orientation][amenity=parking] {
+  throwWarning: tr("{0} is deprecated", "{0.tag}");
+  group: tr("deprecated tagging");
+  fixRemove: "{0.key}";
+}
+area[parking:orientation][orientation]["parking:orientation"!=*orientation][amenity=parking] {
+  throwWarning: tr("{0} is deprecated", "{0.tag}");
+  group: tr("deprecated tagging");
+  suggestAlternative: "{1.key}={0.value}";
+  suggestAlternative: "{1.key}={1.value}";
+}
+
 /* When tags are deprecated they should be added to ignoretags.cfg too. */
diff --git a/resources/data/validator/ignoretags.cfg b/resources/data/validator/ignoretags.cfg
index df2adfeba..b6cc31bd0 100644
--- a/resources/data/validator/ignoretags.cfg
+++ b/resources/data/validator/ignoretags.cfg
@@ -740,6 +740,7 @@ E:toilet
 K:type=turnlanes:turns
 K:surface=paving_stones:30
 E:site_type
+E:parking:orientation
 ;
 ; Tags not yet decided (to remove from this section when added or moved up when deprecated) 
 ; see josm tickets: 17770 15309 15774 16315 16658 16793 19982 21396
-- 
2.34.1

