diff --git a/project.mml b/project.mml index 7fb3d47227..6916517cf8 100644 --- a/project.mml +++ b/project.mml @@ -64,13 +64,13 @@ Layer: way, ('landuse_' || (CASE WHEN landuse IN ('forest', 'farmland', 'residential', 'commercial', 'retail', 'industrial', 'meadow', 'grass', 'village_green', 'vineyard', 'orchard') THEN landuse END)) AS landuse, - ('natural_' || (CASE WHEN "natural" IN ('wood', 'sand', 'scree', 'shingle', 'bare_rock', 'heath', 'grassland', 'scrub') THEN "natural" END)) AS "natural", + ('natural_' || (CASE WHEN "natural" IN ('wood', 'sand', 'scree', 'shingle', 'bare_rock', 'heath', 'grassland', 'scrub', 'shrubbery') THEN "natural" END)) AS "natural", ('wetland_' || (CASE WHEN "natural" IN ('wetland', 'mud') THEN (CASE WHEN "natural" IN ('mud') THEN "natural" ELSE tags->'wetland' END) END)) AS wetland, 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', 'grass', 'village_green', 'vineyard', 'orchard') - OR "natural" IN ('wood', 'wetland', 'mud', 'sand', 'scree', 'shingle', 'bare_rock', 'heath', 'grassland', 'scrub')) + OR "natural" IN ('wood', 'wetland', 'mud', 'sand', 'scree', 'shingle', 'bare_rock', 'heath', 'grassland', 'scrub', 'shrubbery')) AND way_area > 0.01*!pixel_width!::real*!pixel_height!::real AND building IS NULL ) AS features @@ -87,7 +87,7 @@ Layer: <<: *osm2pgsql table: |- (SELECT - way, name, religion, way_pixels, is_building, + way, name, religion, density, way_pixels, is_building, COALESCE(aeroway, golf, amenity, wetland, power, landuse, leisure, man_made, "natural", shop, tourism, highway, railway) AS feature FROM (SELECT way, COALESCE(name, '') AS name, @@ -107,13 +107,16 @@ Layer: 'golf_course', 'miniature_golf', 'sports_centre', 'stadium', 'pitch', 'ice_rink', 'track', 'dog_park', 'fitness_station', 'water_park') THEN leisure END)) AS leisure, ('man_made_' || (CASE WHEN man_made IN ('works', 'wastewater_plant', 'water_works') THEN man_made END)) AS man_made, - ('natural_' || (CASE WHEN "natural" IN ('beach', 'shoal', 'heath', 'grassland', 'wood', 'sand', 'scree', 'shingle', 'bare_rock', 'scrub') THEN "natural" END)) AS "natural", + ('natural_' || (CASE WHEN "natural" IN ('beach', 'shoal', 'heath', 'grassland', 'wood', 'sand', 'scree', 'shingle', 'bare_rock', 'scrub', 'shrubbery') THEN "natural" END)) AS "natural", ('wetland_' || (CASE WHEN "natural" IN ('wetland', 'mud') THEN (CASE WHEN "natural" = 'mud' THEN "natural" ELSE tags->'wetland' END) END)) AS wetland, ('power_' || (CASE WHEN power IN ('plant', 'substation', 'generator') THEN power END)) AS power, ('tourism_' || (CASE WHEN tourism IN ('camp_site', 'caravan_site', 'picnic_site') THEN tourism END)) AS tourism, ('highway_' || (CASE WHEN highway IN ('services', 'rest_area') THEN highway END)) AS highway, ('railway_' || (CASE WHEN railway = 'station' THEN railway END)) AS railway, CASE WHEN religion IN ('christian', 'jewish', 'muslim') THEN religion ELSE 'INT-generic'::text END AS religion, + CASE WHEN "natural" = 'shrubbery' + THEN tags->'shrubbery:density' + END AS density, 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 @@ -126,7 +129,7 @@ Layer: 'grave_yard', 'place_of_worship', 'prison', 'clinic', 'ferry_terminal', 'marketplace', 'community_centre', 'social_facility', 'arts_centre', 'parking_space', 'bus_station', 'fire_station', 'police') OR man_made IN ('works', 'wastewater_plant','water_works') - OR "natural" IN ('beach', 'shoal', 'heath', 'mud', 'wetland', 'grassland', 'wood', 'sand', 'scree', 'shingle', 'bare_rock', 'scrub') + OR "natural" IN ('beach', 'shoal', 'heath', 'mud', 'wetland', 'grassland', 'wood', 'sand', 'scree', 'shingle', 'bare_rock', 'scrub', 'shrubbery') OR power IN ('plant', 'substation', 'generator') OR shop IN ('mall') OR tourism IN ('camp_site', 'caravan_site', 'picnic_site') @@ -298,9 +301,13 @@ Layer: END AS int_wetland, landuse, tags->'leaf_type' AS leaf_type, + -- Could be extended with wood:density or scrub:density: + CASE WHEN "natural" = 'shrubbery' + THEN tags->'shrubbery:density' + END AS density, way_area/NULLIF(POW(!scale_denominator!*0.001*0.28,2),0) AS way_pixels FROM planet_osm_polygon - WHERE ("natural" IN ('mud', 'wetland', 'wood', 'beach', 'shoal', 'reef', 'scrub') OR landuse IN ('forest', 'salt_pond')) + WHERE ("natural" IN ('mud', 'wetland', 'wood', 'beach', 'shoal', 'reef', 'scrub', 'shrubbery') OR landuse IN ('forest', 'salt_pond')) AND building IS NULL AND way_area > 1*!pixel_width!::real*!pixel_height!::real ORDER BY COALESCE(layer,0), way_area DESC @@ -1527,7 +1534,7 @@ Layer: 'construction', 'salt_pond', 'military', 'plant_nursery') THEN landuse END, 'natural_' || CASE WHEN "natural" IN ('peak', 'volcano', 'saddle', 'cave_entrance') AND way_area IS NULL THEN "natural" END, 'natural_' || CASE WHEN "natural" IN ('wood', 'water', 'mud', 'wetland', 'bay', 'spring', 'scree', 'shingle', 'bare_rock', 'sand', 'heath', - 'grassland', 'scrub', 'beach', 'glacier', 'tree', 'strait', 'cape') + 'grassland', 'scrub', 'shrubbery', 'beach', 'glacier', 'tree', 'strait', 'cape') THEN "natural" END, 'waterway_' || CASE WHEN "waterway" IN ('waterfall') AND way_area IS NULL THEN waterway END, 'place_' || CASE WHEN place IN ('island', 'islet', 'square') THEN place END, diff --git a/style/landcover.mss b/style/landcover.mss index 1a7c6f2f85..c993adca4d 100644 --- a/style/landcover.mss +++ b/style/landcover.mss @@ -8,6 +8,8 @@ @allotments: #c9e1bf; // Lch(87,20,135) @orchard: #aedfa3; // also vineyard, plant_nursery @hedge: @forest; // Lch(80,30,135) +@shrubbery: @scrub; +@shrubbery-barrier: @forest; // --- "Base" landuses --- @@ -530,6 +532,15 @@ [way_pixels >= 64] { polygon-gamma: 0.3; } } + [feature = 'natural_shrubbery'][zoom >= 5] { + polygon-fill: @shrubbery; + [density = 'dense'] { + polygon-fill: @shrubbery-barrier; + } + [way_pixels >= 4] { polygon-gamma: 0.75; } + [way_pixels >= 64] { polygon-gamma: 0.3; } + } + [feature = 'wetland_swamp'][zoom >= 5] { polygon-fill: @forest; [way_pixels >= 4] { polygon-gamma: 0.75; } @@ -792,6 +803,20 @@ polygon-pattern-file: url('symbols/scrub.png'); polygon-pattern-alignment: global; } + [natural = 'shrubbery'] { + [density = 'sparse'] { + polygon-pattern-file: url('symbols/shrubbery/sparse.png'); + polygon-pattern-alignment: global; + } + [density = 'medium'] { + polygon-pattern-file: url('symbols/shrubbery/medium.png'); + polygon-pattern-alignment: global; + } + [density = 'dense'] { + polygon-pattern-file: url('symbols/shrubbery/dense.png'); + polygon-pattern-alignment: global; + } + } } //Also landuse = forest, converted in the SQL diff --git a/symbols/shrubbery/dense.png b/symbols/shrubbery/dense.png new file mode 100644 index 0000000000..f46c660171 Binary files /dev/null and b/symbols/shrubbery/dense.png differ diff --git a/symbols/shrubbery/medium.png b/symbols/shrubbery/medium.png new file mode 100644 index 0000000000..e291dbd691 Binary files /dev/null and b/symbols/shrubbery/medium.png differ diff --git a/symbols/shrubbery/sparse.png b/symbols/shrubbery/sparse.png new file mode 100644 index 0000000000..c4db9c1171 Binary files /dev/null and b/symbols/shrubbery/sparse.png differ