From cce9b4b51468b3c4f6c1a224ce6a78d1f283af63 Mon Sep 17 00:00:00 2001 From: jeisenbe Date: Fri, 5 Apr 2019 21:34:05 +0900 Subject: [PATCH 1/2] Change layering, move ocean and water above landcover Icesheet polygons are moved before water lines, which are now before water-areas, and ocean polygons are after these. Landcover is now first. Also, springs are moved after water-barriers, marinas are moved before the barriers, and necountries is moved to immediatley before admin-low-zoom --- project.mml | 160 ++++++++++++++++++++++++++-------------------------- 1 file changed, 80 insertions(+), 80 deletions(-) diff --git a/project.mml b/project.mml index ab1f7c2497..2d120258be 100644 --- a/project.mml +++ b/project.mml @@ -54,33 +54,6 @@ Stylesheet: - admin.mss - addressing.mss Layer: - - id: ocean-lz - geometry: polygon - class: ocean - <<: *extents - Datasource: - file: data/simplified-water-polygons-split-3857/simplified_water_polygons.shp - type: shape - properties: - maxzoom: 9 - - id: ocean - geometry: polygon - class: ocean - <<: *extents - Datasource: - file: data/water-polygons-split-3857/water_polygons.shp - type: shape - properties: - minzoom: 10 - - id: necountries - geometry: linestring - <<: *extents84 - Datasource: - file: data/ne_110m_admin_0_boundary_lines_land/ne_110m_admin_0_boundary_lines_land.shp - type: shape - properties: - minzoom: 1 - maxzoom: 3 - id: landcover-low-zoom geometry: polygon <<: *extents @@ -176,6 +149,14 @@ Layer: ) AS landcover_line properties: minzoom: 14 + - id: icesheet-poly + geometry: polygon + <<: *extents + Datasource: + file: data/antarctica-icesheet-polygons-3857/icesheet_polygons.shp + type: shape + properties: + minzoom: 5 - id: water-lines-casing geometry: linestring <<: *extents @@ -212,14 +193,29 @@ Layer: properties: minzoom: 8 maxzoom: 11 - - id: icesheet-poly - geometry: polygon + - id: water-lines + class: water-lines + geometry: linestring <<: *extents Datasource: - file: data/antarctica-icesheet-polygons-3857/icesheet_polygons.shp - type: shape + <<: *osm2pgsql + table: |- + (SELECT + way, + waterway, + name, + CASE WHEN tags->'intermittent' IN ('yes') + OR tags->'seasonal' IN ('yes', 'spring', 'summer', 'autumn', 'winter', 'wet_season', 'dry_season') + THEN 'yes' ELSE 'no' END AS int_intermittent, + CASE WHEN tunnel IN ('yes', 'culvert') THEN 'yes' ELSE 'no' END AS int_tunnel, + 'no' AS bridge + FROM planet_osm_line + WHERE waterway IN ('river', 'canal', 'stream', 'drain', 'ditch', 'wadi') + AND (bridge IS NULL OR bridge NOT IN ('yes', 'aqueduct')) + ORDER BY COALESCE(layer,0) + ) AS water_lines properties: - minzoom: 5 + minzoom: 12 - id: water-areas geometry: polygon <<: *extents @@ -248,6 +244,24 @@ Layer: ) AS water_areas properties: minzoom: 0 + - id: ocean-lz + geometry: polygon + class: ocean + <<: *extents + Datasource: + file: data/simplified-water-polygons-split-3857/simplified_water_polygons.shp + type: shape + properties: + maxzoom: 9 + - id: ocean + geometry: polygon + class: ocean + <<: *extents + Datasource: + file: data/water-polygons-split-3857/water_polygons.shp + type: shape + properties: + minzoom: 10 - id: landcover-area-symbols geometry: polygon <<: *extents @@ -284,55 +298,19 @@ Layer: type: shape properties: minzoom: 5 - - id: springs - geometry: point + - id: marinas-area + geometry: polygon <<: *extents Datasource: <<: *osm2pgsql table: |- (SELECT - way, - "natural" - FROM - (SELECT - ST_PointOnSurface(way) AS way, - "natural" - FROM planet_osm_polygon - WHERE way && !bbox! - UNION ALL - SELECT - way, - "natural" - FROM planet_osm_point - WHERE way && !bbox! - ) _ - WHERE "natural" IN ('spring') - ) AS springs + way + FROM planet_osm_polygon + WHERE leisure = 'marina' + ) AS marinas_area properties: minzoom: 14 - - id: water-lines - class: water-lines - geometry: linestring - <<: *extents - Datasource: - <<: *osm2pgsql - table: |- - (SELECT - way, - waterway, - name, - CASE WHEN tags->'intermittent' IN ('yes') - OR tags->'seasonal' IN ('yes', 'spring', 'summer', 'autumn', 'winter', 'wet_season', 'dry_season') - THEN 'yes' ELSE 'no' END AS int_intermittent, - CASE WHEN tunnel IN ('yes', 'culvert') THEN 'yes' ELSE 'no' END AS int_tunnel, - 'no' AS bridge - FROM planet_osm_line - WHERE waterway IN ('river', 'canal', 'stream', 'drain', 'ditch', 'wadi') - AND (bridge IS NULL OR bridge NOT IN ('yes', 'aqueduct')) - ORDER BY COALESCE(layer,0) - ) AS water_lines - properties: - minzoom: 12 - id: water-barriers-line geometry: linestring <<: *extents @@ -363,17 +341,30 @@ Layer: ) AS water_barriers_poly properties: minzoom: 13 - - id: marinas-area - geometry: polygon + - id: springs + geometry: point <<: *extents Datasource: <<: *osm2pgsql table: |- (SELECT - way - FROM planet_osm_polygon - WHERE leisure = 'marina' - ) AS marinas_area + way, + "natural" + FROM + (SELECT + ST_PointOnSurface(way) AS way, + "natural" + FROM planet_osm_polygon + WHERE way && !bbox! + UNION ALL + SELECT + way, + "natural" + FROM planet_osm_point + WHERE way && !bbox! + ) _ + WHERE "natural" IN ('spring') + ) AS springs properties: minzoom: 14 - id: piers-poly @@ -1152,6 +1143,15 @@ Layer: ) AS aeroways properties: minzoom: 11 + - id: necountries + geometry: linestring + <<: *extents84 + Datasource: + file: data/ne_110m_admin_0_boundary_lines_land/ne_110m_admin_0_boundary_lines_land.shp + type: shape + properties: + minzoom: 1 + maxzoom: 3 - id: admin-low-zoom geometry: linestring <<: *extents From 2e3970d59885c24f89381d1788663bbc521d6e17 Mon Sep 17 00:00:00 2001 From: jeisenbe Date: Fri, 5 Apr 2019 22:13:08 +0900 Subject: [PATCH 2/2] Move mud to landcover symbols layer, after water-areas By moving the natural=mud background color to the landcover symbols layer, it will render over water of all types, and will display the same over ocean, rivers or lakes --- landcover.mss | 23 ++++++++++++----------- project.mml | 3 ++- 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/landcover.mss b/landcover.mss index f87140b9a8..f3d4251704 100644 --- a/landcover.mss +++ b/landcover.mss @@ -82,17 +82,6 @@ ::upper-mid-zoom[zoom >= 12][zoom < 13], ::high-zoom[zoom >= 13] { - ::first { - [feature = 'wetland_mud'], - [feature = 'wetland_tidalflat'] { - [zoom >= 5] { - polygon-fill: @mud; - [way_pixels >= 4] { polygon-gamma: 0.75; } - [way_pixels >= 64] { polygon-gamma: 0.3; } - } - } - } - [feature = 'leisure_swimming_pool'][zoom >= 14] { polygon-fill: @water-color; [zoom >= 17] { @@ -718,6 +707,18 @@ } #landcover-area-symbols { + + ::first { + [natural = 'mud'], + [int_wetland = 'tidalflat'] { + [zoom >= 9] { + polygon-fill: @mud; + [way_pixels >= 4] { polygon-gamma: 0.75; } + [way_pixels >= 64] { polygon-gamma: 0.3; } + } + } + } + [natural = 'sand'][zoom >= 5] { polygon-pattern-file: url('symbols/beach.png'); polygon-pattern-alignment: global; diff --git a/project.mml b/project.mml index 2d120258be..983e864b8f 100644 --- a/project.mml +++ b/project.mml @@ -281,7 +281,8 @@ Layer: END END END AS int_wetland, - tags->'leaf_type' AS leaf_type + tags->'leaf_type' AS leaf_type, + way_area/NULLIF(POW(!scale_denominator!*0.001*0.28,2),0) AS way_pixels FROM planet_osm_polygon WHERE ("natural" IN ('marsh', 'mud', 'wetland', 'wood', 'beach', 'shoal', 'reef', 'scrub', 'sand') OR landuse = 'forest') AND building IS NULL