Skip to content

Commit

Permalink
Merge pull request #3441 from matthijsmelissen/landcover-order
Browse files Browse the repository at this point in the history
Landcover order
  • Loading branch information
sommerluk authored Oct 28, 2018
2 parents 9d16b99 + 1a9d07e commit b3323b4
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions project.mml
Original file line number Diff line number Diff line change
Expand Up @@ -93,14 +93,15 @@ Layer:
('landuse_' || (CASE WHEN landuse IN ('forest', 'military', 'farmland', 'residential', 'commercial', 'retail', 'industrial', 'meadow') THEN landuse ELSE NULL END)) AS landuse,
('natural_' || (CASE WHEN "natural" IN ('wood', 'sand', 'scree', 'shingle', 'bare_rock', 'heath', 'grassland') 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(!pixel_width!::real*!pixel_height!::real,0) AS way_pixels,
way_area
FROM planet_osm_polygon
WHERE (landuse IN ('forest', 'military', 'farmland', 'residential', 'commercial', 'retail', 'industrial', 'meadow')
OR "natural" IN ('wood', 'wetland', 'mud', 'sand', 'scree', 'shingle', 'bare_rock', 'heath', 'grassland'))
AND way_area > 1*!pixel_width!::real*!pixel_height!::real
AND building IS NULL
ORDER BY way_area DESC
) AS features
ORDER BY way_area DESC, feature
) AS landcover_low_zoom
properties:
minzoom: 7
Expand Down Expand Up @@ -137,7 +138,8 @@ 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(!pixel_width!::real*!pixel_height!::real,0) AS way_pixels,
way_area
FROM planet_osm_polygon
WHERE (landuse IS NOT NULL
OR leisure IS NOT NULL
Expand All @@ -153,8 +155,8 @@ Layer:
OR highway IN ('services', 'rest_area')
OR railway = 'station')
AND way_area > 1*!pixel_width!::real*!pixel_height!::real
ORDER BY way_area DESC
) AS landcover
ORDER BY way_area DESC, feature
) AS features
properties:
minzoom: 10
Expand Down

0 comments on commit b3323b4

Please sign in to comment.