diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000000..ed7d705f2b --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,31 @@ +name: CI +on: + - push + - pull_request +jobs: + syntax: + runs-on: ubuntu-18.04 + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-python@v1 + with: + python-version: 3.7 + - name: Set up Python + run: | + python -m pip install pyyaml colormath + - name: Set up xmllint + run: sudo apt-get install -qq --no-install-recommends libxml2-utils + - name: Set up shell + run: set -o pipefail + - name: Validate YAML files + run: | + find . \( -type f -name '*.yaml' -o -name '*.yml' -o -name '*.mml' \) \ + -exec python -c "from yaml import safe_load; safe_load(file('{}'))" \; + - name: Validate SVGs for valid XML + run: find symbols/ -name '*.svg' | xargs xmllint --noout + - name: Check indexes are up to date + run: diff -qu <(scripts/indexes.py) indexes.sql + - name: Check road colours are up to date + run: diff -qu <(scripts/generate_road_colours.py) style/road-colors-generated.mss + - name: Check for unsupported class usage + run: '! grep "class:" project.mml > /dev/null' diff --git a/.travis.yml b/.travis.yml index 42e986b167..15397f385c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,6 +11,8 @@ addons: packages: - lua5.1 - libxml2-utils + - python3-pip + - python3-setuptools - python-yaml - postgresql-9.5-postgis-2.4 - osm2pgsql @@ -18,7 +20,7 @@ env: - CARTO=1.2.0 MAPNIK='3.0.0 3.0.12' install: - npm install carto@$CARTO - - pip install --user colormath + - pip3 install --user colormath - mkdir -p data/simplified-water-polygons-split-3857 data/ne_110m_admin_0_boundary_lines_land data/water-polygons-split-3857 - touch data/simplified-water-polygons-split-3857/simplified_water_polygons.shp data/ne_110m_admin_0_boundary_lines_land/ne_110m_admin_0_boundary_lines_land.shp data/water-polygons-split-3857/water_polygons.shp - createdb -w -E utf8 -U postgres gis && psql -Xq -d gis -U postgres -w -c "CREATE EXTENSION postgis; CREATE EXTENSION hstore;" diff --git a/CHANGELOG.md b/CHANGELOG.md index 060e6ac509..a11d1cb6aa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,25 @@ -## [Unreleased](https://github.com/gravitystorm/openstreetmap-carto/compare/v4.25.0...master) +## [Unreleased](https://github.com/gravitystorm/openstreetmap-carto/compare/v5.0.0...master) + +### Changes +- Remove way_area filtering for low zoom water (#4060) +- Move small amenities to z18 (#4044) +- Remove duplicate selection of natural = cave_entrance, peak, volcano, saddle (#4068) +- Change quarry outline to 10% darkened quarry color (#4063) + +## [v5.0.0](https://github.com/gravitystorm/openstreetmap-carto/compare/v4.25.0...v5.0.0) - 2020-03-18 + +### Major changes +- Update Lua tag transforms. (#4032) + Linestring and polygon decisions have changed and a database reload is required for this update. + +### Changes +- Added upper way_area limits to most features using ST_PointOnSurface to avoid performance problems from large polygons (#4042) +- Moved MSS files into their own directory (#4047) +- Update index for route=ferry (#3909) +- Removed rendering of power=cable features (#4045) +- Removed overlay pattern for natural=sand (#3855) +- Reduced landcover fading at mid-low zoom levels (#3952) +- Update scripts to use Python3 (#4062, #4029, #4033) ## [v4.25.0](https://github.com/gravitystorm/openstreetmap-carto/compare/v4.24.1...v4.25.0) - 2020-02-01 ### Changes diff --git a/openstreetmap-carto.lua b/openstreetmap-carto.lua index 5d199b0299..8dbca62a64 100644 --- a/openstreetmap-carto.lua +++ b/openstreetmap-carto.lua @@ -70,7 +70,6 @@ local delete_tags = { -- Tags generally dropped by editors, not otherwise covered 'created_by', 'odbl', - 'odbl:note', -- Lots of import tags -- EUROSHA (Various countries) 'project:eurosha_2012', @@ -80,7 +79,6 @@ local delete_tags = { -- NHN (CA) 'accuracy:meters', - 'sub_sea:type', 'waterway:type', -- StatsCan (CA) 'statscan:rbuid', @@ -96,17 +94,14 @@ local delete_tags = { -- GST (DK) 'gst:feat_id', + -- osak (DK) + 'osak:identifier', -- Maa-amet (EE) 'maaamet:ETAK', -- FANTOIR (FR) 'ref:FR:FANTOIR', - -- 3dshapes (NL) - '3dshapes:ggmodelk', - -- AND (NL) - 'AND_nosr_r', - -- OPPDATERIN (NO) 'OPPDATERIN', -- Various imports (PL) @@ -119,6 +114,9 @@ local delete_tags = { -- RABA (SK) 'raba:id', + + -- LINZ (NZ) + 'linz2osm:objectid', -- DCGIS (Washington DC, US) 'dcgis:gis_id', -- Building Identification Number (New York, US) @@ -149,8 +147,6 @@ delete_prefixes = { -- Geobase (CA) 'geobase:', - -- osak (DK) - 'osak:', -- kms (DK) 'kms:', @@ -169,7 +165,6 @@ delete_prefixes = { -- LINZ (NZ) 'LINZ2OSM:', - 'linz2osm:', 'LINZ:', -- WroclawGIS (PL) @@ -215,8 +210,7 @@ local roads_info = { bridleway = {z = 100, roads = false}, cycleway = {z = 100, roads = false}, steps = {z = 90, roads = false}, - platform = {z = 90, roads = false}, - construction = {z = 10, roads = false} + platform = {z = 90, roads = false} }, railway = { rail = {z = 440, roads = true}, @@ -257,6 +251,15 @@ function z_order(tags) z = math.max(z, roads_info[k][v].z) end end + + if tags["highway"] == "construction" then + if tags["construction"] and roads_info["highway"][tags["construction"]] then + z = math.max(z, roads_info["highway"][tags["construction"]].z/10) + else + z = math.max(z, 33) + end + end + return z ~= 0 and z or nil end diff --git a/project.mml b/project.mml index 1fcbfd897e..625e326b61 100644 --- a/project.mml +++ b/project.mml @@ -66,9 +66,9 @@ Layer: FROM (SELECT way, ('landuse_' || (CASE WHEN landuse IN ('forest', 'farmland', 'residential', 'commercial', 'retail', 'industrial', - 'meadow', 'grass', 'village_green', '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, + '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", + ('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 @@ -94,27 +94,27 @@ Layer: COALESCE(aeroway, amenity, wetland, power, landuse, leisure, man_made, "natural", shop, tourism, highway, railway) AS feature FROM (SELECT way, COALESCE(name, '') AS name, - ('aeroway_' || (CASE WHEN aeroway IN ('apron', 'aerodrome') THEN aeroway ELSE NULL END)) AS aeroway, + ('aeroway_' || (CASE WHEN aeroway IN ('apron', 'aerodrome') THEN aeroway END)) AS aeroway, ('amenity_' || (CASE WHEN amenity IN ('bicycle_parking', 'motorcycle_parking', 'university', 'college', 'school', 'taxi', 'hospital', 'kindergarten', 'grave_yard', 'prison', 'place_of_worship', 'clinic', 'ferry_terminal', 'marketplace', 'community_centre', 'social_facility', 'arts_centre', 'parking_space', 'bus_station', 'fire_station', 'police') - OR amenity IN ('parking') AND (tags->'parking' NOT IN ('underground') OR (tags->'parking') IS NULL) THEN amenity ELSE NULL END)) AS amenity, + OR amenity IN ('parking') AND (tags->'parking' NOT IN ('underground') OR (tags->'parking') IS NULL) THEN amenity END)) AS amenity, ('landuse_' || (CASE WHEN landuse IN ('quarry', 'vineyard', 'orchard', 'cemetery', 'residential', 'garages', 'meadow', 'grass', 'allotments', 'forest', 'farmyard', 'farmland', 'greenhouse_horticulture', 'recreation_ground', 'village_green', 'retail', 'industrial', 'railway', 'commercial', - 'brownfield', 'landfill', 'salt_pond', 'construction', 'plant_nursery', 'religious') THEN landuse ELSE NULL END)) AS landuse, - ('shop_' || (CASE WHEN shop IN ('mall') AND (tags->'location' NOT IN ('underground') OR (tags->'location') IS NULL) THEN shop ELSE NULL END)) AS shop, +\ 'brownfield', 'landfill', 'salt_pond', 'construction', 'plant_nursery', 'religious') THEN landuse END)) AS landuse, + ('shop_' || (CASE WHEN shop IN ('mall') AND (tags->'location' NOT IN ('underground') OR (tags->'location') IS NULL) THEN shop END)) AS shop, ('leisure_' || (CASE WHEN leisure IN ('swimming_pool', 'playground', 'park', 'recreation_ground', 'garden', 'golf_course', 'miniature_golf', 'sports_centre', 'stadium', 'pitch', 'ice_rink', - 'track', 'dog_park', 'fitness_station') THEN leisure ELSE NULL END)) AS leisure, - ('man_made_' || (CASE WHEN man_made IN ('works', 'wastewater_plant', 'water_works') THEN man_made ELSE NULL END)) AS man_made, - ('natural_' || (CASE WHEN "natural" IN ('beach', 'shoal', 'heath', 'grassland', 'wood', 'sand', 'scree', 'shingle', 'bare_rock', 'scrub') THEN "natural" ELSE NULL END)) AS "natural", - ('wetland_' || (CASE WHEN "natural" IN ('wetland', 'mud') THEN (CASE WHEN "natural" = 'mud' THEN "natural" ELSE tags->'wetland' END) ELSE NULL END)) AS wetland, - ('power_' || (CASE WHEN power IN ('station', 'sub_station', 'substation', 'generator') THEN power ELSE NULL END)) AS power, - ('tourism_' || (CASE WHEN tourism IN ('camp_site', 'caravan_site', 'picnic_site') THEN tourism ELSE NULL END)) AS tourism, - ('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, + 'track', 'dog_park', 'fitness_station') 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", + ('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 ('station', 'sub_station', '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, 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, @@ -271,14 +271,13 @@ Layer: table: |- (SELECT way, surface, - COALESCE(CASE WHEN landuse = 'forest' THEN 'wood' ELSE NULL END, "natural") AS "natural", + COALESCE(CASE WHEN landuse = 'forest' THEN 'wood' END, "natural") AS "natural", CASE WHEN "natural" = 'mud' THEN "natural" ELSE CASE WHEN ("natural" = 'wetland' AND NOT tags ? 'wetland') THEN 'wetland' ELSE CASE WHEN ("natural" = 'wetland') THEN tags->'wetland' - ELSE NULL END END END AS int_wetland, @@ -477,11 +476,9 @@ Layer: 'mud', 'pebblestone', 'salt', 'sand', 'woodchips', 'clay', 'ice', 'snow') THEN 'unpaved' WHEN surface IN ('paved', 'asphalt', 'cobblestone', 'cobblestone:flattened', 'sett', 'concrete', 'concrete:lanes', 'concrete:plates', 'paving_stones', 'metal', 'wood', 'unhewn_cobblestone') THEN 'paved' - ELSE NULL END AS int_surface, CASE WHEN access IN ('destination') THEN 'destination'::text WHEN access IN ('no', 'private') THEN 'no'::text - ELSE NULL END AS access, construction, CASE @@ -512,7 +509,6 @@ Layer: CASE WHEN access IN ('destination') THEN 'destination'::text WHEN access IN ('no', 'private') THEN 'no'::text - ELSE NULL END AS access, construction, CASE WHEN service IN ('parking_aisle', 'drive-through', 'driveway') THEN 'INT-minor'::text ELSE 'INT-normal'::text END AS service, @@ -580,8 +576,8 @@ Layer: FROM (SELECT way, ('barrier_' || (CASE WHEN barrier IN ('chain', 'city_wall', 'ditch', 'fence', 'guard_rail', - 'handrail', 'hedge', 'retaining_wall', 'wall') THEN barrier ELSE NULL END)) AS barrier, - ('historic_' || (CASE WHEN historic = 'citywalls' THEN historic ELSE NULL END)) AS historic + 'handrail', 'hedge', 'retaining_wall', 'wall') THEN barrier END)) AS barrier, + ('historic_' || (CASE WHEN historic = 'citywalls' THEN historic END)) AS historic FROM (SELECT way, @@ -674,12 +670,12 @@ Layer: (SELECT way, COALESCE(( - 'highway_' || (CASE WHEN highway IN ('residential', 'unclassified', 'pedestrian', 'service', 'footway', 'cycleway', 'track', 'path', 'platform') THEN highway ELSE NULL END)), + 'highway_' || (CASE WHEN highway IN ('residential', 'unclassified', 'pedestrian', 'service', 'footway', 'cycleway', 'track', 'path', 'platform') THEN highway END)), ('railway_' || (CASE WHEN (railway IN ('platform') AND (tags->'location' NOT IN ('underground') OR (tags->'location') IS NULL) AND (tunnel NOT IN ('yes', 'building_passage') OR tunnel IS NULL) AND (covered NOT IN ('yes') OR covered IS NULL)) - THEN railway ELSE NULL END)) + THEN railway END)) ) AS feature FROM planet_osm_polygon WHERE highway IN ('residential', 'unclassified', 'pedestrian', 'service', 'footway', 'track', 'path', 'platform') @@ -726,11 +722,9 @@ Layer: 'mud', 'pebblestone', 'salt', 'sand', 'woodchips', 'clay', 'ice', 'snow') THEN 'unpaved' WHEN surface IN ('paved', 'asphalt', 'cobblestone', 'cobblestone:flattened', 'sett', 'concrete', 'concrete:lanes', 'concrete:plates', 'paving_stones', 'metal', 'wood', 'unhewn_cobblestone') THEN 'paved' - ELSE NULL END AS int_surface, CASE WHEN access IN ('destination') THEN 'destination'::text WHEN access IN ('no', 'private') THEN 'no'::text - ELSE NULL END AS access, construction, CASE @@ -764,7 +758,6 @@ Layer: CASE WHEN access IN ('destination') THEN 'destination'::text WHEN access IN ('no', 'private') THEN 'no'::text - ELSE NULL END AS access, construction, CASE WHEN service IN ('parking_aisle', 'drive-through', 'driveway') OR leisure IN ('slipway') THEN 'INT-minor'::text ELSE 'INT-normal'::text END AS service, @@ -800,13 +793,13 @@ Layer: way, COALESCE( ('highway_' || (CASE WHEN highway IN ('residential', 'unclassified', 'pedestrian', 'service', 'footway', 'cycleway', 'living_street', - 'track', 'path', 'platform', 'services') THEN highway ELSE NULL END)), + 'track', 'path', 'platform', 'services') THEN highway END)), ('railway_' || (CASE WHEN (railway IN ('platform') AND (tags->'location' NOT IN ('underground') OR (tags->'location') IS NULL) AND (tunnel NOT IN ('yes', 'building_passage') OR tunnel IS NULL) AND (covered NOT IN ('yes') OR covered IS NULL)) - THEN railway ELSE NULL END)), - (('aeroway_' || CASE WHEN aeroway IN ('runway', 'taxiway', 'helipad') THEN aeroway ELSE NULL END)) + THEN railway END)), + (('aeroway_' || CASE WHEN aeroway IN ('runway', 'taxiway', 'helipad') THEN aeroway END)) ) AS feature FROM planet_osm_polygon WHERE highway IN ('residential', 'unclassified', 'pedestrian', 'service', 'footway', 'living_street', 'track', 'path', 'platform', 'services') @@ -863,7 +856,7 @@ Layer: ('highway_' || (CASE WHEN highway IN ('motorway_link', 'trunk_link', 'primary_link', 'secondary_link', 'tertiary_link') THEN substr(highway, 0, length(highway)-4) ELSE highway end)), ('railway_' || (CASE WHEN (railway = 'rail' AND service IN ('spur', 'siding', 'yard')) THEN 'INT-spur-siding-yard' - WHEN railway IN ('rail', 'tram', 'light_rail', 'funicular', 'narrow_gauge') THEN railway ELSE NULL END)) + WHEN railway IN ('rail', 'tram', 'light_rail', 'funicular', 'narrow_gauge') THEN railway END)) ) AS feature, CASE WHEN tunnel = 'yes' OR tunnel = 'building_passage' OR covered = 'yes' THEN 'yes' ELSE 'no' END AS int_tunnel, CASE WHEN highway IN ('motorway_link', 'trunk_link', 'primary_link', 'secondary_link', 'tertiary_link') THEN 'yes' ELSE 'no' END AS link, @@ -871,7 +864,6 @@ Layer: 'mud', 'pebblestone', 'salt', 'sand', 'woodchips', 'clay', 'ice', 'snow') THEN 'unpaved' WHEN surface IN ('paved', 'asphalt', 'cobblestone', 'cobblestone:flattened', 'sett', 'concrete', 'concrete:lanes', 'concrete:plates', 'paving_stones', 'metal', 'wood', 'unhewn_cobblestone') THEN 'paved' - ELSE NULL END AS int_surface FROM planet_osm_roads WHERE highway IS NOT NULL @@ -936,11 +928,9 @@ Layer: 'mud', 'pebblestone', 'salt', 'sand', 'woodchips', 'clay', 'ice', 'snow') THEN 'unpaved' WHEN surface IN ('paved', 'asphalt', 'cobblestone', 'cobblestone:flattened', 'sett', 'concrete', 'concrete:lanes', 'concrete:plates', 'paving_stones', 'metal', 'wood', 'unhewn_cobblestone') THEN 'paved' - ELSE NULL END AS int_surface, CASE WHEN access IN ('destination') THEN 'destination'::text WHEN access IN ('no', 'private') THEN 'no'::text - ELSE NULL END AS access, construction, CASE @@ -971,7 +961,6 @@ Layer: CASE WHEN access IN ('destination') THEN 'destination'::text WHEN access IN ('no', 'private') THEN 'no'::text - ELSE NULL END AS access, construction, CASE WHEN service IN ('parking_aisle', 'drive-through', 'driveway') THEN 'INT-minor'::text ELSE 'INT-normal'::text END AS service, @@ -1437,19 +1426,19 @@ Layer: AND ("natural" IN ('peak', 'volcano', 'saddle') OR tourism = 'alpine_hut' OR (tourism = 'information' AND tags->'information' = 'guidepost') OR amenity = 'shelter') - THEN CONCAT(REPLACE(ROUND((tags->'ele')::NUMERIC)::TEXT, '-', U&'\2212'), U&'\00A0', 'm') ELSE NULL END, + THEN CONCAT(REPLACE(ROUND((tags->'ele')::NUMERIC)::TEXT, '-', U&'\2212'), U&'\00A0', 'm') END, CASE WHEN (tags ? 'height') AND tags->'height' ~ '^\d{1,3}(\.\d+)?$' AND waterway = 'waterfall' - THEN CONCAT(ROUND((tags->'height')::NUMERIC)::TEXT, U&'\00A0', 'm') ELSE NULL END + THEN CONCAT(ROUND((tags->'height')::NUMERIC)::TEXT, U&'\00A0', 'm') END ) ) AS name, tags->'parking' as "parking", COALESCE( - 'aeroway_' || CASE WHEN aeroway IN ('gate', 'apron', 'helipad', 'aerodrome') THEN aeroway ELSE NULL END, + 'aeroway_' || CASE WHEN aeroway IN ('gate', 'apron', 'helipad', 'aerodrome') THEN aeroway END, 'tourism_' || CASE WHEN tourism IN ('alpine_hut', 'apartment', 'artwork', 'camp_site', 'caravan_site', 'chalet', 'gallery', 'guest_house', 'hostel', 'hotel', 'motel', 'museum', 'picnic_site', 'theme_park', 'wilderness_hut', - 'zoo') THEN tourism ELSE NULL END, + 'zoo') THEN tourism END, 'amenity_' || CASE WHEN amenity IN ('arts_centre', 'atm', 'bank', 'bar', 'bbq', 'bicycle_rental', 'bicycle_repair_station','biergarten', 'boat_rental', 'bureau_de_change', 'bus_station', 'cafe', 'car_rental', 'car_wash', 'casino', 'charging_station', 'childcare', 'cinema', 'clinic', 'college', @@ -1459,65 +1448,62 @@ Layer: 'nightclub', 'nursing_home', 'pharmacy', 'place_of_worship', 'police', 'post_box', 'post_office', 'prison', 'pub', 'public_bath', 'public_bookcase', 'recycling', 'restaurant', 'school', 'shelter', 'shower', 'social_facility', 'taxi', 'telephone', 'theatre', 'toilets', 'townhall', - 'university', 'vehicle_inspection', 'veterinary') THEN amenity ELSE NULL END, - 'amenity_' || CASE WHEN amenity IN ('waste_disposal') AND way_area IS NOT NULL THEN amenity ELSE NULL END, -- Waste disposal points are rendered in the low priority layer - 'amenity_' || CASE WHEN amenity IN ('vending_machine') AND tags->'vending' IN ('excrement_bags', 'parking_tickets', 'public_transport_tickets') THEN amenity ELSE NULL END, - 'advertising_' || CASE WHEN tags->'advertising' in ('column') THEN tags->'advertising' else NULL END, - 'emergency_' || CASE WHEN tags->'emergency' IN ('phone') AND way_area IS NULL THEN tags->'emergency' ELSE NULL END, + 'university', 'vehicle_inspection', 'veterinary') THEN amenity END, + 'amenity_' || CASE WHEN amenity IN ('waste_disposal') AND way_area IS NOT NULL THEN amenity END, -- Waste disposal points are rendered in the low priority layer + 'amenity_' || CASE WHEN amenity IN ('vending_machine') AND tags->'vending' IN ('excrement_bags', 'parking_tickets', 'public_transport_tickets') THEN amenity END, + 'advertising_' || CASE WHEN tags->'advertising' in ('column') THEN tags->'advertising' END, + 'emergency_' || CASE WHEN tags->'emergency' IN ('phone') AND way_area IS NULL THEN tags->'emergency' END, 'shop' || CASE WHEN shop IN ('yes', 'no', 'vacant', 'closed', 'disused', 'empty') OR shop IS NULL THEN NULL ELSE '' END, 'leisure_' || CASE WHEN leisure IN ('amusement_arcade', 'beach_resort', 'bird_hide', 'bowling_alley', 'dog_park', 'firepit', 'fishing', 'fitness_centre', 'fitness_station', 'garden', 'golf_course', 'ice_rink', 'marina', 'miniature_golf', 'nature_reserve', 'outdoor_seating', 'park', 'picnic_table', 'pitch', 'playground', 'recreation_ground', - 'sauna', 'slipway', 'sports_centre', 'stadium', 'swimming_area', 'swimming_pool', 'track', 'water_park') THEN leisure ELSE NULL END, - 'power_' || CASE WHEN power IN ('plant', 'station', 'generator', 'sub_station', 'substation') THEN power ELSE NULL END, + 'sauna', 'slipway', 'sports_centre', 'stadium', 'swimming_area', 'swimming_pool', 'track', 'water_park') THEN leisure END, + 'power_' || CASE WHEN power IN ('plant', 'station', 'generator', 'sub_station', 'substation') THEN power END, 'man_made_' || CASE WHEN (man_made IN ('chimney', 'communications_tower', 'crane', 'lighthouse', 'mast', 'obelisk', 'silo', 'storage_tank', 'telescope', 'tower', 'wastewater_plant', 'water_tower', 'water_works', 'windmill', 'works') - AND (tags->'location' NOT IN ('roof', 'rooftop') OR NOT (tags ? 'location'))) THEN man_made ELSE NULL END, + AND (tags->'location' NOT IN ('roof', 'rooftop') OR NOT (tags ? 'location'))) THEN man_made END, 'landuse_' || CASE WHEN landuse IN ('reservoir', 'basin', 'recreation_ground', 'village_green', 'quarry', 'vineyard', 'orchard', 'cemetery', 'residential', 'garages', 'meadow', 'grass', 'allotments', 'forest', 'farmyard', 'farmland', 'greenhouse_horticulture', 'retail', 'industrial', 'railway', 'commercial', 'brownfield', 'landfill', - 'construction', 'salt_pond', 'military', 'plant_nursery') THEN landuse ELSE NULL END, - 'natural_' || CASE WHEN "natural" IN ('peak', 'volcano', 'saddle', 'cave_entrance') AND way_area IS NULL THEN "natural" ELSE NULL END, + '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', 'peak', 'volcano', 'saddle', 'cave_entrance', 'water', 'mud', 'wetland', 'bay', 'spring', 'scree', 'shingle', 'bare_rock', 'sand', 'heath', 'grassland', 'scrub', 'beach', 'glacier', 'tree', 'strait', 'cape') - THEN "natural" ELSE NULL END, - 'waterway_' || CASE WHEN "waterway" IN ('waterfall') AND way_area IS NULL THEN waterway ELSE NULL END, - 'place_' || CASE WHEN place IN ('island', 'islet') THEN place ELSE NULL END, + THEN "natural" END, + 'waterway_' || CASE WHEN "waterway" IN ('waterfall') AND way_area IS NULL THEN waterway END, + 'place_' || CASE WHEN place IN ('island', 'islet') THEN place END, 'historic_' || CASE WHEN historic IN ('memorial', 'monument', 'archaeological_site', 'fort', 'castle', 'manor', 'city_gate') - THEN historic ELSE NULL END, - 'military_'|| CASE WHEN military IN ('danger_area', 'bunker') THEN military ELSE NULL END, - 'highway_' || CASE WHEN highway IN ('services', 'rest_area', 'bus_stop', 'elevator', 'traffic_signals') THEN highway ELSE NULL END, - 'highway_'|| CASE WHEN tags @> 'ford=>yes' OR tags @> 'ford=>stepping_stones' AND way_area IS NULL THEN 'ford' ELSE NULL END, + THEN historic END, + 'military_'|| CASE WHEN military IN ('danger_area', 'bunker') THEN military END, + 'highway_' || CASE WHEN highway IN ('services', 'rest_area', 'bus_stop', 'elevator', 'traffic_signals') THEN highway END, + 'highway_'|| CASE WHEN tags @> 'ford=>yes' OR tags @> 'ford=>stepping_stones' AND way_area IS NULL THEN 'ford' END, 'boundary_' || CASE WHEN boundary IN ('aboriginal_lands', 'national_park') OR (boundary = 'protected_area' AND tags->'protect_class' IN ('1','1a','1b','2','3','4','5','6','7','24','97','98','99')) - THEN boundary ELSE NULL END, - 'tourism_' || CASE WHEN tourism IN ('information') THEN tourism ELSE NULL END, + THEN boundary END, + 'tourism_' || CASE WHEN tourism IN ('information') THEN tourism END, 'office' || CASE WHEN tags->'office' IN ('no', 'vacant', 'closed', 'disused', 'empty') OR (tags->'office') IS NULL THEN NULL ELSE '' END, - 'barrier_' || CASE WHEN barrier IN ('toll_booth') AND way_area IS NULL THEN barrier ELSE NULL END, - 'waterway_' || CASE WHEN waterway IN ('dam', 'weir', 'dock') THEN waterway ELSE NULL END, - 'amenity_' || CASE WHEN amenity IN ('bicycle_parking', 'motorcycle_parking') THEN amenity ELSE NULL END, - 'amenity_' || CASE WHEN amenity IN ('parking') AND (tags->'parking' NOT IN ('underground') OR (tags->'parking') IS NULL) THEN amenity ELSE NULL END, + 'barrier_' || CASE WHEN barrier IN ('toll_booth') AND way_area IS NULL THEN barrier END, + 'waterway_' || CASE WHEN waterway IN ('dam', 'weir', 'dock') THEN waterway END, + 'amenity_' || CASE WHEN amenity IN ('bicycle_parking', 'motorcycle_parking') THEN amenity END, + 'amenity_' || CASE WHEN amenity IN ('parking') AND (tags->'parking' NOT IN ('underground') OR (tags->'parking') IS NULL) THEN amenity END, 'amenity_' || CASE WHEN amenity IN ('parking_entrance') AND tags->'parking' IN ('multi-storey', 'underground') AND (access IS NULL OR access NOT IN ('private', 'no')) AND way_area IS NULL - THEN amenity ELSE NULL END, - 'tourism_' || CASE WHEN tourism IN ('viewpoint', 'attraction') THEN tourism ELSE NULL END, - 'place_' || CASE WHEN place IN ('locality') AND way_area IS NULL THEN place ELSE NULL END + THEN amenity END, + 'tourism_' || CASE WHEN tourism IN ('viewpoint', 'attraction') THEN tourism END, + 'place_' || CASE WHEN place IN ('locality') AND way_area IS NULL THEN place END ) AS feature, access, CASE WHEN "natural" IN ('peak', 'volcano', 'saddle') THEN CASE WHEN tags->'ele' ~ '^-?\d{1,4}(\.\d+)?$' THEN (tags->'ele')::NUMERIC - ELSE NULL END WHEN "waterway" IN ('waterfall') THEN CASE WHEN tags->'height' ~ '^\d{1,3}(\.\d+)?( m)?$' THEN (SUBSTRING(tags->'height', '^(\d{1,3}(\.\d+)?)( m)?$'))::NUMERIC - ELSE NULL END - ELSE NULL END AS score, religion, tags->'denomination' as denomination, @@ -1527,9 +1513,7 @@ Layer: OR waterway IN ('waterfall') THEN CASE WHEN tags->'height' ~ '^\d{1,3}(\.\d+)?( m)?$' THEN (SUBSTRING(tags->'height', '^(\d{1,3}(\.\d+)?)( m)?$'))::NUMERIC - ELSE NULL END - ELSE NULL END AS height, tags->'location' as location, tags->'icao' as icao, @@ -1543,9 +1527,7 @@ Layer: WHEN man_made IN ('telescope') THEN CASE WHEN tags->'telescope:diameter' ~ '^-?\d{1,4}(\.\d+)?$' THEN (tags->'telescope:diameter')::NUMERIC - ELSE NULL END - ELSE NULL END AS "telescope:diameter", tags->'castle_type' as castle_type, tags->'sport' as sport, @@ -1646,9 +1628,9 @@ Layer: name, layer, COALESCE( - 'highway_' || CASE WHEN tags @> 'ford=>yes' OR tags @> 'ford=>stepping_stones' THEN 'ford' ELSE NULL END, - 'leisure_' || CASE WHEN leisure IN ('slipway', 'track') THEN leisure ELSE NULL END, - 'attraction_' || CASE WHEN tags @> 'attraction=>water_slide' THEN 'water_slide' ELSE NULL END + 'highway_' || CASE WHEN tags @> 'ford=>yes' OR tags @> 'ford=>stepping_stones' THEN 'ford' END, + 'leisure_' || CASE WHEN leisure IN ('slipway', 'track') THEN leisure END, + 'attraction_' || CASE WHEN tags @> 'attraction=>water_slide' THEN 'water_slide' END ) AS feature FROM planet_osm_line -- The upcoming where clause is needed for performance only, as the CASE statements would end up doing the equivalent filtering @@ -1674,7 +1656,6 @@ Layer: CASE WHEN power = 'tower' THEN 1 WHEN power = 'pole' THEN 2 - ELSE NULL END ) AS power_towers properties: @@ -1716,7 +1697,6 @@ Layer: WHEN highway = 'trunk' THEN 37 WHEN highway = 'primary' THEN 36 WHEN highway = 'secondary' THEN 35 - ELSE NULL END DESC NULLS LAST, height DESC, width DESC, @@ -1751,8 +1731,8 @@ Layer: osm_id, way, COALESCE( - CASE WHEN highway IN ('motorway', 'trunk', 'primary', 'secondary', 'tertiary') THEN highway ELSE NULL END, - CASE WHEN aeroway IN ('runway', 'taxiway') THEN aeroway ELSE NULL END + CASE WHEN highway IN ('motorway', 'trunk', 'primary', 'secondary', 'tertiary') THEN highway END, + CASE WHEN aeroway IN ('runway', 'taxiway') THEN aeroway END ) AS highway, string_to_array(ref, ';') AS refs FROM planet_osm_line @@ -1769,7 +1749,6 @@ Layer: WHEN highway = 'tertiary' THEN 34 WHEN highway = 'runway' THEN 6 WHEN highway = 'taxiway' THEN 5 - ELSE NULL END DESC NULLS LAST, height DESC, width DESC, @@ -1822,31 +1801,9 @@ Layer: CASE WHEN oneway IN ('yes', '-1') THEN oneway WHEN junction IN ('roundabout') AND (oneway IS NULL OR NOT oneway IN ('no', 'reversible')) THEN 'yes' - ELSE NULL END AS oneway, horse, bicycle FROM planet_osm_line l - JOIN (VALUES -- this join is also putting a condition on what is selected. features not matching it do not make it into the results. - ('motorway', 380), - ('trunk', 370), - ('primary', 360), - ('secondary', 350), - ('tertiary', 340), - ('residential', 330), - ('unclassified', 330), - ('road', 330), - ('living_street', 320), - ('pedestrian', 310), - ('raceway', 300), - ('motorway_link', 240), - ('trunk_link', 230), - ('primary_link', 220), - ('secondary_link', 210), - ('tertiary_link', 200), - ('service', 150), - ('construction', 10) - ) AS ordertable (highway, prio) - USING (highway) WHERE highway IN ('motorway', 'motorway_link', 'trunk', 'trunk_link', 'primary', 'primary_link', 'secondary', 'secondary_link', 'tertiary', 'tertiary_link', 'residential', 'unclassified', 'road', 'service', 'pedestrian', 'raceway', 'living_street', 'construction') AND (name IS NOT NULL @@ -1876,7 +1833,6 @@ Layer: CASE WHEN oneway IN ('yes', '-1') THEN oneway WHEN junction IN ('roundabout') AND (oneway IS NULL OR NOT oneway IN ('no', 'reversible')) THEN 'yes' - ELSE NULL END AS oneway, horse, bicycle @@ -1944,7 +1900,7 @@ Layer: SELECT osm_id, way, - CASE WHEN highway IN ('unclassified', 'residential', 'track') THEN highway ELSE NULL END AS highway, + CASE WHEN highway IN ('unclassified', 'residential', 'track') THEN highway END AS highway, string_to_array(ref, ';') AS refs FROM planet_osm_line WHERE highway IN ('unclassified', 'residential', 'track') @@ -1956,7 +1912,6 @@ Layer: WHEN highway = 'unclassified' THEN 33 WHEN highway = 'residential' THEN 32 WHEN highway = 'track' THEN 30 - ELSE NULL END DESC NULLS LAST, height DESC, width DESC, @@ -1975,16 +1930,16 @@ Layer: ST_PointOnSurface(way) AS way, 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, + 'landuse_' || CASE WHEN landuse IN ('forest', 'military', 'farmland') THEN landuse END, + 'military_' || CASE WHEN military IN ('danger_area') THEN military END, 'natural_' || CASE WHEN "natural" IN ('wood', 'glacier', 'sand', 'scree', 'shingle', 'bare_rock', - 'water', 'bay', 'strait') THEN "natural" ELSE NULL END, - 'place_' || CASE WHEN place IN ('island') THEN place ELSE NULL END, + 'water', 'bay', 'strait') THEN "natural" END, + 'place_' || CASE WHEN place IN ('island') THEN place END, 'boundary_' || CASE WHEN (boundary = 'protected_area' AND tags->'protect_class' = '24') THEN 'aboriginal_lands' WHEN boundary IN ('aboriginal_lands', 'national_park') OR (boundary = 'protected_area' AND tags->'protect_class' IN ('1','1a','1b','2','3','4','5','6','7','97','98','99')) - THEN boundary ELSE NULL END, - 'leisure_' || CASE WHEN leisure IN ('nature_reserve') THEN leisure ELSE NULL END + THEN boundary END, + 'leisure_' || CASE WHEN leisure IN ('nature_reserve') THEN leisure END ) AS feature, name, CASE WHEN building = 'no' OR building IS NULL THEN 'no' ELSE 'yes' END AS is_building -- always no with the where conditions @@ -2194,12 +2149,12 @@ Layer: way, name, COALESCE( - 'highway_' || CASE WHEN highway IN ('mini_roundabout') AND way_area IS NULL THEN highway ELSE NULL END, - 'railway_' || CASE WHEN railway IN ('level_crossing', 'crossing') AND way_area IS NULL THEN railway ELSE NULL END, - 'amenity_' || CASE WHEN amenity IN ('bench', 'waste_basket', 'waste_disposal') AND way_area IS NULL THEN amenity ELSE NULL END, - 'historic_' || CASE WHEN historic IN ('wayside_cross', 'wayside_shrine') AND way_area IS NULL THEN historic ELSE NULL END, - 'man_made_' || CASE WHEN man_made IN ('cross') AND way_area IS NULL THEN man_made ELSE NULL END, - 'barrier_' || CASE WHEN barrier IN ('bollard', 'gate', 'lift_gate', 'swing_gate', 'block', 'log', 'cattle_grid', 'stile', 'motorcycle_barrier', 'cycle_barrier', 'full-height_turnstile', 'turnstile', 'kissing_gate') THEN barrier ELSE NULL END + 'highway_' || CASE WHEN highway IN ('mini_roundabout') AND way_area IS NULL THEN highway END, + 'railway_' || CASE WHEN railway IN ('level_crossing', 'crossing') AND way_area IS NULL THEN railway END, + 'amenity_' || CASE WHEN amenity IN ('bench', 'waste_basket', 'waste_disposal') AND way_area IS NULL THEN amenity END, + 'historic_' || CASE WHEN historic IN ('wayside_cross', 'wayside_shrine') AND way_area IS NULL THEN historic END, + 'man_made_' || CASE WHEN man_made IN ('cross') AND way_area IS NULL THEN man_made END, + 'barrier_' || CASE WHEN barrier IN ('bollard', 'gate', 'lift_gate', 'swing_gate', 'block', 'log', 'cattle_grid', 'stile', 'motorcycle_barrier', 'cycle_barrier', 'full-height_turnstile', 'turnstile', 'kissing_gate') THEN barrier END ) AS feature, access, way_area, diff --git a/scripts/generate_road_colours.py b/scripts/generate_road_colours.py index 96971f759d..8ef6eb5466 100755 --- a/scripts/generate_road_colours.py +++ b/scripts/generate_road_colours.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python2 +#!/usr/bin/env python3 # Generates a set of highway colors to be stored in road-colors-generated.mss. @@ -32,7 +32,7 @@ def rgb_error(self): def load_settings(): """Read the settings from YAML.""" - return yaml.load(open('road-colors.yaml', 'r')) + return yaml.safe_load(open('road-colors.yaml', 'r')) def generate_colours(settings, section): """Generate colour ranges. @@ -69,7 +69,7 @@ def generate_colours(settings, section): # the roads get brighter towards the lower end of the classification. classes = settings['classes'][section] - for cls, params in classes.iteritems(): + for cls, params in sorted(classes.items()): l = params['lightness'] c = params['chroma'] line_colour_infos[cls] = ColourInfo(start_l = l[0], end_l = l[1], start_c = c[0], end_c = c[1]) @@ -77,7 +77,7 @@ def generate_colours(settings, section): # Colours for the MSS colours = OrderedDict() - for line_name, line_colour_info in line_colour_infos.iteritems(): + for line_name, line_colour_info in line_colour_infos.items(): c = line_colour_info.start_c delta_c = (line_colour_info.end_c - line_colour_info.start_c) / colour_divisions l = line_colour_info.start_l @@ -102,20 +102,20 @@ def main(): colours = generate_colours(settings, 'mss') # Print a warning about the nature of these definitions. - print "/* This is generated code, do not change this file manually. */" - print "/* */" - print "/* To change these definitions, alter road-colors.yaml and run: */" - print "/* */" - print "/* scripts/generate_road_colours.py > style/road-colors-generated.mss */" - print "/* */" - - for line_name, line_colours in colours.iteritems(): - for name, colour in line_colours.iteritems(): + print("/* This is generated code, do not change this file manually. */") + print("/* */") + print("/* To change these definitions, alter road-colors.yaml and run: */") + print("/* */") + print("/* scripts/generate_road_colours.py > style/road-colors-generated.mss */") + print("/* */") + + for line_name, line_colours in colours.items(): + for name, colour in line_colours.items(): if args.verbose: line = "@{name}-{line_name}: {rgb}; // {lch}, error {delta:.1f}" else: line = "@{name}-{line_name}: {rgb};" - print line.format(name = name, line_name=line_name, rgb = colour.rgb(), lch = colour.lch(), delta = colour.rgb_error()) + print((line.format(name = name, line_name=line_name, rgb = colour.rgb(), lch = colour.lch(), delta = colour.rgb_error()))) if __name__ == "__main__": main() diff --git a/scripts/lua/test.lua b/scripts/lua/test.lua index cfa967bbca..9f7962fc48 100644 --- a/scripts/lua/test.lua +++ b/scripts/lua/test.lua @@ -38,6 +38,14 @@ assert(z_order({highway="trunk"}) > z_order({highway="primary"}) , "test failed: assert(z_order({highway="primary"}) > z_order({highway="secondary"}) , "test failed: primary > secondary") assert(z_order({highway="secondary"}) > z_order({highway="tertiary"}) , "test failed: secondary > tertiary") +assert(z_order({highway="construction"}) == 33 , "test failed: highway=construction") +assert(z_order({highway="construction", construction="motorway"}) == 38 , "test failed: highway=construction construction=motorway") +assert(z_order({highway="construction", construction="motorway", railway="rail"}) == 440, "test failed: construction motorway + rail") +assert(z_order({highway="construction", construction="service"}) == 15 , "test failed: highway=construction construction=service") + +assert(z_order({highway="construction", construction="foo"}) == 33 , "test failed: highway=construction construction=foo") +assert(z_order({highway="motorway", construction="service"}) == 380 , "test failed: highway=construction + construction=service") + print("TESTING: roads") assert(roads({}) == 0, "test failed: no tags") assert(roads({foo="bar"}) == 0, "test failed: other tags") diff --git a/style/amenity-points.mss b/style/amenity-points.mss index 4637aec21e..0620117c06 100644 --- a/style/amenity-points.mss +++ b/style/amenity-points.mss @@ -61,7 +61,7 @@ } } - [feature = 'amenity_atm'][zoom >= 19] { + [feature = 'amenity_atm'][zoom >= 18] { marker-file: url('symbols/amenity/atm.svg'); marker-fill: @amenity-brown; marker-clip: false; @@ -664,7 +664,7 @@ marker-clip: false; } - [feature = 'amenity_post_box'][zoom >= 19] { + [feature = 'amenity_post_box'][zoom >= 18] { marker-file: url('symbols/amenity/post_box.svg'); marker-fill: @amenity-brown; marker-clip: false; @@ -692,7 +692,7 @@ marker-clip: false; } - [feature = 'emergency_phone'][zoom >= 19] { + [feature = 'emergency_phone'][zoom >= 18] { marker-file: url('symbols/amenity/emergency_phone.svg'); marker-fill: @amenity-brown; marker-clip: false; diff --git a/style/landcover.mss b/style/landcover.mss index 9cd22db2c8..1dd582c99d 100644 --- a/style/landcover.mss +++ b/style/landcover.mss @@ -118,7 +118,7 @@ polygon-pattern-file: url('symbols/quarry.svg'); [zoom >= 13] { line-width: 0.5; - line-color: grey; + line-color: darken(@quarry, 10%); } [way_pixels >= 4] { polygon-pattern-gamma: 0.75; } [way_pixels >= 64] { polygon-pattern-gamma: 0.3; } diff --git a/style/road-colors-generated.mss b/style/road-colors-generated.mss index 5d14bfc8fd..488d7075ff 100644 --- a/style/road-colors-generated.mss +++ b/style/road-colors-generated.mss @@ -4,23 +4,23 @@ /* */ /* scripts/generate_road_colours.py > style/road-colors-generated.mss */ /* */ -@motorway-low-zoom-casing: #c24e6b; -@trunk-low-zoom-casing: #cf6649; -@primary-low-zoom-casing: #c38a27; -@secondary-low-zoom-casing: #9eae23; @motorway-casing: #dc2a67; @trunk-casing: #c84e2f; @primary-casing: #a06b00; @secondary-casing: #707d05; -@motorway-shield: #620728; -@trunk-shield: #5d1b0b; -@primary-shield: #4c2e00; -@secondary-shield: #323b00; -@motorway-low-zoom: #e66e89; -@trunk-low-zoom: #f5977a; -@primary-low-zoom: #f3c380; -@secondary-low-zoom: #e8eda0; @motorway-fill: #e892a2; @trunk-fill: #f9b29c; @primary-fill: #fcd6a4; @secondary-fill: #f7fabf; +@motorway-low-zoom: #e66e89; +@trunk-low-zoom: #f6967a; +@primary-low-zoom: #f4c37d; +@secondary-low-zoom: #e7ed9d; +@motorway-low-zoom-casing: #c24e6b; +@trunk-low-zoom-casing: #d1684a; +@primary-low-zoom-casing: #c78d2b; +@secondary-low-zoom-casing: #a4b329; +@motorway-shield: #620728; +@trunk-shield: #5f1c0c; +@primary-shield: #503000; +@secondary-shield: #364000; diff --git a/style/water.mss b/style/water.mss index 8ae9d76e94..84829eda3d 100644 --- a/style/water.mss +++ b/style/water.mss @@ -17,67 +17,20 @@ } } - [waterway = 'dock'] { - [zoom >= 9]::waterway { + [waterway = 'dock'], + [landuse = 'basin'], + [natural = 'water'], + [landuse = 'reservoir'], + [waterway = 'riverbank'] { + [int_intermittent = 'no'] { polygon-fill: @water-color; - [way_pixels >= 4] { - polygon-gamma: 0.75; - } - [way_pixels >= 64] { - polygon-gamma: 0.6; - } - } - } - - [landuse = 'basin']::landuse { - [zoom >= 7][way_pixels >= 32], - [zoom >= 8] { - [int_intermittent = 'no'] { - polygon-fill: @water-color; - [way_pixels >= 4] { - polygon-gamma: 0.75; - } - [way_pixels >= 64] { - polygon-gamma: 0.6; - } - } - [int_intermittent = 'yes'] { - polygon-pattern-file: url('symbols/intermittent_water.png'); - [way_pixels >= 4] { - polygon-pattern-gamma: 0.75; - } - [way_pixels >= 64] { - polygon-pattern-gamma: 0.6; - } - } + [way_pixels >= 4] { polygon-gamma: 0.75; } + [way_pixels >= 64] { polygon-gamma: 0.6; } } - } - - [natural = 'water']::natural, - [landuse = 'reservoir']::landuse, - [waterway = 'riverbank']::waterway { - [zoom >= 0][zoom < 1][way_pixels >= 4], - [zoom >= 1][zoom < 2][way_pixels >= 16], - [zoom >= 2][zoom < 8][way_pixels >= 32], - [zoom >= 8] { - [int_intermittent = 'no'] { - polygon-fill: @water-color; - [way_pixels >= 4] { - polygon-gamma: 0.75; - } - [way_pixels >= 64] { - polygon-gamma: 0.6; - } - } - [int_intermittent = 'yes'] { - polygon-pattern-file: url('symbols/intermittent_water.png'); - [way_pixels >= 4] { - polygon-pattern-gamma: 0.75; - } - [way_pixels >= 64] { - polygon-pattern-gamma: 0.6; - } - } + [int_intermittent = 'yes'] { + polygon-pattern-file: url('symbols/intermittent_water.png'); + [way_pixels >= 4] { polygon-pattern-gamma: 0.75; } + [way_pixels >= 64] { polygon-pattern-gamma: 0.6; } } } }