From 0532e0635e932bcfb5be5e2b22c27704d89102d2 Mon Sep 17 00:00:00 2001 From: math1985 Date: Sat, 27 Sep 2014 16:07:49 +0100 Subject: [PATCH] Refactor water-features Dam, weir, lock: * Add rendering for dam areas (supercedes and closes #227, based on code by @chrisfleming), dam and weir nodes, and lock_gate line * Render weir in right layer (resolves #403) * Change rendering of weir so it renders with small dashes * Use marker instead of image for lock_gate node * Add labels for dam nodes, dam areas, and weir * Improve labels for dam lines and lock lines * Don't render label for lock=yes * Remove labels for undocumented and less common waterway=lock Groyne, breakwater: * Render groyne/breakwater area the same color as groyne/breakwater way (resolves #893) * Add label for groyne, breakwater, and pier (resolves #474) Other: * In general rewrite and clean up code --- amenity-points.mss | 24 +------ project.mml | 87 ++++++++++++++++++----- project.yaml | 94 ++++++++++++++++--------- water-features.mss | 172 ++++++++++++++++++++++++++++++++++----------- water.mss | 131 ++++++++++++++++------------------ 5 files changed, 321 insertions(+), 187 deletions(-) diff --git a/amenity-points.mss b/amenity-points.mss index b0b3553e3f..2aa272f9d6 100644 --- a/amenity-points.mss +++ b/amenity-points.mss @@ -19,6 +19,7 @@ @standard-wrap-width: 30; +/* Note that .points is also used in water-features.mss */ .points { [feature = 'tourism_alpine_hut'][zoom >= 13] { point-file: url('symbols/alpinehut.p.16.png'); @@ -209,17 +210,6 @@ marker-clip: false; } - [feature = 'waterway_lock'], - [feature = 'lock_yes'] { - [zoom >= 15] { - marker-fill: #969494; - marker-width: 9; - marker-line-width: 0; - marker-placement: interior; - marker-clip: false; - } - } - [feature = 'man_made_mast'][zoom >= 17] { marker-file: url('symbols/communications.16.svg'); marker-fill: #555; @@ -1506,18 +1496,6 @@ } } - [feature = 'waterway_lock'][zoom >= 15] { - text-name: "[name]"; - text-size: 9; - text-dy: 10; - text-fill: #0066ff; - text-face-name: @book-fonts; - text-halo-radius: 1; - text-halo-fill: rgba(255,255,255,0.6); - text-wrap-width: @standard-wrap-width; - text-placement: interior; - } - [feature = 'leisure_marina'][zoom >= 15] { text-name: "[name]"; text-size: 8; diff --git a/project.mml b/project.mml index 27aef7e933..2b434b04b0 100644 --- a/project.mml +++ b/project.mml @@ -283,7 +283,7 @@ "srs": "+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0.0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs +over", "Datasource": { "extent": "-20037508,-20037508,20037508,20037508", - "table": "(SELECT \n way, waterway, lock, name, intermittent,\n CASE WHEN tunnel IN ('yes', 'culvert') THEN 'yes' ELSE 'no' END AS int_tunnel,\n 'no' AS bridge\n FROM planet_osm_line\n WHERE waterway IN ('weir', 'river', 'canal', 'derelict_canal', 'stream', 'drain', 'ditch', 'wadi')\n AND (bridge IS NULL OR bridge NOT IN ('yes', 'aqueduct'))\n ORDER BY z_order\n) AS water_lines", + "table": "(SELECT \n way, waterway, name, intermittent,\n CASE WHEN tunnel IN ('yes', 'culvert') THEN 'yes' ELSE 'no' END AS int_tunnel,\n 'no' AS bridge\n FROM planet_osm_line\n WHERE waterway IN ('river', 'canal', 'derelict_canal', 'stream', 'drain', 'ditch', 'wadi')\n AND (bridge IS NULL OR bridge NOT IN ('yes', 'aqueduct'))\n ORDER BY z_order\n) AS water_lines", "geometry_field": "way", "type": "postgis", "key_field": "", @@ -301,15 +301,41 @@ "advanced": {} }, { - "name": "dam", + "name": "water-barriers-line", "srs-name": "900913", "geometry": "linestring", "class": "", - "id": "dam", + "id": "water-barriers-line", "srs": "+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0.0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs +over", "Datasource": { "extent": "-20037508,-20037508,20037508,20037508", - "table": "(SELECT way, name\n FROM planet_osm_line\n WHERE waterway = 'dam'\n) AS dam", + "table": "(SELECT way, waterway, name \n FROM planet_osm_line \n WHERE waterway IN ('dam', 'weir', 'lock_gate')\n) AS water_barriers_line", + "geometry_field": "way", + "type": "postgis", + "key_field": "", + "dbname": "gis" + }, + "extent": [ + -180, + -85.05112877980659, + 180, + 85.05112877980659 + ], + "properties": { + "minzoom": 13 + }, + "advanced": {} + }, + { + "name": "water-barriers-poly", + "srs-name": "900913", + "geometry": "polygon", + "class": "", + "id": "water-barriers-poly", + "srs": "+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0.0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs +over", + "Datasource": { + "extent": "-20037508,-20037508,20037508,20037508", + "table": "(SELECT way, waterway, name \n FROM planet_osm_polygon \n WHERE waterway IN ('dam', 'weir', 'lock_gate')\n) AS water_barriers_poly", "geometry_field": "way", "type": "postgis", "key_field": "", @@ -353,15 +379,15 @@ "advanced": {} }, { - "name": "piers-area", + "name": "piers-poly", "srs-name": "900913", "geometry": "polygon", "class": "", - "id": "piers-area", + "id": "piers-poly", "srs": "+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0.0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs +over", "Datasource": { "extent": "-20037508,-20037508,20037508,20037508", - "table": "(SELECT\n way, man_made\n FROM planet_osm_polygon\n WHERE man_made IN ('pier', 'breakwater', 'groyne')\n) AS piers_area", + "table": "(SELECT\n way, man_made\n FROM planet_osm_polygon\n WHERE man_made IN ('pier', 'breakwater', 'groyne')\n) AS piers_poly", "geometry_field": "way", "type": "postgis", "key_field": "", @@ -379,15 +405,15 @@ "advanced": {} }, { - "name": "piers", + "name": "piers-line", "srs-name": "900913", "geometry": "linestring", "class": "", - "id": "piers", + "id": "piers-line", "srs": "+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0.0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs +over", "Datasource": { "extent": "-20037508,-20037508,20037508,20037508", - "table": "(SELECT\n way, man_made\n FROM planet_osm_line\n WHERE man_made IN ('pier', 'breakwater', 'groyne')\n) AS piers", + "table": "(SELECT\n way, man_made\n FROM planet_osm_line\n WHERE man_made IN ('pier', 'breakwater', 'groyne')\n) AS piers_line", "geometry_field": "way", "type": "postgis", "key_field": "", @@ -405,15 +431,15 @@ "advanced": {} }, { - "name": "locks", + "name": "water-barriers-point", "srs-name": "900913", "geometry": "point", "class": "", - "id": "locks", + "id": "water-barriers-point", "srs": "+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0.0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs +over", "Datasource": { "extent": "-20037508,-20037508,20037508,20037508", - "table": "(SELECT\n way, waterway\n FROM planet_osm_point\n WHERE waterway = 'lock_gate'\n) AS locks", + "table": "(SELECT \n way, waterway \n FROM planet_osm_point \n WHERE waterway IN ('dam', 'weir', 'lock_gate')\n) AS water_barriers_points", "geometry_field": "way", "type": "postgis", "key_field": "", @@ -1428,7 +1454,7 @@ "srs": "+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0.0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs +over", "Datasource": { "extent": "-20037508,-20037508,20037508,20037508", - "table": "(SELECT\n way,\n COALESCE(\n 'aeroway_' || CASE WHEN aeroway IN ('helipad', 'aerodrome') THEN aeroway ELSE NULL END,\n 'tourism_' || CASE WHEN tourism IN ('alpine_hut', 'camp_site', 'caravan_site', 'chalet', 'guest_house', 'hostel', 'hotel', 'motel', 'information', 'museum', 'viewpoint', 'picnic_site') THEN tourism ELSE NULL END,\n 'amenity_' || CASE WHEN amenity IN ('shelter', 'atm', 'bank', 'bar', 'bicycle_rental', 'bus_station', 'cafe', 'car_rental', 'car_sharing', 'cinema', 'fire_station', 'fuel', 'hospital', 'embassy', 'library', 'courthouse', 'townhall', 'parking', 'pharmacy', 'doctors', 'dentist', 'place_of_worship', 'police', 'post_box', 'post_office', 'pub', 'biergarten', 'recycling', 'restaurant', 'food_court', 'fast_food', 'telephone', 'emergency_phone', 'theatre', 'toilets', 'drinking_water', 'prison') THEN amenity ELSE NULL END,\n 'shop_' || CASE WHEN shop IN ('supermarket', 'bakery', 'butcher', 'clothes', 'fashion', 'convenience', 'department_store', 'doityourself', 'florist', 'hairdresser', 'car', 'car_repair', 'bicycle', 'mall') THEN shop WHEN shop IN ('accessories', 'alcohol', 'antique', 'antiques', 'appliance', 'art', 'baby_goods', 'bag', 'bags', 'bakery', 'bathroom_furnishing', 'beauty', 'bed', 'betting', 'beverages', 'bicycle', 'boat', 'bookmaker', 'books', 'boutique', 'builder', 'building_materials', 'butcher', 'camera', 'car', 'car_parts', 'car_repair', 'car_service', 'carpet', 'charity', 'cheese', 'chemist', 'chocolate', 'clothes', 'coffee', 'communication', 'computer', 'confectionery', 'convenience', 'copyshop', 'cosmetics', 'craft', 'curtain', 'dairy', 'deli', 'delicatessen', 'department_store', 'discount', 'dive', 'doityourself', 'dry_cleaning', 'e-cigarette', 'electrical', 'electronics', 'energy', 'erotic', 'estate_agent', 'fabric', 'farm', 'fashion', 'fish', 'fishing', 'fishmonger', 'flooring', 'florist', 'food', 'frame', 'frozen_food', 'funeral_directors', 'furnace', 'furniture', 'gallery', 'gambling', 'games', 'garden_centre', 'gas', 'general', 'gift', 'glaziery', 'greengrocer', 'grocery', 'hairdresser', 'hardware', 'health', 'health_food', 'hearing_aids', 'herbalist', 'hifi', 'hobby', 'household', 'houseware', 'hunting', 'ice_cream', 'insurance', 'interior_decoration', 'jewellery', 'jewelry', 'kiosk', 'kitchen', 'laundry', 'leather', 'lighting', 'locksmith', 'lottery', 'mall', 'market', 'massage', 'medical', 'medical_supply', 'mobile_phone', 'money_lender', 'motorcycle', 'motorcycle_repair', 'music', 'musical_instrument', 'newsagent', 'office_supplies', 'optician', 'organic', 'outdoor', 'paint', 'pastry', 'pawnbroker', 'perfumery', 'pet', 'pets', 'pharmacy', 'phone', 'photo', 'photo_studio', 'photography', 'pottery', 'printing', 'radiotechnics', 'real_estate', 'religion', 'rental', 'salon', 'scuba_diving', 'seafood', 'second_hand', 'sewing', 'shoe_repair', 'shoes', 'shopping_centre', 'solarium', 'souvenir', 'sports', 'stationery', 'supermarket', 'tailor', 'tanning', 'tattoo', 'tea', 'ticket', 'tiles', 'tobacco', 'toys', 'trade', 'travel_agency', 'tyres', 'vacuum_cleaner', 'variety_store', 'video', 'video_games', 'watches', 'wholesale', 'wine', 'winery', 'yes') THEN 'other' ELSE NULL END,\n 'leisure_' || CASE WHEN leisure IN ('water_park', 'playground', 'miniature_golf', 'golf_course', 'picnic_table', 'slipway') THEN leisure ELSE NULL END,\n 'man_made_' || CASE WHEN man_made IN ('mast', 'water_tower', 'lighthouse', 'windmill') THEN man_made ELSE NULL END,\n 'natural_' || CASE WHEN \"natural\" IN ('peak', 'volcano', 'saddle', 'spring') THEN \"natural\" ELSE NULL END,\n 'waterway_' || CASE WHEN waterway IN ('lock') THEN waterway ELSE NULL END,\n 'historic_' || CASE WHEN historic IN ('memorial', 'archaeological_site') THEN historic ELSE NULL END,\n 'lock_' || CASE WHEN lock IN ('yes') THEN lock ELSE NULL END,\n 'highway_'|| CASE WHEN highway IN ('bus_stop', 'traffic_signals', 'ford') THEN highway ELSE NULL END,\n 'power_' || CASE WHEN power IN ('generator') THEN power ELSE NULL END\n ) AS feature,\n access,\n religion,\n denomination,\n \"generator:source\",\n power_source\n FROM planet_osm_point\n -- The upcoming where clause is needed for performance only, as the CASE statements would end up doing the equivalent filtering\n WHERE aeroway IN ('helipad', 'aerodrome')\n OR tourism IN ('alpine_hut', 'camp_site', 'caravan_site', 'chalet', 'guest_house', 'hostel', 'hotel', 'motel', 'information', 'museum', 'viewpoint', 'picnic_site')\n OR amenity IN ('shelter', 'atm', 'bank', 'bar', 'bicycle_rental', 'bus_station', 'cafe', 'car_rental', 'car_sharing', 'cinema', 'fire_station', 'fuel', 'hospital', 'embassy', 'library', 'courthouse', 'townhall', 'parking', 'pharmacy', 'doctors', 'dentist', 'place_of_worship', 'police', 'post_box', 'post_office', 'pub', 'biergarten', 'recycling', 'restaurant', 'food_court', 'fast_food', 'telephone', 'emergency_phone', 'theatre', 'toilets', 'drinking_water', 'prison')\n OR shop IS NOT NULL -- skip checking a huge list and use a null check\n OR leisure IN ('water_park', 'playground', 'miniature_golf', 'golf_course', 'picnic_table', 'slipway')\n OR man_made IN ('mast', 'water_tower', 'lighthouse', 'windmill')\n OR \"natural\" IN ('peak', 'volcano', 'saddle', 'spring', 'cave_entrance')\n OR waterway = 'lock'\n OR historic IN ('memorial', 'archaeological_site')\n OR lock = 'yes'\n OR highway IN ('bus_stop', 'traffic_signals', 'ford')\n OR (power = 'generator' AND (\"generator:source\" = 'wind' OR power_source = 'wind'))\n ) AS amenity_points", + "table": "(SELECT\n way,\n COALESCE(\n 'aeroway_' || CASE WHEN aeroway IN ('helipad', 'aerodrome') THEN aeroway ELSE NULL END,\n 'tourism_' || CASE WHEN tourism IN ('alpine_hut', 'camp_site', 'caravan_site', 'chalet', 'guest_house', 'hostel', 'hotel', 'motel', 'information', 'museum', 'viewpoint', 'picnic_site') THEN tourism ELSE NULL END,\n 'amenity_' || CASE WHEN amenity IN ('shelter', 'atm', 'bank', 'bar', 'bicycle_rental', 'bus_station', 'cafe', 'car_rental', 'car_sharing', 'cinema', 'fire_station', 'fuel', 'hospital', 'embassy', 'library', 'courthouse', 'townhall', 'parking', 'pharmacy', 'doctors', 'dentist', 'place_of_worship', 'police', 'post_box', 'post_office', 'pub', 'biergarten', 'recycling', 'restaurant', 'food_court', 'fast_food', 'telephone', 'emergency_phone', 'theatre', 'toilets', 'drinking_water', 'prison') THEN amenity ELSE NULL END,\n 'shop_' || CASE WHEN shop IN ('supermarket', 'bakery', 'butcher', 'clothes', 'fashion', 'convenience', 'department_store', 'doityourself', 'florist', 'hairdresser', 'car', 'car_repair', 'bicycle', 'mall') THEN shop WHEN shop IN ('accessories', 'alcohol', 'antique', 'antiques', 'appliance', 'art', 'baby_goods', 'bag', 'bags', 'bakery', 'bathroom_furnishing', 'beauty', 'bed', 'betting', 'beverages', 'bicycle', 'boat', 'bookmaker', 'books', 'boutique', 'builder', 'building_materials', 'butcher', 'camera', 'car', 'car_parts', 'car_repair', 'car_service', 'carpet', 'charity', 'cheese', 'chemist', 'chocolate', 'clothes', 'coffee', 'communication', 'computer', 'confectionery', 'convenience', 'copyshop', 'cosmetics', 'craft', 'curtain', 'dairy', 'deli', 'delicatessen', 'department_store', 'discount', 'dive', 'doityourself', 'dry_cleaning', 'e-cigarette', 'electrical', 'electronics', 'energy', 'erotic', 'estate_agent', 'fabric', 'farm', 'fashion', 'fish', 'fishing', 'fishmonger', 'flooring', 'florist', 'food', 'frame', 'frozen_food', 'funeral_directors', 'furnace', 'furniture', 'gallery', 'gambling', 'games', 'garden_centre', 'gas', 'general', 'gift', 'glaziery', 'greengrocer', 'grocery', 'hairdresser', 'hardware', 'health', 'health_food', 'hearing_aids', 'herbalist', 'hifi', 'hobby', 'household', 'houseware', 'hunting', 'ice_cream', 'insurance', 'interior_decoration', 'jewellery', 'jewelry', 'kiosk', 'kitchen', 'laundry', 'leather', 'lighting', 'locksmith', 'lottery', 'mall', 'market', 'massage', 'medical', 'medical_supply', 'mobile_phone', 'money_lender', 'motorcycle', 'motorcycle_repair', 'music', 'musical_instrument', 'newsagent', 'office_supplies', 'optician', 'organic', 'outdoor', 'paint', 'pastry', 'pawnbroker', 'perfumery', 'pet', 'pets', 'pharmacy', 'phone', 'photo', 'photo_studio', 'photography', 'pottery', 'printing', 'radiotechnics', 'real_estate', 'religion', 'rental', 'salon', 'scuba_diving', 'seafood', 'second_hand', 'sewing', 'shoe_repair', 'shoes', 'shopping_centre', 'solarium', 'souvenir', 'sports', 'stationery', 'supermarket', 'tailor', 'tanning', 'tattoo', 'tea', 'ticket', 'tiles', 'tobacco', 'toys', 'trade', 'travel_agency', 'tyres', 'vacuum_cleaner', 'variety_store', 'video', 'video_games', 'watches', 'wholesale', 'wine', 'winery', 'yes') THEN 'other' ELSE NULL END,\n 'leisure_' || CASE WHEN leisure IN ('water_park', 'playground', 'miniature_golf', 'golf_course', 'picnic_table', 'slipway') THEN leisure ELSE NULL END,\n 'man_made_' || CASE WHEN man_made IN ('mast', 'water_tower', 'lighthouse', 'windmill') THEN man_made ELSE NULL END,\n 'natural_' || CASE WHEN \"natural\" IN ('peak', 'volcano', 'saddle', 'spring') THEN \"natural\" ELSE NULL END,\n 'historic_' || CASE WHEN historic IN ('memorial', 'archaeological_site') THEN historic ELSE NULL END,\n 'highway_'|| CASE WHEN highway IN ('bus_stop', 'traffic_signals', 'ford') THEN highway ELSE NULL END,\n 'power_' || CASE WHEN power IN ('generator') THEN power ELSE NULL END\n ) AS feature,\n access,\n religion,\n denomination,\n \"generator:source\",\n power_source\n FROM planet_osm_point\n -- The upcoming where clause is needed for performance only, as the CASE statements would end up doing the equivalent filtering\n WHERE aeroway IN ('helipad', 'aerodrome')\n OR tourism IN ('alpine_hut', 'camp_site', 'caravan_site', 'chalet', 'guest_house', 'hostel', 'hotel', 'motel', 'information', 'museum', 'viewpoint', 'picnic_site')\n OR amenity IN ('shelter', 'atm', 'bank', 'bar', 'bicycle_rental', 'bus_station', 'cafe', 'car_rental', 'car_sharing', 'cinema', 'fire_station', 'fuel', 'hospital', 'embassy', 'library', 'courthouse', 'townhall', 'parking', 'pharmacy', 'doctors', 'dentist', 'place_of_worship', 'police', 'post_box', 'post_office', 'pub', 'biergarten', 'recycling', 'restaurant', 'food_court', 'fast_food', 'telephone', 'emergency_phone', 'theatre', 'toilets', 'drinking_water', 'prison')\n OR shop IS NOT NULL -- skip checking a huge list and use a null check\n OR leisure IN ('water_park', 'playground', 'miniature_golf', 'golf_course', 'picnic_table', 'slipway')\n OR man_made IN ('mast', 'water_tower', 'lighthouse', 'windmill')\n OR \"natural\" IN ('peak', 'volcano', 'saddle', 'spring', 'cave_entrance')\n OR historic IN ('memorial', 'archaeological_site')\n OR highway IN ('bus_stop', 'traffic_signals', 'ford')\n OR (power = 'generator' AND (\"generator:source\" = 'wind' OR power_source = 'wind'))\n ) AS amenity_points", "geometry_field": "way", "type": "postgis", "key_field": "", @@ -1690,7 +1716,7 @@ "srs": "+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0.0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs +over", "Datasource": { "extent": "-20037508,-20037508,20037508,20037508", - "table": "(SELECT\n way,\n way_area/NULLIF(!pixel_width!::real*!pixel_height!::real,0) AS way_pixels,\n COALESCE(\n 'aeroway_' || CASE WHEN aeroway IN ('gate', 'apron', 'helipad', 'aerodrome') THEN aeroway ELSE NULL END,\n 'tourism_' || CASE WHEN tourism IN ('alpine_hut', 'hotel', 'motel', 'hostel', 'chalet', 'guest_house', 'camp_site', 'caravan_site', 'theme_park', 'museum', 'attraction', 'zoo', 'information', 'picnic_site') THEN tourism ELSE NULL END,\n 'amenity_' || CASE WHEN amenity IN ('pub', 'restaurant', 'food_court', 'cafe', 'fast_food', 'biergarten', 'bar', 'library', 'theatre', 'courthouse', 'townhall', 'cinema', 'parking', 'police', 'fire_station', 'place_of_worship', 'grave_yard', 'shelter', 'bank', 'embassy', 'fuel', 'bus_station', 'prison', 'university', 'school', 'college', 'kindergarten', 'hospital', 'pharmacy', 'doctors', 'dentist', 'atm', 'bicycle_rental', 'car_rental', 'car_sharing', 'post_box', 'post_office', 'recycling', 'telephone', 'emergency_phone', 'toilets', 'drinking_water') THEN amenity ELSE NULL END,\n 'shop_' || CASE WHEN shop IN ('supermarket', 'bakery', 'butcher', 'clothes', 'fashion', 'convenience', 'department_store', 'doityourself', 'florist', 'hairdresser', 'car', 'car_repair', 'bicycle', 'mall') THEN shop WHEN shop IN ('accessories', 'alcohol', 'antique', 'antiques', 'appliance', 'art', 'baby_goods', 'bag', 'bags', 'bakery', 'bathroom_furnishing', 'beauty', 'bed', 'betting', 'beverages', 'bicycle', 'boat', 'bookmaker', 'books', 'boutique', 'builder', 'building_materials', 'butcher', 'camera', 'car', 'car_parts', 'car_repair', 'car_service', 'carpet', 'charity', 'cheese', 'chemist', 'chocolate', 'clothes', 'coffee', 'communication', 'computer', 'confectionery', 'convenience', 'copyshop', 'cosmetics', 'craft', 'curtain', 'dairy', 'deli', 'delicatessen', 'department_store', 'discount', 'dive', 'doityourself', 'dry_cleaning', 'e-cigarette', 'electrical', 'electronics', 'energy', 'erotic', 'estate_agent', 'fabric', 'farm', 'fashion', 'fish', 'fishing', 'fishmonger', 'flooring', 'florist', 'food', 'frame', 'frozen_food', 'funeral_directors', 'furnace', 'furniture', 'gallery', 'gambling', 'games', 'garden_centre', 'gas', 'general', 'gift', 'glaziery', 'greengrocer', 'grocery', 'hairdresser', 'hardware', 'health', 'health_food', 'hearing_aids', 'herbalist', 'hifi', 'hobby', 'household', 'houseware', 'hunting', 'ice_cream', 'insurance', 'interior_decoration', 'jewellery', 'jewelry', 'kiosk', 'kitchen', 'laundry', 'leather', 'lighting', 'locksmith', 'lottery', 'mall', 'market', 'massage', 'medical', 'medical_supply', 'mobile_phone', 'money_lender', 'motorcycle', 'motorcycle_repair', 'music', 'musical_instrument', 'newsagent', 'office_supplies', 'optician', 'organic', 'outdoor', 'paint', 'pastry', 'pawnbroker', 'perfumery', 'pet', 'pets', 'pharmacy', 'phone', 'photo', 'photo_studio', 'photography', 'pottery', 'printing', 'radiotechnics', 'real_estate', 'religion', 'rental', 'salon', 'scuba_diving', 'seafood', 'second_hand', 'sewing', 'shoe_repair', 'shoes', 'shopping_centre', 'solarium', 'souvenir', 'sports', 'stationery', 'supermarket', 'tailor', 'tanning', 'tattoo', 'tea', 'ticket', 'tiles', 'tobacco', 'toys', 'trade', 'travel_agency', 'tyres', 'vacuum_cleaner', 'variety_store', 'video', 'video_games', 'watches', 'wholesale', 'wine', 'winery', 'yes') THEN 'other' ELSE NULL END,\n 'leisure_' || CASE WHEN leisure IN ('swimming_pool', 'water_park', 'miniature_golf', 'golf_course', 'sports_centre', 'stadium', 'track', 'pitch', 'playground', 'park', 'recreation_ground', 'common', 'garden', 'nature_reserve', 'marina', 'slipway') THEN leisure ELSE NULL END,\n 'landuse_' || CASE WHEN landuse IN ('reservoir', 'basin', 'recreation_ground', 'conservation', 'village_green', 'quarry', 'vineyard', 'orchard', 'cemetery', 'residential', 'garages', 'meadow', 'grass', 'allotments', 'forest', 'farmyard', 'farm', 'farmland', 'retail', 'industrial', 'railway', 'commercial', 'brownfield', 'landfill', 'construction', 'military') THEN landuse ELSE NULL END,\n 'man_made_' || CASE WHEN man_made IN ('lighthouse', 'windmill', 'mast', 'water_tower') THEN man_made ELSE NULL END,\n 'natural_' || CASE WHEN \"natural\" IN ('wood', 'peak', 'volcano', 'saddle', 'cave_entrance', 'water', 'lake', 'mud', 'wetland', 'marsh', 'bay', 'spring', 'scree', 'shingle', 'bare_rock', 'sand', 'heath', 'grassland', 'scrub', 'beach', 'glacier') THEN \"natural\" ELSE NULL END,\n 'place_' || CASE WHEN place IN ('island', 'islet') THEN place ELSE NULL END,\n 'military_' || CASE WHEN military IN ('danger_area') THEN military ELSE NULL END,\n 'historic_' || CASE WHEN historic IN ('memorial', 'archaeological_site') THEN historic ELSE NULL END,\n 'highway_' || CASE WHEN highway IN ('services', 'rest_area', 'bus_stop', 'ford') THEN highway ELSE NULL END,\n 'power_' || CASE WHEN power IN ('station', 'generator', 'sub_station', 'substation') THEN power ELSE NULL END,\n 'boundary_' || CASE WHEN boundary IN ('national_park') THEN boundary ELSE NULL END\n ) AS feature,\n access,\n name,\n ref,\n way_area,\n CASE WHEN building = 'no' OR building IS NULL THEN 'no' ELSE 'yes' END AS is_building\n FROM planet_osm_polygon\n -- The upcoming where clause is needed for performance only, as the CASE statements would end up doing the equivalent filtering\n WHERE aeroway IN ('gate', 'apron', 'helipad', 'aerodrome')\n OR tourism IN ('alpine_hut', 'hotel', 'motel', 'hostel', 'chalet', 'guest_house', 'camp_site', 'caravan_site', 'theme_park', 'museum', 'attraction', 'zoo', 'information', 'picnic_site')\n OR amenity IN ('pub', 'restaurant', 'food_court', 'cafe', 'fast_food', 'biergarten', 'bar', 'library', 'theatre', 'courthouse', 'townhall', 'cinema', 'parking', 'police', 'fire_station', 'place_of_worship', 'grave_yard', 'shelter', 'bank', 'embassy', 'fuel', 'bus_station', 'prison', 'university', 'school', 'college', 'kindergarten', 'hospital', 'pharmacy', 'doctors', 'dentist', 'atm', 'bicycle_rental', 'car_rental', 'car_sharing', 'post_box', 'post_office', 'recycling', 'telephone', 'emergency_phone', 'toilets', 'drinking_water')\n OR shop IS NOT NULL -- skip checking a huge list and use a null check\n OR leisure IN ('swimming_pool', 'water_park', 'miniature_golf', 'golf_course', 'sports_centre', 'stadium', 'track', 'pitch', 'playground', 'park', 'recreation_ground', 'common', 'garden', 'nature_reserve', 'marina', 'slipway')\n OR landuse IN ('reservoir', 'basin', 'recreation_ground', 'conservation', 'village_green', 'quarry', 'vineyard', 'orchard', 'cemetery', 'residential', 'garages', 'meadow', 'grass', 'allotments', 'forest', 'farmyard', 'farm', 'farmland', 'retail', 'industrial', 'railway', 'commercial', 'brownfield', 'landfill', 'construction', 'military')\n OR man_made IN ('lighthouse', 'windmill', 'mast', 'water_tower')\n OR \"natural\" IN ('wood', 'peak', 'volcano', 'saddle', 'cave_entrance', 'water', 'lake', 'mud', 'wetland', 'marsh', 'bay', 'spring', 'scree', 'shingle', 'bare_rock', 'sand', 'heath', 'grassland', 'scrub', 'beach', 'glacier')\n OR place IN ('island', 'islet')\n OR military IN ('danger_area')\n OR historic IN ('memorial', 'archaeological_site')\n OR highway IN ('services', 'rest_area', 'bus_stop', 'ford')\n OR power IN ('station', 'generator', 'sub_station', 'substation')\n OR boundary IN ('national_park')\n ORDER BY way_area desc\n) AS text_poly", + "table": "(SELECT\n way,\n way_area/NULLIF(!pixel_width!::real*!pixel_height!::real,0) AS way_pixels,\n COALESCE(\n 'aeroway_' || CASE WHEN aeroway IN ('gate', 'apron', 'helipad', 'aerodrome') THEN aeroway ELSE NULL END,\n 'tourism_' || CASE WHEN tourism IN ('alpine_hut', 'hotel', 'motel', 'hostel', 'chalet', 'guest_house', 'camp_site', 'caravan_site', 'theme_park', 'museum', 'attraction', 'zoo', 'information', 'picnic_site') THEN tourism ELSE NULL END,\n 'amenity_' || CASE WHEN amenity IN ('pub', 'restaurant', 'food_court', 'cafe', 'fast_food', 'biergarten', 'bar', 'library', 'theatre', 'courthouse', 'townhall', 'cinema', 'parking', 'police', 'fire_station', 'place_of_worship', 'grave_yard', 'shelter', 'bank', 'embassy', 'fuel', 'bus_station', 'prison', 'university', 'school', 'college', 'kindergarten', 'hospital', 'pharmacy', 'doctors', 'dentist', 'atm', 'bicycle_rental', 'car_rental', 'car_sharing', 'post_box', 'post_office', 'recycling', 'telephone', 'emergency_phone', 'toilets', 'drinking_water') THEN amenity ELSE NULL END,\n 'shop_' || CASE WHEN shop IN ('supermarket', 'bakery', 'butcher', 'clothes', 'fashion', 'convenience', 'department_store', 'doityourself', 'florist', 'hairdresser', 'car', 'car_repair', 'bicycle', 'mall') THEN shop WHEN shop IN ('accessories', 'alcohol', 'antique', 'antiques', 'appliance', 'art', 'baby_goods', 'bag', 'bags', 'bakery', 'bathroom_furnishing', 'beauty', 'bed', 'betting', 'beverages', 'bicycle', 'boat', 'bookmaker', 'books', 'boutique', 'builder', 'building_materials', 'butcher', 'camera', 'car', 'car_parts', 'car_repair', 'car_service', 'carpet', 'charity', 'cheese', 'chemist', 'chocolate', 'clothes', 'coffee', 'communication', 'computer', 'confectionery', 'convenience', 'copyshop', 'cosmetics', 'craft', 'curtain', 'dairy', 'deli', 'delicatessen', 'department_store', 'discount', 'dive', 'doityourself', 'dry_cleaning', 'e-cigarette', 'electrical', 'electronics', 'energy', 'erotic', 'estate_agent', 'fabric', 'farm', 'fashion', 'fish', 'fishing', 'fishmonger', 'flooring', 'florist', 'food', 'frame', 'frozen_food', 'funeral_directors', 'furnace', 'furniture', 'gallery', 'gambling', 'games', 'garden_centre', 'gas', 'general', 'gift', 'glaziery', 'greengrocer', 'grocery', 'hairdresser', 'hardware', 'health', 'health_food', 'hearing_aids', 'herbalist', 'hifi', 'hobby', 'household', 'houseware', 'hunting', 'ice_cream', 'insurance', 'interior_decoration', 'jewellery', 'jewelry', 'kiosk', 'kitchen', 'laundry', 'leather', 'lighting', 'locksmith', 'lottery', 'mall', 'market', 'massage', 'medical', 'medical_supply', 'mobile_phone', 'money_lender', 'motorcycle', 'motorcycle_repair', 'music', 'musical_instrument', 'newsagent', 'office_supplies', 'optician', 'organic', 'outdoor', 'paint', 'pastry', 'pawnbroker', 'perfumery', 'pet', 'pets', 'pharmacy', 'phone', 'photo', 'photo_studio', 'photography', 'pottery', 'printing', 'radiotechnics', 'real_estate', 'religion', 'rental', 'salon', 'scuba_diving', 'seafood', 'second_hand', 'sewing', 'shoe_repair', 'shoes', 'shopping_centre', 'solarium', 'souvenir', 'sports', 'stationery', 'supermarket', 'tailor', 'tanning', 'tattoo', 'tea', 'ticket', 'tiles', 'tobacco', 'toys', 'trade', 'travel_agency', 'tyres', 'vacuum_cleaner', 'variety_store', 'video', 'video_games', 'watches', 'wholesale', 'wine', 'winery', 'yes') THEN 'other' ELSE NULL END,\n 'leisure_' || CASE WHEN leisure IN ('swimming_pool', 'water_park', 'miniature_golf', 'golf_course', 'sports_centre', 'stadium', 'track', 'pitch', 'playground', 'park', 'recreation_ground', 'common', 'garden', 'nature_reserve', 'marina', 'slipway') THEN leisure ELSE NULL END,\n 'landuse_' || CASE WHEN landuse IN ('reservoir', 'basin', 'recreation_ground', 'conservation', 'village_green', 'quarry', 'vineyard', 'orchard', 'cemetery', 'residential', 'garages', 'meadow', 'grass', 'allotments', 'forest', 'farmyard', 'farm', 'farmland', 'retail', 'industrial', 'railway', 'commercial', 'brownfield', 'landfill', 'construction', 'military') THEN landuse ELSE NULL END,\n 'man_made_' || CASE WHEN man_made IN ('lighthouse', 'windmill', 'mast', 'water_tower', 'pier', 'breakwater', 'groyne') THEN man_made ELSE NULL END,\n 'natural_' || CASE WHEN \"natural\" IN ('wood', 'peak', 'volcano', 'saddle', 'cave_entrance', 'water', 'lake', 'mud', 'wetland', 'marsh', 'bay', 'spring', 'scree', 'shingle', 'bare_rock', 'sand', 'heath', 'grassland', 'scrub', 'beach', 'glacier') THEN \"natural\" ELSE NULL END,\n 'place_' || CASE WHEN place IN ('island', 'islet') THEN place ELSE NULL END,\n 'military_' || CASE WHEN military IN ('danger_area') THEN military ELSE NULL END,\n 'historic_' || CASE WHEN historic IN ('memorial', 'archaeological_site') THEN historic ELSE NULL END,\n 'highway_' || CASE WHEN highway IN ('services', 'rest_area', 'bus_stop', 'ford') THEN highway ELSE NULL END,\n 'power_' || CASE WHEN power IN ('station', 'generator', 'sub_station', 'substation') THEN power ELSE NULL END,\n 'boundary_' || CASE WHEN boundary IN ('national_park') THEN boundary ELSE NULL END,\n 'waterway_' || CASE WHEN waterway IN ('dam') THEN waterway ELSE NULL END\n ) AS feature,\n access,\n name,\n ref,\n way_area,\n CASE WHEN building = 'no' OR building IS NULL THEN 'no' ELSE 'yes' END AS is_building\n FROM planet_osm_polygon\n -- The upcoming where clause is needed for performance only, as the CASE statements would end up doing the equivalent filtering\n WHERE aeroway IN ('gate', 'apron', 'helipad', 'aerodrome')\n OR tourism IN ('alpine_hut', 'hotel', 'motel', 'hostel', 'chalet', 'guest_house', 'camp_site', 'caravan_site', 'theme_park', 'museum', 'attraction', 'zoo', 'information', 'picnic_site')\n OR amenity IN ('pub', 'restaurant', 'food_court', 'cafe', 'fast_food', 'biergarten', 'bar', 'library', 'theatre', 'courthouse', 'townhall', 'cinema', 'parking', 'police', 'fire_station', 'place_of_worship', 'grave_yard', 'shelter', 'bank', 'embassy', 'fuel', 'bus_station', 'prison', 'university', 'school', 'college', 'kindergarten', 'hospital', 'pharmacy', 'doctors', 'dentist', 'atm', 'bicycle_rental', 'car_rental', 'car_sharing', 'post_box', 'post_office', 'recycling', 'telephone', 'emergency_phone', 'toilets', 'drinking_water')\n OR shop IS NOT NULL -- skip checking a huge list and use a null check\n OR leisure IN ('swimming_pool', 'water_park', 'miniature_golf', 'golf_course', 'sports_centre', 'stadium', 'track', 'pitch', 'playground', 'park', 'recreation_ground', 'common', 'garden', 'nature_reserve', 'marina', 'slipway')\n OR landuse IN ('reservoir', 'basin', 'recreation_ground', 'conservation', 'village_green', 'quarry', 'vineyard', 'orchard', 'cemetery', 'residential', 'garages', 'meadow', 'grass', 'allotments', 'forest', 'farmyard', 'farm', 'farmland', 'retail', 'industrial', 'railway', 'commercial', 'brownfield', 'landfill', 'construction', 'military')\n OR man_made IN ('lighthouse', 'windmill', 'mast', 'water_tower', 'pier', 'breakwater', 'groyne')\n OR \"natural\" IN ('wood', 'peak', 'volcano', 'saddle', 'cave_entrance', 'water', 'lake', 'mud', 'wetland', 'marsh', 'bay', 'spring', 'scree', 'shingle', 'bare_rock', 'sand', 'heath', 'grassland', 'scrub', 'beach', 'glacier')\n OR place IN ('island', 'islet')\n OR military IN ('danger_area')\n OR historic IN ('memorial', 'archaeological_site')\n OR highway IN ('services', 'rest_area', 'bus_stop', 'ford')\n OR power IN ('station', 'generator', 'sub_station', 'substation')\n OR boundary IN ('national_park')\n OR waterway = 'dam'\n ORDER BY way_area desc\n) AS text_poly", "geometry_field": "way", "type": "postgis", "key_field": "", @@ -1708,15 +1734,38 @@ "advanced": {} }, { - "name": "text", + "name": "text-line", + "srs-name": "900913", + "geometry": "linestring", + "class": "text", + "srs": "+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0.0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs +over", + "Datasource": { + "extent": "-20037508,-20037508,20037508,20037508", + "table": "(SELECT way, NULL as way_pixels, COALESCE('man_made_' || man_made, 'waterway_' || waterway) AS feature, access, NULL as ele, name, ref, NULL AS way_area,\n CASE WHEN building = 'no' OR building IS NULL THEN 'no' ELSE 'yes' END AS is_building\n FROM planet_osm_line\n WHERE man_made IN ('pier', 'breakwater', 'groyne')\n OR waterway IN ('dam', 'weir')\n) AS text_line", + "geometry_field": "way", + "type": "postgis", + "key_field": "", + "dbname": "gis" + }, + "extent": [ + -180, + -85.05112877980659, + 180, + 85.05112877980659 + ], + "id": "text-line", + "advanced": {} + }, + { + "name": "text-point", "srs-name": "900913", "geometry": "point", "class": "text", - "id": "text", + "id": "text-point", "srs": "+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0.0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs +over", "Datasource": { "extent": "-20037508,-20037508,20037508,20037508", - "table": "(SELECT\n way,\n NULL AS way_pixels,\n COALESCE(\n 'aeroway_' || CASE WHEN aeroway IN ('gate', 'apron', 'helipad', 'aerodrome') THEN aeroway ELSE NULL END,\n 'tourism_' || CASE WHEN tourism IN ('alpine_hut', 'hotel', 'motel', 'hostel', 'chalet', 'guest_house', 'camp_site', 'caravan_site', 'theme_park', 'museum', 'attraction', 'zoo', 'information', 'viewpoint', 'picnic_site') THEN tourism ELSE NULL END,\n 'amenity_' || CASE WHEN amenity IN ('pub', 'restaurant', 'food_court', 'cafe', 'fast_food', 'biergarten', 'bar', 'library', 'theatre', 'courthouse', 'townhall', 'cinema', 'parking', 'police', 'fire_station', 'place_of_worship', 'grave_yard', 'shelter', 'bank', 'embassy', 'fuel', 'bus_station', 'prison', 'university', 'school', 'college', 'kindergarten', 'hospital', 'pharmacy', 'doctors', 'dentist', 'atm', 'bicycle_rental', 'car_rental', 'car_sharing', 'post_box', 'post_office', 'recycling', 'telephone', 'emergency_phone', 'toilets', 'drinking_water') THEN amenity ELSE NULL END,\n 'shop_' || CASE WHEN shop IN ('supermarket', 'bakery', 'butcher', 'clothes', 'fashion', 'convenience', 'department_store', 'doityourself', 'florist', 'hairdresser', 'car', 'car_repair', 'bicycle', 'mall') THEN shop WHEN shop IN ('accessories', 'alcohol', 'antique', 'antiques', 'appliance', 'art', 'baby_goods', 'bag', 'bags', 'bakery', 'bathroom_furnishing', 'beauty', 'bed', 'betting', 'beverages', 'bicycle', 'boat', 'bookmaker', 'books', 'boutique', 'builder', 'building_materials', 'butcher', 'camera', 'car', 'car_parts', 'car_repair', 'car_service', 'carpet', 'charity', 'cheese', 'chemist', 'chocolate', 'clothes', 'coffee', 'communication', 'computer', 'confectionery', 'convenience', 'copyshop', 'cosmetics', 'craft', 'curtain', 'dairy', 'deli', 'delicatessen', 'department_store', 'discount', 'dive', 'doityourself', 'dry_cleaning', 'e-cigarette', 'electrical', 'electronics', 'energy', 'erotic', 'estate_agent', 'fabric', 'farm', 'fashion', 'fish', 'fishing', 'fishmonger', 'flooring', 'florist', 'food', 'frame', 'frozen_food', 'funeral_directors', 'furnace', 'furniture', 'gallery', 'gambling', 'games', 'garden_centre', 'gas', 'general', 'gift', 'glaziery', 'greengrocer', 'grocery', 'hairdresser', 'hardware', 'health', 'health_food', 'hearing_aids', 'herbalist', 'hifi', 'hobby', 'household', 'houseware', 'hunting', 'ice_cream', 'insurance', 'interior_decoration', 'jewellery', 'jewelry', 'kiosk', 'kitchen', 'laundry', 'leather', 'lighting', 'locksmith', 'lottery', 'mall', 'market', 'massage', 'medical', 'medical_supply', 'mobile_phone', 'money_lender', 'motorcycle', 'motorcycle_repair', 'music', 'musical_instrument', 'newsagent', 'office_supplies', 'optician', 'organic', 'outdoor', 'paint', 'pastry', 'pawnbroker', 'perfumery', 'pet', 'pets', 'pharmacy', 'phone', 'photo', 'photo_studio', 'photography', 'pottery', 'printing', 'radiotechnics', 'real_estate', 'religion', 'rental', 'salon', 'scuba_diving', 'seafood', 'second_hand', 'sewing', 'shoe_repair', 'shoes', 'shopping_centre', 'solarium', 'souvenir', 'sports', 'stationery', 'supermarket', 'tailor', 'tanning', 'tattoo', 'tea', 'ticket', 'tiles', 'tobacco', 'toys', 'trade', 'travel_agency', 'tyres', 'vacuum_cleaner', 'variety_store', 'video', 'video_games', 'watches', 'wholesale', 'wine', 'winery', 'yes') THEN 'other' ELSE NULL END,\n 'leisure_' || CASE WHEN leisure IN ('swimming_pool', 'water_park', 'miniature_golf', 'golf_course', 'sports_centre', 'stadium', 'track', 'pitch', 'playground', 'park', 'recreation_ground', 'common', 'garden', 'nature_reserve', 'marina', 'slipway') THEN leisure ELSE NULL END,\n 'landuse_' || CASE WHEN landuse IN ('reservoir', 'basin', 'recreation_ground', 'conservation', 'village_green', 'quarry', 'vineyard', 'orchard', 'cemetery', 'residential', 'garages', 'meadow', 'grass', 'allotments', 'forest', 'farmyard', 'farm', 'farmland', 'retail', 'industrial', 'railway', 'commercial', 'brownfield', 'landfill', 'construction', 'military') THEN landuse ELSE NULL END,\n 'man_made_' || CASE WHEN man_made IN ('lighthouse', 'windmill', 'mast', 'water_tower') THEN man_made ELSE NULL END,\n 'natural_' || CASE WHEN \"natural\" IN ('wood', 'peak', 'volcano', 'saddle', 'cave_entrance', 'water', 'lake', 'mud', 'wetland', 'marsh', 'bay', 'spring', 'scree', 'shingle', 'bare_rock', 'sand', 'heath', 'grassland', 'scrub', 'beach', 'glacier') THEN \"natural\" ELSE NULL END,\n 'place_' || CASE WHEN place IN ('island', 'islet') THEN place ELSE NULL END,\n 'military_' || CASE WHEN military IN ('danger_area') THEN military ELSE NULL END,\n 'historic_' || CASE WHEN historic IN ('memorial', 'archaeological_site') THEN historic ELSE NULL END,\n 'highway_' || CASE WHEN highway IN ('services', 'rest_area', 'bus_stop', 'ford') THEN highway ELSE NULL END,\n 'power_' || CASE WHEN power IN ('station', 'generator', 'sub_station', 'substation') THEN power ELSE NULL END,\n 'boundary_' || CASE WHEN boundary IN ('national_park') THEN boundary ELSE NULL END,\n 'waterway_' || CASE WHEN waterway IN ('lock') THEN waterway ELSE NULL END\n ) AS feature,\n access,\n (CASE WHEN \"natural\" IN ('peak', 'volcano', 'saddle') OR tourism = 'alpine_hut' OR amenity = 'shelter' THEN CASE WHEN ele IS NOT NULL THEN CASE WHEN name IS NOT NULL THEN CONCAT(name, E'\\n', ele) ELSE ele END ELSE name END ELSE name END) AS name,\n ref,\n NULL AS way_area,\n CASE WHEN building = 'no' OR building IS NULL THEN 'no' ELSE 'yes' END AS is_building\n FROM planet_osm_point\n -- The upcoming where clause is needed for performance only, as the CASE statements would end up doing the equivalent filtering\n WHERE aeroway IN ('gate', 'apron', 'helipad', 'aerodrome')\n OR tourism IN ('alpine_hut', 'hotel', 'motel', 'hostel', 'chalet', 'guest_house', 'camp_site', 'caravan_site', 'theme_park', 'museum', 'attraction', 'zoo', 'information', 'viewpoint', 'picnic_site')\n OR amenity IN ('pub', 'restaurant', 'food_court', 'cafe', 'fast_food', 'biergarten', 'bar', 'library', 'theatre', 'courthouse', 'townhall', 'cinema', 'parking', 'police', 'fire_station', 'place_of_worship', 'grave_yard', 'shelter', 'bank', 'embassy', 'fuel', 'bus_station', 'prison', 'university', 'school', 'college', 'kindergarten', 'hospital', 'pharmacy', 'doctors', 'dentist', 'atm', 'bicycle_rental', 'car_rental', 'car_sharing', 'post_box', 'post_office', 'recycling', 'telephone', 'emergency_phone', 'toilets', 'drinking_water')\n OR shop IS NOT NULL -- skip checking a huge list and use a null check\n OR leisure IN ('swimming_pool', 'water_park', 'miniature_golf', 'golf_course', 'sports_centre', 'stadium', 'track', 'pitch', 'playground', 'park', 'recreation_ground', 'common', 'garden', 'nature_reserve', 'marina', 'slipway')\n OR landuse IN ('reservoir', 'basin', 'recreation_ground', 'conservation', 'village_green', 'quarry', 'vineyard', 'orchard', 'cemetery', 'residential', 'garages', 'meadow', 'grass', 'allotments', 'forest', 'farmyard', 'farm', 'farmland', 'retail', 'industrial', 'railway', 'commercial', 'brownfield', 'landfill', 'construction', 'military')\n OR man_made IN ('lighthouse', 'windmill', 'mast', 'water_tower')\n OR \"natural\" IN ('wood', 'peak', 'volcano', 'saddle', 'cave_entrance', 'water', 'lake', 'mud', 'wetland', 'marsh', 'bay', 'spring', 'scree', 'shingle', 'bare_rock', 'sand', 'heath', 'grassland', 'scrub', 'beach', 'glacier')\n OR place IN ('island', 'islet')\n OR military IN ('danger_area')\n OR historic IN ('memorial', 'archaeological_site')\n OR highway IN ('bus_stop', 'services', 'rest_area', 'bus_stop', 'ford')\n OR power IN ('station', 'generator', 'sub_station', 'substation')\n OR boundary IN ('national_park')\n OR waterway = 'lock'\n ) AS text", + "table": "(SELECT\n way,\n NULL AS way_pixels,\n COALESCE(\n 'aeroway_' || CASE WHEN aeroway IN ('gate', 'apron', 'helipad', 'aerodrome') THEN aeroway ELSE NULL END,\n 'tourism_' || CASE WHEN tourism IN ('alpine_hut', 'hotel', 'motel', 'hostel', 'chalet', 'guest_house', 'camp_site', 'caravan_site', 'theme_park', 'museum', 'attraction', 'zoo', 'information', 'viewpoint', 'picnic_site') THEN tourism ELSE NULL END,\n 'amenity_' || CASE WHEN amenity IN ('pub', 'restaurant', 'food_court', 'cafe', 'fast_food', 'biergarten', 'bar', 'library', 'theatre', 'courthouse', 'townhall', 'cinema', 'parking', 'police', 'fire_station', 'place_of_worship', 'grave_yard', 'shelter', 'bank', 'embassy', 'fuel', 'bus_station', 'prison', 'university', 'school', 'college', 'kindergarten', 'hospital', 'pharmacy', 'doctors', 'dentist', 'atm', 'bicycle_rental', 'car_rental', 'car_sharing', 'post_box', 'post_office', 'recycling', 'telephone', 'emergency_phone', 'toilets', 'drinking_water') THEN amenity ELSE NULL END,\n 'shop_' || CASE WHEN shop IN ('supermarket', 'bakery', 'butcher', 'clothes', 'fashion', 'convenience', 'department_store', 'doityourself', 'florist', 'hairdresser', 'car', 'car_repair', 'bicycle', 'mall') THEN shop WHEN shop IN ('accessories', 'alcohol', 'antique', 'antiques', 'appliance', 'art', 'baby_goods', 'bag', 'bags', 'bakery', 'bathroom_furnishing', 'beauty', 'bed', 'betting', 'beverages', 'bicycle', 'boat', 'bookmaker', 'books', 'boutique', 'builder', 'building_materials', 'butcher', 'camera', 'car', 'car_parts', 'car_repair', 'car_service', 'carpet', 'charity', 'cheese', 'chemist', 'chocolate', 'clothes', 'coffee', 'communication', 'computer', 'confectionery', 'convenience', 'copyshop', 'cosmetics', 'craft', 'curtain', 'dairy', 'deli', 'delicatessen', 'department_store', 'discount', 'dive', 'doityourself', 'dry_cleaning', 'e-cigarette', 'electrical', 'electronics', 'energy', 'erotic', 'estate_agent', 'fabric', 'farm', 'fashion', 'fish', 'fishing', 'fishmonger', 'flooring', 'florist', 'food', 'frame', 'frozen_food', 'funeral_directors', 'furnace', 'furniture', 'gallery', 'gambling', 'games', 'garden_centre', 'gas', 'general', 'gift', 'glaziery', 'greengrocer', 'grocery', 'hairdresser', 'hardware', 'health', 'health_food', 'hearing_aids', 'herbalist', 'hifi', 'hobby', 'household', 'houseware', 'hunting', 'ice_cream', 'insurance', 'interior_decoration', 'jewellery', 'jewelry', 'kiosk', 'kitchen', 'laundry', 'leather', 'lighting', 'locksmith', 'lottery', 'mall', 'market', 'massage', 'medical', 'medical_supply', 'mobile_phone', 'money_lender', 'motorcycle', 'motorcycle_repair', 'music', 'musical_instrument', 'newsagent', 'office_supplies', 'optician', 'organic', 'outdoor', 'paint', 'pastry', 'pawnbroker', 'perfumery', 'pet', 'pets', 'pharmacy', 'phone', 'photo', 'photo_studio', 'photography', 'pottery', 'printing', 'radiotechnics', 'real_estate', 'religion', 'rental', 'salon', 'scuba_diving', 'seafood', 'second_hand', 'sewing', 'shoe_repair', 'shoes', 'shopping_centre', 'solarium', 'souvenir', 'sports', 'stationery', 'supermarket', 'tailor', 'tanning', 'tattoo', 'tea', 'ticket', 'tiles', 'tobacco', 'toys', 'trade', 'travel_agency', 'tyres', 'vacuum_cleaner', 'variety_store', 'video', 'video_games', 'watches', 'wholesale', 'wine', 'winery', 'yes') THEN 'other' ELSE NULL END,\n 'leisure_' || CASE WHEN leisure IN ('swimming_pool', 'water_park', 'miniature_golf', 'golf_course', 'sports_centre', 'stadium', 'track', 'pitch', 'playground', 'park', 'recreation_ground', 'common', 'garden', 'nature_reserve', 'marina', 'slipway') THEN leisure ELSE NULL END,\n 'landuse_' || CASE WHEN landuse IN ('reservoir', 'basin', 'recreation_ground', 'conservation', 'village_green', 'quarry', 'vineyard', 'orchard', 'cemetery', 'residential', 'garages', 'meadow', 'grass', 'allotments', 'forest', 'farmyard', 'farm', 'farmland', 'retail', 'industrial', 'railway', 'commercial', 'brownfield', 'landfill', 'construction', 'military') THEN landuse ELSE NULL END,\n 'man_made_' || CASE WHEN man_made IN ('lighthouse', 'windmill', 'mast', 'water_tower') THEN man_made ELSE NULL END,\n 'natural_' || CASE WHEN \"natural\" IN ('wood', 'peak', 'volcano', 'saddle', 'cave_entrance', 'water', 'lake', 'mud', 'wetland', 'marsh', 'bay', 'spring', 'scree', 'shingle', 'bare_rock', 'sand', 'heath', 'grassland', 'scrub', 'beach', 'glacier') THEN \"natural\" ELSE NULL END,\n 'place_' || CASE WHEN place IN ('island', 'islet') THEN place ELSE NULL END,\n 'military_' || CASE WHEN military IN ('danger_area') THEN military ELSE NULL END,\n 'historic_' || CASE WHEN historic IN ('memorial', 'archaeological_site') THEN historic ELSE NULL END,\n 'highway_' || CASE WHEN highway IN ('services', 'rest_area', 'bus_stop', 'ford') THEN highway ELSE NULL END,\n 'power_' || CASE WHEN power IN ('station', 'generator', 'sub_station', 'substation') THEN power ELSE NULL END,\n 'boundary_' || CASE WHEN boundary IN ('national_park') THEN boundary ELSE NULL END,\n 'waterway_' || CASE WHEN waterway IN ('dam', 'weir') THEN waterway ELSE NULL END\n ) AS feature,\n access,\n (CASE WHEN \"natural\" IN ('peak', 'volcano', 'saddle') OR tourism = 'alpine_hut' OR amenity = 'shelter' THEN CASE WHEN ele IS NOT NULL THEN CASE WHEN name IS NOT NULL THEN CONCAT(name, E'\\n', ele) ELSE ele END ELSE name END ELSE name END) AS name,\n ref,\n NULL AS way_area,\n CASE WHEN building = 'no' OR building IS NULL THEN 'no' ELSE 'yes' END AS is_building\n FROM planet_osm_point\n -- The upcoming where clause is needed for performance only, as the CASE statements would end up doing the equivalent filtering\n WHERE aeroway IN ('gate', 'apron', 'helipad', 'aerodrome')\n OR tourism IN ('alpine_hut', 'hotel', 'motel', 'hostel', 'chalet', 'guest_house', 'camp_site', 'caravan_site', 'theme_park', 'museum', 'attraction', 'zoo', 'information', 'viewpoint', 'picnic_site')\n OR amenity IN ('pub', 'restaurant', 'food_court', 'cafe', 'fast_food', 'biergarten', 'bar', 'library', 'theatre', 'courthouse', 'townhall', 'cinema', 'parking', 'police', 'fire_station', 'place_of_worship', 'grave_yard', 'shelter', 'bank', 'embassy', 'fuel', 'bus_station', 'prison', 'university', 'school', 'college', 'kindergarten', 'hospital', 'pharmacy', 'doctors', 'dentist', 'atm', 'bicycle_rental', 'car_rental', 'car_sharing', 'post_box', 'post_office', 'recycling', 'telephone', 'emergency_phone', 'toilets', 'drinking_water')\n OR shop IS NOT NULL -- skip checking a huge list and use a null check\n OR leisure IN ('swimming_pool', 'water_park', 'miniature_golf', 'golf_course', 'sports_centre', 'stadium', 'track', 'pitch', 'playground', 'park', 'recreation_ground', 'common', 'garden', 'nature_reserve', 'marina', 'slipway')\n OR landuse IN ('reservoir', 'basin', 'recreation_ground', 'conservation', 'village_green', 'quarry', 'vineyard', 'orchard', 'cemetery', 'residential', 'garages', 'meadow', 'grass', 'allotments', 'forest', 'farmyard', 'farm', 'farmland', 'retail', 'industrial', 'railway', 'commercial', 'brownfield', 'landfill', 'construction', 'military')\n OR man_made IN ('lighthouse', 'windmill', 'mast', 'water_tower')\n OR \"natural\" IN ('wood', 'peak', 'volcano', 'saddle', 'cave_entrance', 'water', 'lake', 'mud', 'wetland', 'marsh', 'bay', 'spring', 'scree', 'shingle', 'bare_rock', 'sand', 'heath', 'grassland', 'scrub', 'beach', 'glacier')\n OR place IN ('island', 'islet')\n OR military IN ('danger_area')\n OR historic IN ('memorial', 'archaeological_site')\n OR highway IN ('bus_stop', 'services', 'rest_area', 'bus_stop', 'ford')\n OR power IN ('station', 'generator', 'sub_station', 'substation')\n OR boundary IN ('national_park')\n OR waterway IN ('dam', 'weir')\n ) AS text", "geometry_field": "way", "type": "postgis", "key_field": "", @@ -1846,7 +1895,7 @@ "srs": "+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0.0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs +over", "Datasource": { "extent": "-20037508,-20037508,20037508,20037508", - "table": " (SELECT way, waterway, lock, name, intermittent, CASE WHEN tunnel IN ('yes', 'culvert') THEN 'yes' ELSE 'no' END AS int_tunnel\n FROM planet_osm_line\n WHERE waterway IN ('weir', 'river', 'canal', 'derelict_canal', 'stream', 'drain', 'ditch', 'wadi')\n AND (tunnel IS NULL or tunnel != 'culvert')\n ORDER BY z_order\n ) AS water_lines_text", + "table": " (SELECT way, waterway, lock, name, intermittent, CASE WHEN tunnel IN ('yes', 'culvert') THEN 'yes' ELSE 'no' END AS int_tunnel\n FROM planet_osm_line\n WHERE waterway IN ('river', 'canal', 'derelict_canal', 'stream', 'drain', 'ditch', 'wadi')\n AND (tunnel IS NULL or tunnel != 'culvert')\n ORDER BY z_order\n ) AS water_lines_text", "geometry_field": "way", "type": "postgis", "key_field": "", diff --git a/project.yaml b/project.yaml index 5158b67233..3e559e90d3 100644 --- a/project.yaml +++ b/project.yaml @@ -268,32 +268,47 @@ Layer: <<: *osm2pgsql table: |- (SELECT - way, waterway, lock, name, intermittent, + way, waterway, name, 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 ('weir', 'river', 'canal', 'derelict_canal', 'stream', 'drain', 'ditch', 'wadi') + WHERE waterway IN ('river', 'canal', 'derelict_canal', 'stream', 'drain', 'ditch', 'wadi') AND (bridge IS NULL OR bridge NOT IN ('yes', 'aqueduct')) ORDER BY z_order ) AS water_lines properties: minzoom: 12 advanced: {} - - id: "dam" - name: "dam" + - id: "water-barriers-line" + name: "water-barriers-line" class: "" geometry: "linestring" <<: *extents Datasource: <<: *osm2pgsql table: |- - (SELECT way, name - FROM planet_osm_line - WHERE waterway = 'dam' - ) AS dam + (SELECT way, waterway, name + FROM planet_osm_line + WHERE waterway IN ('dam', 'weir', 'lock_gate') + ) AS water_barriers_line + advanced: {} properties: minzoom: 13 + - id: "water-barriers-poly" + name: "water-barriers-poly" + class: "" + geometry: "polygon" + <<: *extents + Datasource: + <<: *osm2pgsql + table: |- + (SELECT way, waterway, name + FROM planet_osm_polygon + WHERE waterway IN ('dam', 'weir', 'lock_gate') + ) AS water_barriers_poly advanced: {} + properties: + minzoom: 13 - id: "marinas-area" name: "marinas-area" class: "" @@ -310,8 +325,8 @@ Layer: properties: minzoom: 14 advanced: {} - - id: "piers-area" - name: "piers-area" + - id: "piers-poly" + name: "piers-poly" class: "" geometry: "polygon" <<: *extents @@ -322,12 +337,12 @@ Layer: way, man_made FROM planet_osm_polygon WHERE man_made IN ('pier', 'breakwater', 'groyne') - ) AS piers_area + ) AS piers_poly properties: minzoom: 12 advanced: {} - - id: "piers" - name: "piers" + - id: "piers-line" + name: "piers-line" class: "" geometry: "linestring" <<: *extents @@ -338,23 +353,23 @@ Layer: way, man_made FROM planet_osm_line WHERE man_made IN ('pier', 'breakwater', 'groyne') - ) AS piers + ) AS piers_line properties: minzoom: 12 advanced: {} - - id: "locks" - name: "locks" + - id: "water-barriers-point" + name: "water-barriers-point" class: "" geometry: "point" <<: *extents Datasource: <<: *osm2pgsql table: |- - (SELECT - way, waterway - FROM planet_osm_point - WHERE waterway = 'lock_gate' - ) AS locks + (SELECT + way, waterway + FROM planet_osm_point + WHERE waterway IN ('dam', 'weir', 'lock_gate') + ) AS water_barriers_points properties: minzoom: 17 advanced: {} @@ -1464,9 +1479,7 @@ Layer: 'leisure_' || CASE WHEN leisure IN ('water_park', 'playground', 'miniature_golf', 'golf_course', 'picnic_table', 'slipway') THEN leisure ELSE NULL END, 'man_made_' || CASE WHEN man_made IN ('mast', 'water_tower', 'lighthouse', 'windmill') THEN man_made ELSE NULL END, 'natural_' || CASE WHEN "natural" IN ('peak', 'volcano', 'saddle', 'spring') THEN "natural" ELSE NULL END, - 'waterway_' || CASE WHEN waterway IN ('lock') THEN waterway ELSE NULL END, 'historic_' || CASE WHEN historic IN ('memorial', 'archaeological_site') THEN historic ELSE NULL END, - 'lock_' || CASE WHEN lock IN ('yes') THEN lock ELSE NULL END, 'highway_'|| CASE WHEN highway IN ('bus_stop', 'traffic_signals', 'ford') THEN highway ELSE NULL END, 'power_' || CASE WHEN power IN ('generator') THEN power ELSE NULL END ) AS feature, @@ -1484,9 +1497,7 @@ Layer: OR leisure IN ('water_park', 'playground', 'miniature_golf', 'golf_course', 'picnic_table', 'slipway') OR man_made IN ('mast', 'water_tower', 'lighthouse', 'windmill') OR "natural" IN ('peak', 'volcano', 'saddle', 'spring', 'cave_entrance') - OR waterway = 'lock' OR historic IN ('memorial', 'archaeological_site') - OR lock = 'yes' OR highway IN ('bus_stop', 'traffic_signals', 'ford') OR (power = 'generator' AND ("generator:source" = 'wind' OR power_source = 'wind')) ) AS amenity_points @@ -1689,14 +1700,15 @@ Layer: 'shop_' || CASE WHEN shop IN ('supermarket', 'bakery', 'butcher', 'clothes', 'fashion', 'convenience', 'department_store', 'doityourself', 'florist', 'hairdresser', 'car', 'car_repair', 'bicycle', 'mall') THEN shop WHEN shop IN ('accessories', 'alcohol', 'antique', 'antiques', 'appliance', 'art', 'baby_goods', 'bag', 'bags', 'bakery', 'bathroom_furnishing', 'beauty', 'bed', 'betting', 'beverages', 'bicycle', 'boat', 'bookmaker', 'books', 'boutique', 'builder', 'building_materials', 'butcher', 'camera', 'car', 'car_parts', 'car_repair', 'car_service', 'carpet', 'charity', 'cheese', 'chemist', 'chocolate', 'clothes', 'coffee', 'communication', 'computer', 'confectionery', 'convenience', 'copyshop', 'cosmetics', 'craft', 'curtain', 'dairy', 'deli', 'delicatessen', 'department_store', 'discount', 'dive', 'doityourself', 'dry_cleaning', 'e-cigarette', 'electrical', 'electronics', 'energy', 'erotic', 'estate_agent', 'fabric', 'farm', 'fashion', 'fish', 'fishing', 'fishmonger', 'flooring', 'florist', 'food', 'frame', 'frozen_food', 'funeral_directors', 'furnace', 'furniture', 'gallery', 'gambling', 'games', 'garden_centre', 'gas', 'general', 'gift', 'glaziery', 'greengrocer', 'grocery', 'hairdresser', 'hardware', 'health', 'health_food', 'hearing_aids', 'herbalist', 'hifi', 'hobby', 'household', 'houseware', 'hunting', 'ice_cream', 'insurance', 'interior_decoration', 'jewellery', 'jewelry', 'kiosk', 'kitchen', 'laundry', 'leather', 'lighting', 'locksmith', 'lottery', 'mall', 'market', 'massage', 'medical', 'medical_supply', 'mobile_phone', 'money_lender', 'motorcycle', 'motorcycle_repair', 'music', 'musical_instrument', 'newsagent', 'office_supplies', 'optician', 'organic', 'outdoor', 'paint', 'pastry', 'pawnbroker', 'perfumery', 'pet', 'pets', 'pharmacy', 'phone', 'photo', 'photo_studio', 'photography', 'pottery', 'printing', 'radiotechnics', 'real_estate', 'religion', 'rental', 'salon', 'scuba_diving', 'seafood', 'second_hand', 'sewing', 'shoe_repair', 'shoes', 'shopping_centre', 'solarium', 'souvenir', 'sports', 'stationery', 'supermarket', 'tailor', 'tanning', 'tattoo', 'tea', 'ticket', 'tiles', 'tobacco', 'toys', 'trade', 'travel_agency', 'tyres', 'vacuum_cleaner', 'variety_store', 'video', 'video_games', 'watches', 'wholesale', 'wine', 'winery', 'yes') THEN 'other' ELSE NULL END, 'leisure_' || CASE WHEN leisure IN ('swimming_pool', 'water_park', 'miniature_golf', 'golf_course', 'sports_centre', 'stadium', 'track', 'pitch', 'playground', 'park', 'recreation_ground', 'common', 'garden', 'nature_reserve', 'marina', 'slipway') THEN leisure ELSE NULL END, 'landuse_' || CASE WHEN landuse IN ('reservoir', 'basin', 'recreation_ground', 'conservation', 'village_green', 'quarry', 'vineyard', 'orchard', 'cemetery', 'residential', 'garages', 'meadow', 'grass', 'allotments', 'forest', 'farmyard', 'farm', 'farmland', 'retail', 'industrial', 'railway', 'commercial', 'brownfield', 'landfill', 'construction', 'military') THEN landuse ELSE NULL END, - 'man_made_' || CASE WHEN man_made IN ('lighthouse', 'windmill', 'mast', 'water_tower') THEN man_made ELSE NULL END, + 'man_made_' || CASE WHEN man_made IN ('lighthouse', 'windmill', 'mast', 'water_tower', 'pier', 'breakwater', 'groyne') THEN man_made ELSE NULL END, 'natural_' || CASE WHEN "natural" IN ('wood', 'peak', 'volcano', 'saddle', 'cave_entrance', 'water', 'lake', 'mud', 'wetland', 'marsh', 'bay', 'spring', 'scree', 'shingle', 'bare_rock', 'sand', 'heath', 'grassland', 'scrub', 'beach', 'glacier') THEN "natural" ELSE NULL END, 'place_' || CASE WHEN place IN ('island', 'islet') THEN place ELSE NULL END, 'military_' || CASE WHEN military IN ('danger_area') THEN military ELSE NULL END, 'historic_' || CASE WHEN historic IN ('memorial', 'archaeological_site') THEN historic ELSE NULL END, 'highway_' || CASE WHEN highway IN ('services', 'rest_area', 'bus_stop', 'ford') THEN highway ELSE NULL END, 'power_' || CASE WHEN power IN ('station', 'generator', 'sub_station', 'substation') THEN power ELSE NULL END, - 'boundary_' || CASE WHEN boundary IN ('national_park') THEN boundary ELSE NULL END + 'boundary_' || CASE WHEN boundary IN ('national_park') THEN boundary ELSE NULL END, + 'waterway_' || CASE WHEN waterway IN ('dam') THEN waterway ELSE NULL END ) AS feature, access, name, @@ -1711,7 +1723,7 @@ Layer: OR shop IS NOT NULL -- skip checking a huge list and use a null check OR leisure IN ('swimming_pool', 'water_park', 'miniature_golf', 'golf_course', 'sports_centre', 'stadium', 'track', 'pitch', 'playground', 'park', 'recreation_ground', 'common', 'garden', 'nature_reserve', 'marina', 'slipway') OR landuse IN ('reservoir', 'basin', 'recreation_ground', 'conservation', 'village_green', 'quarry', 'vineyard', 'orchard', 'cemetery', 'residential', 'garages', 'meadow', 'grass', 'allotments', 'forest', 'farmyard', 'farm', 'farmland', 'retail', 'industrial', 'railway', 'commercial', 'brownfield', 'landfill', 'construction', 'military') - OR man_made IN ('lighthouse', 'windmill', 'mast', 'water_tower') + OR man_made IN ('lighthouse', 'windmill', 'mast', 'water_tower', 'pier', 'breakwater', 'groyne') OR "natural" IN ('wood', 'peak', 'volcano', 'saddle', 'cave_entrance', 'water', 'lake', 'mud', 'wetland', 'marsh', 'bay', 'spring', 'scree', 'shingle', 'bare_rock', 'sand', 'heath', 'grassland', 'scrub', 'beach', 'glacier') OR place IN ('island', 'islet') OR military IN ('danger_area') @@ -1719,13 +1731,29 @@ Layer: OR highway IN ('services', 'rest_area', 'bus_stop', 'ford') OR power IN ('station', 'generator', 'sub_station', 'substation') OR boundary IN ('national_park') + OR waterway = 'dam' ORDER BY way_area desc ) AS text_poly properties: minzoom: 10 advanced: {} - - id: "text" - name: "text" + - id: "text-line" + name: "text-line" + class: "text" + geometry: "linestring" + <<: *extents + Datasource: + <<: *osm2pgsql + table: |- + (SELECT way, NULL as way_pixels, COALESCE('man_made_' || man_made, 'waterway_' || waterway) AS feature, access, NULL as ele, name, ref, NULL AS way_area, + CASE WHEN building = 'no' OR building IS NULL THEN 'no' ELSE 'yes' END AS is_building + FROM planet_osm_line + WHERE man_made IN ('pier', 'breakwater', 'groyne') + OR waterway IN ('dam', 'weir') + ) AS text_line + advanced: {} + - id: "text-point" + name: "text-point" class: "text" geometry: "point" <<: *extents @@ -1752,7 +1780,7 @@ Layer: 'highway_' || CASE WHEN highway IN ('services', 'rest_area', 'bus_stop', 'ford') THEN highway ELSE NULL END, 'power_' || CASE WHEN power IN ('station', 'generator', 'sub_station', 'substation') THEN power ELSE NULL END, 'boundary_' || CASE WHEN boundary IN ('national_park') THEN boundary ELSE NULL END, - 'waterway_' || CASE WHEN waterway IN ('lock') THEN waterway ELSE NULL END + 'waterway_' || CASE WHEN waterway IN ('dam', 'weir') THEN waterway ELSE NULL END ) AS feature, access, (CASE WHEN "natural" IN ('peak', 'volcano', 'saddle') OR tourism = 'alpine_hut' OR amenity = 'shelter' THEN CASE WHEN ele IS NOT NULL THEN CASE WHEN name IS NOT NULL THEN CONCAT(name, E'\n', ele) ELSE ele END ELSE name END ELSE name END) AS name, @@ -1775,7 +1803,7 @@ Layer: OR highway IN ('bus_stop', 'services', 'rest_area', 'bus_stop', 'ford') OR power IN ('station', 'generator', 'sub_station', 'substation') OR boundary IN ('national_park') - OR waterway = 'lock' + OR waterway IN ('dam', 'weir') ) AS text properties: minzoom: 10 @@ -1875,7 +1903,7 @@ Layer: table: |2- (SELECT way, waterway, lock, name, intermittent, CASE WHEN tunnel IN ('yes', 'culvert') THEN 'yes' ELSE 'no' END AS int_tunnel FROM planet_osm_line - WHERE waterway IN ('weir', 'river', 'canal', 'derelict_canal', 'stream', 'drain', 'ditch', 'wadi') + WHERE waterway IN ('river', 'canal', 'derelict_canal', 'stream', 'drain', 'ditch', 'wadi') AND (tunnel IS NULL or tunnel != 'culvert') ORDER BY z_order ) AS water_lines_text diff --git a/water-features.mss b/water-features.mss index 65dca74b88..0a79fcd522 100644 --- a/water-features.mss +++ b/water-features.mss @@ -1,16 +1,93 @@ -#dam { - [zoom >= 13] { - line-width: 2; - line-color: #444; - line-join: round; - line-cap: round; +@breakwater-color: #aaa; /* Also for groyne */ +@dam: #adadad; +@dam-line: #444444; +@weir-line: #aaa; +@lock-gate: #aaa; +@lock-gate-line: #aaa; + +#water-barriers-point, #water-barriers-line, #water-barriers-poly { + [waterway = 'dam'] { + #water-barriers-poly[zoom >= 13] { + line-width: 2; + line-color: @dam-line; + line-join: round; + line-cap: round; + polygon-fill: @dam; + } + #water-barriers-line[zoom >= 13] { + line-width: 2; + line-color: @dam-line; + line-join: round; + line-cap: round; + } + #water-barriers-point[zoom >= 17] { + marker-fill: @dam; + marker-line-color: @dam-line; + marker-line-width: 1; + marker-width: 8; + marker-height: 8; + marker-allow-overlap: true; + marker-ignore-placement: true; + } } - [zoom >= 15] { - text-name: "[name]"; - text-halo-radius: 1; - text-fill: #222; - text-size: 8; - text-face-name: @book-fonts; + + [waterway = 'weir'] { + #water-barriers-line[zoom >= 13] { + line-color: @weir-line; + line-width: 2; + line-dasharray: 2,2; + } + #water-barriers-point[zoom >= 17] { + marker-fill: @water-color; + marker-line-color: @weir-line; + marker-line-width: 1; + marker-width: 8; + marker-height: 8; + marker-allow-overlap: true; + marker-ignore-placement: true; + } + } + + [waterway = 'lock_gate'] { + #water-barriers-line[zoom >= 13] { + line-color: @lock-gate-line; + line-width: 2; + } + #water-barriers-point[zoom >= 17] { + marker-fill: @lock-gate; + marker-line-width: 0; + marker-width: 8; + marker-height: 8; + marker-allow-overlap: true; + marker-ignore-placement: true; + } + } +} + +#piers-poly, #piers-line { + [man_made = 'pier'][zoom >= 12] { + #piers-poly { + polygon-fill: @land-color; + } + #piers-line { + line-width: 1.5; + line-color: @land-color; + [zoom >= 13] { line-width: 3; } + [zoom >= 16] { line-width: 7; } + } + } + + [man_made = 'breakwater'][zoom >= 12], + [man_made = 'groyne'][zoom >= 12] { + #piers-poly { + polygon-fill: @breakwater-color; + } + #piers-line { + line-width: 1; + line-color: @breakwater-color; + [zoom >= 13] { line-width: 2; } + [zoom >= 16] { line-width: 4; } + } } } @@ -37,38 +114,49 @@ } } -#piers-area { - [zoom >= 12] { - polygon-fill: @land-color; - } -} - -#piers { - [man_made = 'breakwater'], - [man_made = 'groyne'] { - [zoom >= 12] { - line-width: 1; - line-color: #aaa; - } - [zoom >= 13] { - line-width: 2; - } - [zoom >= 16] { - line-width: 4; +.text { + [feature = 'waterway_dam'], + [feature = 'waterway_weir'] { + #text-poly[zoom >= 15], + #text-line[zoom >= 15], + #text-point[zoom >= 17] { + text-name: "[name]"; + text-halo-radius: 1; + text-fill: #222; + text-size: 10; + text-face-name: @book-fonts; + #text-poly { + text-placement: interior; + } + #text-line { + text-placement: line; + text-dy: 8; + text-spacing: 400; + } + #text-point { + text-placement: point; + text-dy: 8; + } } } - [man_made = 'pier'][zoom >= 12] { - line-width: 1.5; - line-color: @land-color; - [zoom >= 13] { line-width: 3; } - [zoom >= 16] { line-width: 7; } - } -} -#locks { - [waterway = 'lock_gate'][zoom >= 17] { - marker-fill: #969494; - marker-width: 9; - marker-line-width: 0; + [feature = 'man_made_breakwater'][zoom >= 15], + [feature = 'man_made_groyne'][zoom >= 15], + [feature = 'man_made_pier'][zoom >= 15] { + #text-poly, + #text-line { + text-name: "[name]"; + text-halo-radius: 1; + text-fill: #222; + text-size: 10; + text-face-name: @book-fonts; + #text-poly { + text-placement: interior; + } + #text-line { + text-placement: line; + text-spacing: 400; + } + } } } diff --git a/water.mss b/water.mss index a421bf59dc..44b4690b76 100644 --- a/water.mss +++ b/water.mss @@ -101,13 +101,6 @@ } .water-lines { - [waterway = 'weir'][zoom >= 15] { - line-color: #aaa; - line-width: 2; - line-join: round; - line-cap: round; - } - [waterway = 'canal'][zoom >= 12], [waterway = 'river'][zoom >= 12], [waterway = 'wadi'][zoom >= 13] { @@ -215,80 +208,78 @@ } #water-lines-text { - [waterway = 'river'][zoom >= 13] { - text-name: "[name]"; - text-face-name: @oblique-fonts; - text-placement: line; - text-fill: @water-text; - text-spacing: 400; - text-size: 10; - text-halo-radius: 1; - text-halo-fill: rgba(255,255,255,0.6); - [zoom >= 14] { text-size: 12; } - [int_tunnel = 'yes'] { text-min-distance: 200; } - } - - [waterway = 'canal'][zoom >= 13][zoom < 14] { - text-name: "[name]"; - text-face-name: @oblique-fonts; - text-halo-radius: 1; - text-halo-fill: rgba(255,255,255,0.6); - text-size: 10; - text-placement: line; - text-fill: @water-text; - } - - [waterway = 'stream'][zoom >= 15] { - text-name: "[name]"; - text-size: 10; - text-face-name: @oblique-fonts; - text-fill: @water-text; - text-halo-radius: 1; - text-halo-fill: rgba(255,255,255,0.6); - text-spacing: 600; - text-placement: line; - text-dy: 8; - } + [lock != 'yes'] { + [waterway = 'river'][zoom >= 13] { + text-name: "[name]"; + text-face-name: @oblique-fonts; + text-placement: line; + text-fill: @water-text; + text-spacing: 400; + text-size: 10; + text-halo-radius: 1; + text-halo-fill: rgba(255,255,255,0.6); + [zoom >= 14] { text-size: 12; } + [int_tunnel = 'yes'] { text-min-distance: 200; } + } - [waterway = 'drain'], - [waterway = 'ditch'] { - [zoom >= 15] { + [waterway = 'canal'][zoom >= 13][zoom < 14] { text-name: "[name]"; text-face-name: @oblique-fonts; + text-halo-radius: 1; + text-halo-fill: rgba(255,255,255,0.6); text-size: 10; - text-fill: @water-text; - text-spacing: 600; text-placement: line; + text-fill: @water-text; + } + + [waterway = 'stream'][zoom >= 15] { + text-name: "[name]"; + text-size: 10; + text-face-name: @oblique-fonts; + text-fill: @water-text; text-halo-radius: 1; text-halo-fill: rgba(255,255,255,0.6); + text-spacing: 600; + text-placement: line; + text-dy: 8; } - } - [waterway = 'canal'][zoom >= 14] { - text-name: "[name]"; - text-size: 10; - text-fill: @water-text; - text-placement: line; - text-face-name: @oblique-fonts; - text-halo-radius: 1; - text-halo-fill: rgba(255,255,255,0.6); - [lock = 'yes'][zoom >= 17] { - text-placement: point; - text-wrap-width: 20; + [waterway = 'drain'], + [waterway = 'ditch'] { + [zoom >= 15] { + text-name: "[name]"; + text-face-name: @oblique-fonts; + text-size: 10; + text-fill: @water-text; + text-spacing: 600; + text-placement: line; + text-halo-radius: 1; + text-halo-fill: rgba(255,255,255,0.6); + } } - } - [waterway = 'derelict_canal'][zoom >= 13] { - text-name: "[name]"; - text-size: 10; - text-fill: #80d1ae; - text-face-name: @oblique-fonts; - text-placement: line; - text-spacing: 600; - text-halo-radius: 1; - text-halo-fill: rgba(255,255,255,0.6); - [zoom >= 14] { - text-size: 12; + [waterway = 'canal'][zoom >= 14] { + text-name: "[name]"; + text-size: 10; + text-fill: @water-text; + text-placement: line; + text-face-name: @oblique-fonts; + text-halo-radius: 1; + text-halo-fill: rgba(255,255,255,0.6); + } + + [waterway = 'derelict_canal'][zoom >= 13] { + text-name: "[name]"; + text-size: 10; + text-fill: #80d1ae; + text-face-name: @oblique-fonts; + text-placement: line; + text-spacing: 600; + text-halo-radius: 1; + text-halo-fill: rgba(255,255,255,0.6); + [zoom >= 14] { + text-size: 12; + } } } }