Skip to content

Commit

Permalink
merging jeisenbe/way_pixels
Browse files Browse the repository at this point in the history
  • Loading branch information
imagico committed Feb 2, 2019
2 parents eba988f + 3a0244b commit 962da53
Showing 1 changed file with 18 additions and 18 deletions.
36 changes: 18 additions & 18 deletions project.mml
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ Layer:
'meadow', 'vineyard', 'orchard') THEN landuse ELSE NULL END)) AS landuse,
('natural_' || (CASE WHEN "natural" IN ('wood', 'sand', 'scree', 'shingle', 'bare_rock', 'heath', 'grassland', 'scrub') THEN "natural" ELSE NULL END)) AS "natural",
('wetland_' || (CASE WHEN "natural" IN ('wetland', 'mud') THEN (CASE WHEN "natural" IN ('mud') THEN "natural" ELSE tags->'wetland' END) ELSE NULL END)) AS wetland,
way_area/NULLIF(!pixel_width!::real*!pixel_height!::real,0) AS way_pixels,
way_area/NULLIF(POW(!scale_denominator!*0.001*0.28,2),0) AS way_pixels,
way_area
FROM planet_osm_polygon
WHERE (landuse IN ('forest', 'farmland', 'residential', 'commercial', 'retail', 'industrial', 'meadow', 'vineyard', 'orchard')
Expand Down Expand Up @@ -140,7 +140,7 @@ Layer:
('highway_' || (CASE WHEN highway IN ('services', 'rest_area') THEN highway ELSE NULL END)) AS highway,
('railway_' || (CASE WHEN railway = 'station' THEN railway ELSE NULL END)) AS railway,
CASE WHEN religion IN ('christian', 'jewish', 'muslim') THEN religion ELSE 'INT-generic'::text END AS religion,
way_area/NULLIF(!pixel_width!::real*!pixel_height!::real,0) AS way_pixels,
way_area/NULLIF(POW(!scale_denominator!*0.001*0.28,2),0) AS way_pixels,
CASE WHEN building = 'no' OR building IS NULL THEN 'no' ELSE 'yes' END AS is_building,
way_area
FROM planet_osm_polygon
Expand Down Expand Up @@ -232,7 +232,7 @@ Layer:
waterway,
landuse,
name,
way_area/NULLIF(!pixel_width!::real*!pixel_height!::real,0) AS way_pixels,
way_area/NULLIF(POW(!scale_denominator!*0.001*0.28,2),0) AS way_pixels,
CASE WHEN tags->'intermittent' IN ('yes')
OR tags->'seasonal' IN ('yes', 'spring', 'summer', 'autumn', 'winter', 'wet_season', 'dry_season')
OR tags->'basin' IN ('detention', 'infiltration')
Expand Down Expand Up @@ -423,7 +423,7 @@ Layer:
table: |-
(SELECT
way,
way_area/NULLIF(!pixel_width!::real*!pixel_height!::real,0) AS way_pixels,
way_area/NULLIF(POW(!scale_denominator!*0.001*0.28,2),0) AS way_pixels,
man_made,
name
FROM planet_osm_polygon
Expand Down Expand Up @@ -553,7 +553,7 @@ Layer:
way,
landuse,
military,
way_area/NULLIF(!pixel_width!::real*!pixel_height!::real,0) AS way_pixels
way_area/NULLIF(POW(!scale_denominator!*0.001*0.28,2),0) AS way_pixels
FROM planet_osm_polygon
WHERE landuse = 'military'
OR military = 'danger_area'
Expand All @@ -569,7 +569,7 @@ Layer:
table: |-
(SELECT
way,
way_area/NULLIF(!pixel_width!::real*!pixel_height!::real,0) AS way_pixels,
way_area/NULLIF(POW(!scale_denominator!*0.001*0.28,2),0) AS way_pixels,
name,
tourism
FROM planet_osm_polygon
Expand Down Expand Up @@ -1242,7 +1242,7 @@ Layer:
name,
boundary,
tags->'protect_class' AS protect_class,
way_area/NULLIF(!pixel_width!::real*!pixel_height!::real,0) AS way_pixels
way_area/NULLIF(POW(!scale_denominator!*0.001*0.28,2),0) AS way_pixels
FROM planet_osm_polygon
WHERE (boundary IN ('aboriginal_lands', 'national_park')
OR leisure = 'nature_reserve'
Expand Down Expand Up @@ -1279,7 +1279,7 @@ Layer:
table: |-
(SELECT
way,
way_area/NULLIF(!pixel_width!::real*!pixel_height!::real,0) AS way_pixels,
way_area/NULLIF(POW(!scale_denominator!*0.001*0.28,2),0) AS way_pixels,
name
FROM planet_osm_polygon
WHERE boundary = 'administrative'
Expand Down Expand Up @@ -1321,7 +1321,7 @@ Layer:
table: |-
(SELECT
way,
way_area/NULLIF(!pixel_width!::real*!pixel_height!::real,0) AS way_pixels,
way_area/NULLIF(POW(!scale_denominator!*0.001*0.28,2),0) AS way_pixels,
name,
ref
FROM planet_osm_polygon
Expand Down Expand Up @@ -1548,7 +1548,7 @@ Layer:
'music', 'medical_supply', 'dairy', 'video_games', 'houseware', 'ticket', 'charity', 'second_hand',
'interior_decoration', 'video', 'paint', 'massage', 'trade', 'wholesale') THEN shop
ELSE 'other' END AS shop,
way_area/NULLIF(!pixel_width!::real*!pixel_height!::real,0) AS way_pixels
way_area/NULLIF(POW(!scale_denominator!*0.001*0.28,2),0) AS way_pixels
FROM planet_osm_polygon
-- The upcoming where clause is needed for performance only, as the CASE statements would end up doing the equivalent filtering
WHERE aeroway IN ('helipad', 'aerodrome')
Expand Down Expand Up @@ -1840,7 +1840,7 @@ Layer:
junction,
ref,
name,
way_area/NULLIF(!pixel_width!::real*!pixel_height!::real,0) AS way_pixels
way_area/NULLIF(POW(!scale_denominator!*0.001*0.28,2),0) AS way_pixels
FROM planet_osm_polygon
WHERE junction = 'yes'
ORDER BY way_pixels DESC NULLS LAST
Expand All @@ -1855,7 +1855,7 @@ Layer:
table: |-
(SELECT
way,
way_area/NULLIF(!pixel_width!::real*!pixel_height!::real,0) AS way_pixels,
way_area/NULLIF(POW(!scale_denominator!*0.001*0.28,2),0) AS way_pixels,
man_made,
name
FROM planet_osm_polygon
Expand Down Expand Up @@ -1927,7 +1927,7 @@ Layer:
table: |-
(SELECT
way,
way_area/NULLIF(!pixel_width!::real*!pixel_height!::real,0) AS way_pixels,
way_area/NULLIF(POW(!scale_denominator!*0.001*0.28,2),0) AS way_pixels,
highway,
place,
leisure,
Expand Down Expand Up @@ -2057,7 +2057,7 @@ Layer:
table: |-
(SELECT
way,
way_area/NULLIF(!pixel_width!::real*!pixel_height!::real,0) AS way_pixels,
way_area/NULLIF(POW(!scale_denominator!*0.001*0.28,2),0) AS way_pixels,
COALESCE(
'landuse_' || CASE WHEN landuse IN ('forest', 'military', 'farmland') THEN landuse ELSE NULL END,
'military_' || CASE WHEN military IN ('danger_area') THEN military ELSE NULL END,
Expand Down Expand Up @@ -2098,7 +2098,7 @@ Layer:
table: |-
(SELECT
way,
way_area/NULLIF(!pixel_width!::real*!pixel_height!::real,0) AS way_pixels,
way_area/NULLIF(POW(!scale_denominator!*0.001*0.28,2),0) AS way_pixels,
COALESCE(
'aeroway_' || CASE WHEN aeroway IN ('gate', 'apron', 'helipad', 'aerodrome') THEN aeroway ELSE NULL END,
'tourism_' || CASE WHEN tourism IN ('artwork', 'alpine_hut', 'hotel', 'motel', 'hostel', 'chalet', 'wilderness_hut', 'guest_house', 'apartment', 'camp_site', 'caravan_site',
Expand Down Expand Up @@ -2451,7 +2451,7 @@ Layer:
(SELECT
name,
way,
way_area/NULLIF(!pixel_width!::real*!pixel_height!::real,0) AS way_pixels
way_area/NULLIF(POW(!scale_denominator!*0.001*0.28,2),0) AS way_pixels
FROM planet_osm_polygon
WHERE building IS NOT NULL
AND building NOT IN ('no')
Expand Down Expand Up @@ -2484,7 +2484,7 @@ Layer:
"addr:housenumber" AS addr_housenumber,
"addr:housename" AS addr_housename,
tags->'addr:unit' AS addr_unit,
way_area/NULLIF(!pixel_width!::real*!pixel_height!::real,0) AS way_pixels
way_area/NULLIF(POW(!scale_denominator!*0.001*0.28,2),0) AS way_pixels
FROM planet_osm_polygon
WHERE (("addr:housenumber" IS NOT NULL) OR ("addr:housename" IS NOT NULL) OR ((tags->'addr:unit') IS NOT NULL))
AND building IS NOT NULL
Expand Down Expand Up @@ -2569,7 +2569,7 @@ Layer:
name,
boundary,
tags->'protect_class' AS protect_class,
way_area/NULLIF(!pixel_width!::real*!pixel_height!::real,0) AS way_pixels
way_area/NULLIF(POW(!scale_denominator!*0.001*0.28,2),0) AS way_pixels
FROM planet_osm_polygon
WHERE (boundary IN ('aboriginal_lands', 'national_park')
OR leisure = 'nature_reserve'
Expand Down

0 comments on commit 962da53

Please sign in to comment.