]> git.0d.be Git - hdm-toner-cartocss.git/commitdiff
adjust SQL queries to match database schema
authorFrédéric Péters <fpeters@0d.be>
Tue, 7 Dec 2021 07:25:39 +0000 (08:25 +0100)
committerFrédéric Péters <fpeters@0d.be>
Tue, 7 Dec 2021 07:25:39 +0000 (08:25 +0100)
project.yml

index 36e92f071875693bf039fc9dd8b1e33be8210d1b..7b4c3d1c0c3230a67e749363415177f223854fcb 100644 (file)
@@ -364,7 +364,7 @@ Layer:
             ( SELECT
                 way, name, bridge, access, surface, tunnel, tags->'smoothness' AS smoothness, tags->'ford' AS ford, layer, tags->'narrow' AS narrow, construction,
                 CASE
-                  WHEN layer ~ E'^-?\\d{1,4}$' THEN layer::integer
+                  WHEN true THEN layer::integer
                   ELSE 0
                 END AS stratum,
                 CASE
@@ -519,9 +519,9 @@ Layer:
       <<: *postgis
       table: |-
         ( SELECT
-            way, name, COALESCE(amenity, leisure, tags->'healthcare', shop, tourism, office, highway, tags->'emergency', barrier) AS main, man_made, religion,
+            way, name, COALESCE(amenity, leisure, tags->'healthcare', shop, tourism, highway, tags->'emergency', barrier) AS main, man_made, religion,
             CASE WHEN shop IS NOT NULL AND shop!='no' THEN shop ELSE NULL END AS shop,
-            tags->'craft' as craft, tags->'pump' as pump, tags->'drinking_water' as drinking_water, "tower:type", power, tags->'content' AS content, lower(operator) AS operator
+            tags->'craft' as craft, tags->'pump' as pump, tags->'drinking_water' as drinking_water, power, tags->'content' AS content
           FROM
             planet_osm_point
           WHERE
@@ -531,7 +531,7 @@ Layer:
             OR man_made IN ('mast','water_tower', 'tower', 'water_well', 'watermill', 'storage_tank')
             OR historic IN ('memorial','archaeological_site')
             OR leisure IN ('playground','slipway', 'beach_resort')
-            OR office IN ('ngo', 'government') OR tags @> hstore ('emergency', 'fire_hydrant')
+            OR tags @> hstore ('emergency', 'fire_hydrant')
             OR power IN ('generator', 'sub_station', 'tower', 'pole') OR barrier IN ('border_control')
         ) AS data
     advanced:
@@ -544,17 +544,17 @@ Layer:
       <<: *postgis
       table: |-
         ( SELECT
-            way, name, COALESCE(amenity, leisure, tags->'healthcare', shop, tourism, office, highway, tags->'emergency', barrier) AS main, man_made, religion,
+            way, name, COALESCE(amenity, leisure, tags->'healthcare', shop, tourism, highway, tags->'emergency', barrier) AS main, man_made, religion,
             CASE WHEN shop IS NOT NULL AND shop!='no' THEN shop ELSE NULL END AS shop,
-            tags->'craft' as craft, tags->'pump' as pump, tags->'drinking_water' as drinking_water, "tower:type",
-            power, tags->'content' AS content, lower(operator) AS operator
+            tags->'craft' as craft, tags->'pump' as pump, tags->'drinking_water' as drinking_water,
+            power, tags->'content' AS content
           FROM
             planet_osm_polygon
           WHERE
             amenity IS NOT NULL OR shop IS NOT NULL OR tags ? 'healthcare'
             OR tourism IN ('alpine_hut','camp_site','caravan_site','guest_house','hostel','hotel','motel','museum','viewpoint','bed_and_breakfast','information','chalet')
             OR highway IN ('bus_stop','traffic_signals') OR historic in ('memorial','archaeological_site') OR leisure='playground'
-            OR power IN ('plant', 'sub_station') OR office IN ('ngo', 'government')
+            OR power IN ('plant', 'sub_station')
         ) AS data
     advanced:
       extent_from_subquery: 'true'