From 9b818c3767b8b2b38bfd67c0872e604d7f3dd2d7 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stephan=20B=C3=B6sch-Plepelits?= <skunk@xover.mud.at>
Date: Sun, 31 Jul 2022 21:56:41 +0200
Subject: [PATCH] cycle_amenities: include rental=bicycle in query

---
 cycle_amenities.json | 29 +++++++++++------------------
 1 file changed, 11 insertions(+), 18 deletions(-)

diff --git a/cycle_amenities.json b/cycle_amenities.json
index ebca18a..dec975c 100644
--- a/cycle_amenities.json
+++ b/cycle_amenities.json
@@ -10,30 +10,20 @@
     "query": {
         "13": [
             "(",
-            "node[amenity~\"^(bicycle_rental)$\"];",
-            "way[amenity~\"^(bicycle_rental)$\"];",
-            "relation[amenity~\"^(bicycle_rental)$\"];",
+            "nwr[amenity~\"^(bicycle_rental)$\"];",
             "node[amenity~\"^(charging_station)$\"][bicycle][bicycle!=\"no\"];",
-            "node[shop~\"^(bicycle)$\"];",
-            "way[shop~\"^(bicycle)$\"];",
-            "relation[shop~\"^(bicycle)$\"];",
+            "nwr[shop~\"^(bicycle)$\"];",
+            "nwr[rental~\"^(.*;|)bicycle(|;.*)$\"];",
             ")"
         ],
         "16": [
             "(",
-            "node[amenity~\"^(bicycle_.*|compressed_air)$\"];",
-            "way[amenity~\"^(bicycle_.*|compressed_air)$\"];",
-            "relation[amenity~\"^(bicycle_.*|compressed_air)$\"];",
+            "nwr[amenity~\"^(bicycle_.*|compressed_air)$\"];",
             "node[amenity~\"^(charging_station)$\"][bicycle][bicycle!=\"no\"];",
-            "node[shop~\"^(bicycle)$\"];",
-            "way[shop~\"^(bicycle)$\"];",
-            "relation[shop~\"^(bicycle)$\"];",
-            "node[\"monitoring:bicycle\"];",
-            "way[\"monitoring:bicycle\"];",
-            "relation[\"monitoring:bicycle\"];",
-            "node[vending~\"^(bicycle_tube)$\"];",
-            "way[vending~\"^(bicycle_tube)$\"];",
-            "relation[vending~\"^(bicycle_tube)$\"];",
+            "nwr[shop~\"^(bicycle)$\"];",
+            "nwr[\"monitoring:bicycle\"];",
+            "nwr[vending~\"^(bicycle_tube)$\"];",
+            "nwr[rental~\"^(.*;|)bicycle(|;.*)$\"];",
             ")"
         ]
     },
@@ -48,6 +38,9 @@
             "{% elseif tags.vending in [ 'bicycle_tube' ] %}",
             "  {% set key = 'vending' %}",
             "  {% set value = tags.vending %}",
+            "{% elseif 'bicycle' in tags.rental|split(';') %}",
+            "  {% set key = 'amenity' %}",
+            "  {% set value = 'bicycle_rental' %}",
             "{% else %}",
             "  {% set key = 'amenity' %}",
             "  {% set value = tags.amenity %}",