From e4511ee459a755b775eed077a9baf4110535d09c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ko=C4=87?= Date: Mon, 3 Oct 2016 01:38:25 +0200 Subject: [PATCH] Rendering barriers above highway areas --- project.mml | 100 +++++++++++++++++++++++++-------------------------- project.yaml | 86 ++++++++++++++++++++++---------------------- 2 files changed, 93 insertions(+), 93 deletions(-) diff --git a/project.mml b/project.mml index fffc90702c..ce0cfe565f 100644 --- a/project.mml +++ b/project.mml @@ -633,15 +633,15 @@ "advanced": {} }, { - "name": "line-barriers", + "name": "cliffs", "srs-name": "900913", "geometry": "linestring", - "class": "barriers", - "id": "line-barriers", + "class": "", + "id": "cliffs", "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, COALESCE(historic, barrier) AS feature\n FROM (SELECT way,\n ('barrier_' || (CASE WHEN barrier IN ('chain', 'city_wall', 'embankment', 'ditch', 'fence', 'guard_rail',\n 'handrail', 'hedge', 'kerb', 'retaining_wall', 'wall') THEN barrier ELSE NULL END)) AS barrier,\n ('historic_' || (CASE WHEN historic = 'citywalls' THEN historic ELSE NULL END)) AS historic\n FROM planet_osm_line\n WHERE barrier IN ('chain', 'city_wall', 'embankment', 'ditch', 'fence', 'guard_rail',\n 'handrail', 'hedge', 'kerb', 'retaining_wall', 'wall')\n OR historic = 'city_wall'\n AND (waterway IS NULL OR waterway NOT IN ('river', 'canal', 'derelict_canal', 'stream', 'drain', 'ditch', 'wadi'))\n ) AS features\n) AS line_barriers", + "table": "(SELECT\n way, \"natural\", man_made\n FROM planet_osm_line\n WHERE \"natural\" = 'cliff' OR man_made = 'embankment'\n) AS cliffs", "geometry_field": "way", "type": "postgis", "key_field": "", @@ -654,20 +654,20 @@ 85.05112877980659 ], "properties": { - "minzoom": 14 + "minzoom": 13 }, "advanced": {} }, { - "name": "cliffs", + "name": "ferry-routes", "srs-name": "900913", "geometry": "linestring", "class": "", - "id": "cliffs", + "id": "ferry-routes", "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, \"natural\", man_made\n FROM planet_osm_line\n WHERE \"natural\" = 'cliff' OR man_made = 'embankment'\n) AS cliffs", + "table": "(SELECT\n way\n FROM planet_osm_line\n WHERE route = 'ferry'\n) AS ferry_routes", "geometry_field": "way", "type": "postgis", "key_field": "", @@ -680,20 +680,20 @@ 85.05112877980659 ], "properties": { - "minzoom": 13 + "minzoom": 7 }, "advanced": {} }, { - "name": "area-barriers", + "name": "turning-circle-casing", "srs-name": "900913", - "geometry": "polygon", - "class": "barriers", - "id": "area-barriers", + "geometry": "point", + "class": "", + "id": "turning-circle-casing", "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, barrier AS feature\n FROM (SELECT way,\n ('barrier_' || barrier) AS barrier\n FROM planet_osm_polygon\n WHERE barrier IS NOT NULL\n ) AS features\n) AS area_barriers", + "table": "(SELECT DISTINCT ON (p.way)\n p.way AS way, l.highway AS int_tc_type,\n CASE WHEN l.service IN ('parking_aisle', 'drive-through', 'driveway')\n THEN 'INT-minor'::text\n ELSE 'INT-normal'::text\n END AS int_tc_service\n FROM planet_osm_point p\n JOIN planet_osm_line l ON ST_DWithin(p.way, l.way, 0.1) -- Assumes Mercator\n JOIN (VALUES\n ('tertiary', 1),\n ('unclassified', 2),\n ('residential', 3),\n ('living_street', 4),\n ('service', 5)\n ) AS v (highway, prio)\n ON v.highway=l.highway\n WHERE p.highway = 'turning_circle'\n OR p.highway = 'turning_loop'\n ORDER BY p.way, v.prio\n) AS turning_circle_casing", "geometry_field": "way", "type": "postgis", "key_field": "", @@ -706,20 +706,20 @@ 85.05112877980659 ], "properties": { - "minzoom": 16 + "minzoom": 15 }, "advanced": {} }, { - "name": "ferry-routes", + "name": "highway-area-casing", "srs-name": "900913", - "geometry": "linestring", + "geometry": "polygon", "class": "", - "id": "ferry-routes", + "id": "highway-area-casing", "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 FROM planet_osm_line\n WHERE route = 'ferry'\n) AS ferry_routes", + "table": "(SELECT\n way,\n COALESCE((\n 'highway_' || (CASE WHEN highway IN ('residential', 'unclassified', 'pedestrian', 'service', 'footway', 'cycleway', 'track', 'path', 'platform') THEN highway ELSE NULL END)),\n ('railway_' || (CASE WHEN railway IN ('platform') THEN railway ELSE NULL END))\n ) AS feature\n FROM planet_osm_polygon\n WHERE highway IN ('residential', 'unclassified', 'pedestrian', 'service', 'footway', 'track', 'path', 'platform')\n OR railway IN ('platform')\n ORDER BY z_order, way_area DESC\n) AS highway_area_casing", "geometry_field": "way", "type": "postgis", "key_field": "", @@ -732,20 +732,19 @@ 85.05112877980659 ], "properties": { - "minzoom": 7 + "minzoom": 14 }, "advanced": {} }, { - "name": "turning-circle-casing", + "name": "roads-casing", "srs-name": "900913", - "geometry": "point", - "class": "", - "id": "turning-circle-casing", + "geometry": "linestring", + "class": "roads-casing", "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 DISTINCT ON (p.way)\n p.way AS way, l.highway AS int_tc_type,\n CASE WHEN l.service IN ('parking_aisle', 'drive-through', 'driveway')\n THEN 'INT-minor'::text\n ELSE 'INT-normal'::text\n END AS int_tc_service\n FROM planet_osm_point p\n JOIN planet_osm_line l ON ST_DWithin(p.way, l.way, 0.1) -- Assumes Mercator\n JOIN (VALUES\n ('tertiary', 1),\n ('unclassified', 2),\n ('residential', 3),\n ('living_street', 4),\n ('service', 5)\n ) AS v (highway, prio)\n ON v.highway=l.highway\n WHERE p.highway = 'turning_circle'\n OR p.highway = 'turning_loop'\n ORDER BY p.way, v.prio\n) AS turning_circle_casing", + "table": "(SELECT\n way,\n (CASE WHEN substr(feature, length(feature)-3, 4) = 'link' THEN substr(feature, 0, length(feature)-4) ELSE feature END) AS feature,\n horse,\n foot,\n bicycle,\n tracktype,\n int_surface,\n access,\n construction,\n service,\n link,\n layernotnull\n FROM ( -- subselect that contains both roads and rail/aero\n SELECT\n way,\n ('highway_' || highway) AS feature, --only motorway to tertiary links are accepted later on\n horse,\n foot,\n bicycle,\n tracktype,\n CASE WHEN surface IN ('unpaved', 'compacted', 'dirt', 'earth', 'fine_gravel', 'grass', 'grass_paver', 'gravel', 'ground',\n 'mud', 'pebblestone', 'salt', 'sand', 'woodchips', 'clay') THEN 'unpaved'\n WHEN surface IN ('paved', 'asphalt', 'cobblestone', 'cobblestone:flattened', 'sett', 'concrete', 'concrete:lanes',\n 'concrete:plates', 'paving_stones', 'metal', 'wood') THEN 'paved'\n ELSE NULL\n END AS int_surface,\n CASE WHEN access IN ('destination') THEN 'destination'::text\n WHEN access IN ('no', 'private') THEN 'no'::text\n ELSE NULL\n END AS access,\n construction,\n CASE\n WHEN service IN ('parking_aisle', 'drive-through', 'driveway') THEN 'INT-minor'::text\n ELSE 'INT-normal'::text\n END AS service,\n CASE\n WHEN substr(highway, length(highway)-3, 4) = 'link' THEN 'yes'\n ELSE 'no'\n END AS link,\n CASE WHEN layer~E'^-?\\\\d+$' AND length(layer)<10 THEN layer::integer ELSE 0 END AS layernotnull\n FROM planet_osm_line\n WHERE (tunnel IS NULL OR NOT tunnel IN ('yes', 'building_passage'))\n AND (covered IS NULL OR NOT covered = 'yes')\n AND (bridge IS NULL OR NOT bridge IN ('yes', 'boardwalk', 'cantilever', 'covered', 'low_water_crossing', 'movable', 'trestle', 'viaduct'))\n AND highway IS NOT NULL -- end of road select\n UNION ALL\n SELECT\n way,\n COALESCE(\n ('railway_' || (CASE WHEN railway = 'preserved' AND service IN ('spur', 'siding', 'yard') THEN 'INT-preserved-ssy'::text \n WHEN (railway = 'rail' AND service IN ('spur', 'siding', 'yard')) THEN 'INT-spur-siding-yard' \n WHEN (railway = 'tram' AND service IN ('spur', 'siding', 'yard')) THEN 'tram-service' ELSE railway END)),\n ('aeroway_' || aeroway)\n ) AS feature,\n horse,\n foot,\n bicycle,\n tracktype,\n 'null',\n CASE\n WHEN access IN ('destination') THEN 'destination'::text\n WHEN access IN ('no', 'private') THEN 'no'::text\n ELSE NULL\n END AS access,\n construction,\n CASE WHEN service IN ('parking_aisle', 'drive-through', 'driveway') THEN 'INT-minor'::text ELSE 'INT-normal'::text END AS service,\n 'no' AS link,\n CASE WHEN layer~E'^-?\\\\d+$' AND length(layer)<10 THEN layer::integer ELSE 0 END AS layernotnull\n FROM planet_osm_line\n WHERE (tunnel IS NULL OR NOT tunnel IN ('yes', 'building_passage'))\n AND (covered IS NULL OR NOT covered = 'yes')\n AND (bridge IS NULL OR NOT bridge IN ('yes', 'boardwalk', 'cantilever', 'covered', 'low_water_crossing', 'movable', 'trestle', 'viaduct'))\n AND (railway IS NOT NULL OR aeroway IS NOT NULL) -- end of rail/aero select\n ) AS features\n JOIN (VALUES -- this join is also putting a condition on what is selected. features not matching it do not make it into the results.\n ('railway_rail', 440),\n ('railway_INT-preserved-ssy', 430),\n ('railway_INT-spur-siding-yard', 430),\n ('railway_subway', 420),\n ('railway_narrow_gauge', 420),\n ('railway_light_rail', 420),\n ('railway_preserved', 420),\n ('railway_funicular', 420),\n ('railway_monorail', 420),\n ('railway_miniature', 420),\n ('railway_turntable', 420),\n ('railway_tram', 410),\n ('railway_tram-service', 405),\n ('railway_disused', 400),\n ('railway_construction', 400),\n ('highway_motorway', 380),\n ('highway_trunk', 370),\n ('highway_primary', 360),\n ('highway_secondary', 350),\n ('highway_tertiary', 340),\n ('highway_residential', 330),\n ('highway_unclassified', 330),\n ('highway_road', 330),\n ('highway_living_street', 320),\n ('highway_pedestrian', 310),\n ('highway_raceway', 300),\n ('highway_motorway_link', 240),\n ('highway_trunk_link', 230),\n ('highway_primary_link', 220),\n ('highway_secondary_link', 210),\n ('highway_tertiary_link', 200),\n ('highway_service', 150),\n ('highway_track', 110),\n ('highway_path', 100),\n ('highway_footway', 100),\n ('highway_bridleway', 100),\n ('highway_cycleway', 100),\n ('highway_steps', 100),\n ('highway_platform', 90),\n ('railway_platform', 90),\n ('aeroway_runway', 60),\n ('aeroway_taxiway', 50),\n ('highway_construction', 10)\n ) AS ordertable (feature, prio)\n USING (feature)\n ORDER BY\n layernotnull,\n prio,\n CASE WHEN access IN ('no', 'private') THEN 0 WHEN access IN ('destination') THEN 1 ELSE 2 END,\n CASE WHEN int_surface IN ('unpaved') THEN 0 ELSE 2 END\n) AS roads_casing", "geometry_field": "way", "type": "postgis", "key_field": "", @@ -757,21 +756,21 @@ 180, 85.05112877980659 ], + "id": "roads-casing", "properties": { - "minzoom": 15 + "minzoom": 9 }, "advanced": {} }, { - "name": "highway-area-casing", + "name": "highway-area-fill", "srs-name": "900913", - "geometry": "polygon", "class": "", - "id": "highway-area-casing", + "id": "highway-area-fill", "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 'highway_' || (CASE WHEN highway IN ('residential', 'unclassified', 'pedestrian', 'service', 'footway', 'cycleway', 'track', 'path', 'platform') THEN highway ELSE NULL END)),\n ('railway_' || (CASE WHEN railway IN ('platform') THEN railway ELSE NULL END))\n ) AS feature\n FROM planet_osm_polygon\n WHERE highway IN ('residential', 'unclassified', 'pedestrian', 'service', 'footway', 'track', 'path', 'platform')\n OR railway IN ('platform')\n ORDER BY z_order, way_area DESC\n) AS highway_area_casing", + "table": "(SELECT\n way,\n COALESCE(\n ('highway_' || (CASE WHEN highway IN ('residential', 'unclassified', 'pedestrian', 'service', 'footway', 'cycleway', 'living_street', \n 'track', 'path', 'platform', 'services') THEN highway ELSE NULL END)),\n ('railway_' || (CASE WHEN railway IN ('platform') THEN railway ELSE NULL END)),\n (('aeroway_' || CASE WHEN aeroway IN ('runway', 'taxiway', 'helipad') THEN aeroway ELSE NULL END))\n ) AS feature\n FROM planet_osm_polygon\n WHERE highway IN ('residential', 'unclassified', 'pedestrian', 'service', 'footway', 'living_street', 'track', 'path', 'platform', 'services')\n OR railway IN ('platform')\n OR aeroway IN ('runway', 'taxiway', 'helipad')\n ORDER BY z_order, way_area desc\n) AS highway_area_fill", "geometry_field": "way", "type": "postgis", "key_field": "", @@ -789,14 +788,15 @@ "advanced": {} }, { - "name": "roads-casing", + "name": "roads-fill", "srs-name": "900913", "geometry": "linestring", - "class": "roads-casing", + "class": "roads-fill access", + "id": "roads-fill", "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 (CASE WHEN substr(feature, length(feature)-3, 4) = 'link' THEN substr(feature, 0, length(feature)-4) ELSE feature END) AS feature,\n horse,\n foot,\n bicycle,\n tracktype,\n int_surface,\n access,\n construction,\n service,\n link,\n layernotnull\n FROM ( -- subselect that contains both roads and rail/aero\n SELECT\n way,\n ('highway_' || highway) AS feature, --only motorway to tertiary links are accepted later on\n horse,\n foot,\n bicycle,\n tracktype,\n CASE WHEN surface IN ('unpaved', 'compacted', 'dirt', 'earth', 'fine_gravel', 'grass', 'grass_paver', 'gravel', 'ground',\n 'mud', 'pebblestone', 'salt', 'sand', 'woodchips', 'clay') THEN 'unpaved'\n WHEN surface IN ('paved', 'asphalt', 'cobblestone', 'cobblestone:flattened', 'sett', 'concrete', 'concrete:lanes',\n 'concrete:plates', 'paving_stones', 'metal', 'wood') THEN 'paved'\n ELSE NULL\n END AS int_surface,\n CASE WHEN access IN ('destination') THEN 'destination'::text\n WHEN access IN ('no', 'private') THEN 'no'::text\n ELSE NULL\n END AS access,\n construction,\n CASE\n WHEN service IN ('parking_aisle', 'drive-through', 'driveway') THEN 'INT-minor'::text\n ELSE 'INT-normal'::text\n END AS service,\n CASE\n WHEN substr(highway, length(highway)-3, 4) = 'link' THEN 'yes'\n ELSE 'no'\n END AS link,\n CASE WHEN layer~E'^-?\\\\d+$' AND length(layer)<10 THEN layer::integer ELSE 0 END AS layernotnull\n FROM planet_osm_line\n WHERE (tunnel IS NULL OR NOT tunnel IN ('yes', 'building_passage'))\n AND (covered IS NULL OR NOT covered = 'yes')\n AND (bridge IS NULL OR NOT bridge IN ('yes', 'boardwalk', 'cantilever', 'covered', 'low_water_crossing', 'movable', 'trestle', 'viaduct'))\n AND highway IS NOT NULL -- end of road select\n UNION ALL\n SELECT\n way,\n COALESCE(\n ('railway_' || (CASE WHEN railway = 'preserved' AND service IN ('spur', 'siding', 'yard') THEN 'INT-preserved-ssy'::text \n WHEN (railway = 'rail' AND service IN ('spur', 'siding', 'yard')) THEN 'INT-spur-siding-yard' \n WHEN (railway = 'tram' AND service IN ('spur', 'siding', 'yard')) THEN 'tram-service' ELSE railway END)),\n ('aeroway_' || aeroway)\n ) AS feature,\n horse,\n foot,\n bicycle,\n tracktype,\n 'null',\n CASE\n WHEN access IN ('destination') THEN 'destination'::text\n WHEN access IN ('no', 'private') THEN 'no'::text\n ELSE NULL\n END AS access,\n construction,\n CASE WHEN service IN ('parking_aisle', 'drive-through', 'driveway') THEN 'INT-minor'::text ELSE 'INT-normal'::text END AS service,\n 'no' AS link,\n CASE WHEN layer~E'^-?\\\\d+$' AND length(layer)<10 THEN layer::integer ELSE 0 END AS layernotnull\n FROM planet_osm_line\n WHERE (tunnel IS NULL OR NOT tunnel IN ('yes', 'building_passage'))\n AND (covered IS NULL OR NOT covered = 'yes')\n AND (bridge IS NULL OR NOT bridge IN ('yes', 'boardwalk', 'cantilever', 'covered', 'low_water_crossing', 'movable', 'trestle', 'viaduct'))\n AND (railway IS NOT NULL OR aeroway IS NOT NULL) -- end of rail/aero select\n ) AS features\n JOIN (VALUES -- this join is also putting a condition on what is selected. features not matching it do not make it into the results.\n ('railway_rail', 440),\n ('railway_INT-preserved-ssy', 430),\n ('railway_INT-spur-siding-yard', 430),\n ('railway_subway', 420),\n ('railway_narrow_gauge', 420),\n ('railway_light_rail', 420),\n ('railway_preserved', 420),\n ('railway_funicular', 420),\n ('railway_monorail', 420),\n ('railway_miniature', 420),\n ('railway_turntable', 420),\n ('railway_tram', 410),\n ('railway_tram-service', 405),\n ('railway_disused', 400),\n ('railway_construction', 400),\n ('highway_motorway', 380),\n ('highway_trunk', 370),\n ('highway_primary', 360),\n ('highway_secondary', 350),\n ('highway_tertiary', 340),\n ('highway_residential', 330),\n ('highway_unclassified', 330),\n ('highway_road', 330),\n ('highway_living_street', 320),\n ('highway_pedestrian', 310),\n ('highway_raceway', 300),\n ('highway_motorway_link', 240),\n ('highway_trunk_link', 230),\n ('highway_primary_link', 220),\n ('highway_secondary_link', 210),\n ('highway_tertiary_link', 200),\n ('highway_service', 150),\n ('highway_track', 110),\n ('highway_path', 100),\n ('highway_footway', 100),\n ('highway_bridleway', 100),\n ('highway_cycleway', 100),\n ('highway_steps', 100),\n ('highway_platform', 90),\n ('railway_platform', 90),\n ('aeroway_runway', 60),\n ('aeroway_taxiway', 50),\n ('highway_construction', 10)\n ) AS ordertable (feature, prio)\n USING (feature)\n ORDER BY\n layernotnull,\n prio,\n CASE WHEN access IN ('no', 'private') THEN 0 WHEN access IN ('destination') THEN 1 ELSE 2 END,\n CASE WHEN int_surface IN ('unpaved') THEN 0 ELSE 2 END\n) AS roads_casing", + "table": "(SELECT\n way,\n (CASE WHEN substr(feature, length(feature)-3, 4) = 'link' THEN substr(feature, 0, length(feature)-4) ELSE feature END) AS feature,\n horse,\n foot,\n bicycle,\n tracktype,\n int_surface,\n access,\n construction,\n service,\n link,\n layernotnull\n FROM ( -- begin \"features\" subselect that contains both roads and rail/aero\n SELECT\n way,\n ('highway_' || highway) AS feature, -- only motorway to tertiary links are accepted later on\n horse,\n foot,\n bicycle,\n tracktype,\n CASE WHEN surface IN ('unpaved', 'compacted', 'dirt', 'earth', 'fine_gravel', 'grass', 'grass_paver', 'gravel', 'ground',\n 'mud', 'pebblestone', 'salt', 'sand', 'woodchips', 'clay') THEN 'unpaved'\n WHEN surface IN ('paved', 'asphalt', 'cobblestone', 'cobblestone:flattened', 'sett', 'concrete', 'concrete:lanes',\n 'concrete:plates', 'paving_stones', 'metal', 'wood') THEN 'paved'\n ELSE NULL\n END AS int_surface,\n CASE WHEN access IN ('destination') THEN 'destination'::text\n WHEN access IN ('no', 'private') THEN 'no'::text\n ELSE NULL\n END AS access,\n construction,\n CASE\n WHEN service IN ('parking_aisle', 'drive-through', 'driveway') THEN 'INT-minor'::text\n ELSE 'INT-normal'::text\n END AS service,\n CASE\n WHEN substr(highway, length(highway)-3, 4) = 'link' THEN 'yes'\n ELSE 'no'\n END AS link,\n CASE WHEN layer~E'^-?\\\\d+$' AND length(layer)<10 THEN layer::integer ELSE 0 END AS layernotnull\n FROM planet_osm_line\n WHERE (tunnel IS NULL OR NOT tunnel IN ('yes', 'building_passage'))\n AND (covered IS NULL OR NOT covered = 'yes')\n AND (bridge IS NULL OR NOT bridge IN ('yes', 'boardwalk', 'cantilever', 'covered', 'low_water_crossing', 'movable', 'trestle', 'viaduct'))\n AND highway IS NOT NULL -- end of road select\n UNION ALL\n SELECT\n way,\n COALESCE(\n ('railway_' || (CASE WHEN railway = 'preserved' AND service IN ('spur', 'siding', 'yard') THEN 'INT-preserved-ssy'::text \n WHEN (railway = 'rail' AND service IN ('spur', 'siding', 'yard')) THEN 'INT-spur-siding-yard' \n WHEN (railway = 'tram' AND service IN ('spur', 'siding', 'yard')) THEN 'tram-service' ELSE railway END)),\n ('aeroway_' || aeroway)\n ) AS feature,\n horse,\n foot,\n bicycle,\n tracktype,\n 'null' AS surface, -- Should be a SQL NULL?\n CASE\n WHEN access IN ('destination') THEN 'destination'::text\n WHEN access IN ('no', 'private') THEN 'no'::text\n ELSE NULL\n END AS access,\n construction,\n CASE WHEN service IN ('parking_aisle', 'drive-through', 'driveway') THEN 'INT-minor'::text ELSE 'INT-normal'::text END AS service,\n 'no' AS link,\n CASE WHEN layer~E'^-?\\\\d+$' AND length(layer)<10 THEN layer::integer ELSE 0 END AS layernotnull\n FROM planet_osm_line\n WHERE (tunnel IS NULL OR NOT tunnel IN ('yes', 'building_passage'))\n AND (covered IS NULL OR NOT covered = 'yes')\n AND (bridge IS NULL OR NOT bridge IN ('yes', 'boardwalk', 'cantilever', 'covered', 'low_water_crossing', 'movable', 'trestle', 'viaduct'))\n AND (railway IS NOT NULL OR aeroway IS NOT NULL) -- end of rail/aero select\n ) AS features\n JOIN (VALUES -- this join is also putting a condition on what is selected. features not matching it do not make it into the results.\n ('railway_rail', 440),\n ('railway_INT-preserved-ssy', 430),\n ('railway_INT-spur-siding-yard', 430),\n ('railway_subway', 420),\n ('railway_narrow_gauge', 420),\n ('railway_light_rail', 420),\n ('railway_preserved', 420),\n ('railway_funicular', 420),\n ('railway_monorail', 420),\n ('railway_miniature', 420),\n ('railway_turntable', 420),\n ('railway_tram', 410),\n ('railway_tram-service', 405),\n ('railway_disused', 400),\n ('railway_construction', 400),\n ('highway_motorway', 380),\n ('highway_trunk', 370),\n ('highway_primary', 360),\n ('highway_secondary', 350),\n ('highway_tertiary', 340),\n ('highway_residential', 330),\n ('highway_unclassified', 330),\n ('highway_road', 330),\n ('highway_living_street', 320),\n ('highway_pedestrian', 310),\n ('highway_raceway', 300),\n ('highway_motorway_link', 240),\n ('highway_trunk_link', 230),\n ('highway_primary_link', 220),\n ('highway_secondary_link', 210),\n ('highway_tertiary_link', 200),\n ('highway_service', 150),\n ('highway_track', 110),\n ('highway_path', 100),\n ('highway_footway', 100),\n ('highway_bridleway', 100),\n ('highway_cycleway', 100),\n ('highway_steps', 100),\n ('highway_platform', 90),\n ('railway_platform', 90),\n ('aeroway_runway', 60),\n ('aeroway_taxiway', 50),\n ('highway_construction', 10)\n ) AS ordertable (feature, prio)\n USING (feature)\n ORDER BY\n layernotnull,\n prio,\n CASE WHEN access IN ('no', 'private') THEN 0 WHEN access IN ('destination') THEN 1 ELSE 2 END,\n CASE WHEN int_surface IN ('unpaved') THEN 0 ELSE 2 END\n) AS roads_fill", "geometry_field": "way", "type": "postgis", "key_field": "", @@ -808,21 +808,21 @@ 180, 85.05112877980659 ], - "id": "roads-casing", "properties": { - "minzoom": 9 + "minzoom": 10 }, "advanced": {} }, { - "name": "highway-area-fill", + "name": "turning-circle-fill", "srs-name": "900913", + "geometry": "point", "class": "", - "id": "highway-area-fill", + "id": "turning-circle-fill", "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 ('highway_' || (CASE WHEN highway IN ('residential', 'unclassified', 'pedestrian', 'service', 'footway', 'cycleway', 'living_street', \n 'track', 'path', 'platform', 'services') THEN highway ELSE NULL END)),\n ('railway_' || (CASE WHEN railway IN ('platform') THEN railway ELSE NULL END)),\n (('aeroway_' || CASE WHEN aeroway IN ('runway', 'taxiway', 'helipad') THEN aeroway ELSE NULL END))\n ) AS feature\n FROM planet_osm_polygon\n WHERE highway IN ('residential', 'unclassified', 'pedestrian', 'service', 'footway', 'living_street', 'track', 'path', 'platform', 'services')\n OR railway IN ('platform')\n OR aeroway IN ('runway', 'taxiway', 'helipad')\n ORDER BY z_order, way_area desc\n) AS highway_area_fill", + "table": "(SELECT\n DISTINCT on (p.way)\n p.way AS way, l.highway AS int_tc_type,\n CASE WHEN l.service IN ('parking_aisle', 'drive-through', 'driveway') THEN 'INT-minor'::text\n ELSE 'INT-normal'::text END AS int_tc_service\n FROM planet_osm_point p\n JOIN planet_osm_line l\n ON ST_DWithin(p.way, l.way, 0.1)\n JOIN (VALUES\n ('tertiary', 1),\n ('unclassified', 2),\n ('residential', 3),\n ('living_street', 4),\n ('service', 5),\n ('track', 6)\n ) AS v (highway, prio)\n ON v.highway=l.highway\n WHERE p.highway = 'turning_circle' OR p.highway = 'turning_loop'\n ORDER BY p.way, v.prio\n) AS turning_circle_fill", "geometry_field": "way", "type": "postgis", "key_field": "", @@ -835,20 +835,20 @@ 85.05112877980659 ], "properties": { - "minzoom": 14 + "minzoom": 15 }, "advanced": {} }, { - "name": "roads-fill", + "name": "line-barriers", "srs-name": "900913", "geometry": "linestring", - "class": "roads-fill access", - "id": "roads-fill", + "class": "barriers", + "id": "line-barriers", "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 (CASE WHEN substr(feature, length(feature)-3, 4) = 'link' THEN substr(feature, 0, length(feature)-4) ELSE feature END) AS feature,\n horse,\n foot,\n bicycle,\n tracktype,\n int_surface,\n access,\n construction,\n service,\n link,\n layernotnull\n FROM ( -- begin \"features\" subselect that contains both roads and rail/aero\n SELECT\n way,\n ('highway_' || highway) AS feature, -- only motorway to tertiary links are accepted later on\n horse,\n foot,\n bicycle,\n tracktype,\n CASE WHEN surface IN ('unpaved', 'compacted', 'dirt', 'earth', 'fine_gravel', 'grass', 'grass_paver', 'gravel', 'ground',\n 'mud', 'pebblestone', 'salt', 'sand', 'woodchips', 'clay') THEN 'unpaved'\n WHEN surface IN ('paved', 'asphalt', 'cobblestone', 'cobblestone:flattened', 'sett', 'concrete', 'concrete:lanes',\n 'concrete:plates', 'paving_stones', 'metal', 'wood') THEN 'paved'\n ELSE NULL\n END AS int_surface,\n CASE WHEN access IN ('destination') THEN 'destination'::text\n WHEN access IN ('no', 'private') THEN 'no'::text\n ELSE NULL\n END AS access,\n construction,\n CASE\n WHEN service IN ('parking_aisle', 'drive-through', 'driveway') THEN 'INT-minor'::text\n ELSE 'INT-normal'::text\n END AS service,\n CASE\n WHEN substr(highway, length(highway)-3, 4) = 'link' THEN 'yes'\n ELSE 'no'\n END AS link,\n CASE WHEN layer~E'^-?\\\\d+$' AND length(layer)<10 THEN layer::integer ELSE 0 END AS layernotnull\n FROM planet_osm_line\n WHERE (tunnel IS NULL OR NOT tunnel IN ('yes', 'building_passage'))\n AND (covered IS NULL OR NOT covered = 'yes')\n AND (bridge IS NULL OR NOT bridge IN ('yes', 'boardwalk', 'cantilever', 'covered', 'low_water_crossing', 'movable', 'trestle', 'viaduct'))\n AND highway IS NOT NULL -- end of road select\n UNION ALL\n SELECT\n way,\n COALESCE(\n ('railway_' || (CASE WHEN railway = 'preserved' AND service IN ('spur', 'siding', 'yard') THEN 'INT-preserved-ssy'::text \n WHEN (railway = 'rail' AND service IN ('spur', 'siding', 'yard')) THEN 'INT-spur-siding-yard' \n WHEN (railway = 'tram' AND service IN ('spur', 'siding', 'yard')) THEN 'tram-service' ELSE railway END)),\n ('aeroway_' || aeroway)\n ) AS feature,\n horse,\n foot,\n bicycle,\n tracktype,\n 'null' AS surface, -- Should be a SQL NULL?\n CASE\n WHEN access IN ('destination') THEN 'destination'::text\n WHEN access IN ('no', 'private') THEN 'no'::text\n ELSE NULL\n END AS access,\n construction,\n CASE WHEN service IN ('parking_aisle', 'drive-through', 'driveway') THEN 'INT-minor'::text ELSE 'INT-normal'::text END AS service,\n 'no' AS link,\n CASE WHEN layer~E'^-?\\\\d+$' AND length(layer)<10 THEN layer::integer ELSE 0 END AS layernotnull\n FROM planet_osm_line\n WHERE (tunnel IS NULL OR NOT tunnel IN ('yes', 'building_passage'))\n AND (covered IS NULL OR NOT covered = 'yes')\n AND (bridge IS NULL OR NOT bridge IN ('yes', 'boardwalk', 'cantilever', 'covered', 'low_water_crossing', 'movable', 'trestle', 'viaduct'))\n AND (railway IS NOT NULL OR aeroway IS NOT NULL) -- end of rail/aero select\n ) AS features\n JOIN (VALUES -- this join is also putting a condition on what is selected. features not matching it do not make it into the results.\n ('railway_rail', 440),\n ('railway_INT-preserved-ssy', 430),\n ('railway_INT-spur-siding-yard', 430),\n ('railway_subway', 420),\n ('railway_narrow_gauge', 420),\n ('railway_light_rail', 420),\n ('railway_preserved', 420),\n ('railway_funicular', 420),\n ('railway_monorail', 420),\n ('railway_miniature', 420),\n ('railway_turntable', 420),\n ('railway_tram', 410),\n ('railway_tram-service', 405),\n ('railway_disused', 400),\n ('railway_construction', 400),\n ('highway_motorway', 380),\n ('highway_trunk', 370),\n ('highway_primary', 360),\n ('highway_secondary', 350),\n ('highway_tertiary', 340),\n ('highway_residential', 330),\n ('highway_unclassified', 330),\n ('highway_road', 330),\n ('highway_living_street', 320),\n ('highway_pedestrian', 310),\n ('highway_raceway', 300),\n ('highway_motorway_link', 240),\n ('highway_trunk_link', 230),\n ('highway_primary_link', 220),\n ('highway_secondary_link', 210),\n ('highway_tertiary_link', 200),\n ('highway_service', 150),\n ('highway_track', 110),\n ('highway_path', 100),\n ('highway_footway', 100),\n ('highway_bridleway', 100),\n ('highway_cycleway', 100),\n ('highway_steps', 100),\n ('highway_platform', 90),\n ('railway_platform', 90),\n ('aeroway_runway', 60),\n ('aeroway_taxiway', 50),\n ('highway_construction', 10)\n ) AS ordertable (feature, prio)\n USING (feature)\n ORDER BY\n layernotnull,\n prio,\n CASE WHEN access IN ('no', 'private') THEN 0 WHEN access IN ('destination') THEN 1 ELSE 2 END,\n CASE WHEN int_surface IN ('unpaved') THEN 0 ELSE 2 END\n) AS roads_fill", + "table": "(SELECT\n way, COALESCE(historic, barrier) AS feature\n FROM (SELECT way,\n ('barrier_' || (CASE WHEN barrier IN ('chain', 'city_wall', 'embankment', 'ditch', 'fence', 'guard_rail',\n 'handrail', 'hedge', 'kerb', 'retaining_wall', 'wall') THEN barrier ELSE NULL END)) AS barrier,\n ('historic_' || (CASE WHEN historic = 'citywalls' THEN historic ELSE NULL END)) AS historic\n FROM planet_osm_line\n WHERE barrier IN ('chain', 'city_wall', 'embankment', 'ditch', 'fence', 'guard_rail',\n 'handrail', 'hedge', 'kerb', 'retaining_wall', 'wall')\n OR historic = 'city_wall'\n AND (waterway IS NULL OR waterway NOT IN ('river', 'canal', 'derelict_canal', 'stream', 'drain', 'ditch', 'wadi'))\n ) AS features\n) AS line_barriers", "geometry_field": "way", "type": "postgis", "key_field": "", @@ -861,20 +861,20 @@ 85.05112877980659 ], "properties": { - "minzoom": 10 + "minzoom": 14 }, "advanced": {} }, { - "name": "turning-circle-fill", + "name": "area-barriers", "srs-name": "900913", - "geometry": "point", - "class": "", - "id": "turning-circle-fill", + "geometry": "polygon", + "class": "barriers", + "id": "area-barriers", "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 DISTINCT on (p.way)\n p.way AS way, l.highway AS int_tc_type,\n CASE WHEN l.service IN ('parking_aisle', 'drive-through', 'driveway') THEN 'INT-minor'::text\n ELSE 'INT-normal'::text END AS int_tc_service\n FROM planet_osm_point p\n JOIN planet_osm_line l\n ON ST_DWithin(p.way, l.way, 0.1)\n JOIN (VALUES\n ('tertiary', 1),\n ('unclassified', 2),\n ('residential', 3),\n ('living_street', 4),\n ('service', 5),\n ('track', 6)\n ) AS v (highway, prio)\n ON v.highway=l.highway\n WHERE p.highway = 'turning_circle' OR p.highway = 'turning_loop'\n ORDER BY p.way, v.prio\n) AS turning_circle_fill", + "table": "(SELECT\n way, barrier AS feature\n FROM (SELECT way,\n ('barrier_' || barrier) AS barrier\n FROM planet_osm_polygon\n WHERE barrier IS NOT NULL\n ) AS features\n) AS area_barriers", "geometry_field": "way", "type": "postgis", "key_field": "", @@ -887,7 +887,7 @@ 85.05112877980659 ], "properties": { - "minzoom": 15 + "minzoom": 16 }, "advanced": {} }, diff --git a/project.yaml b/project.yaml index 29aa170535..974aa3bafd 100644 --- a/project.yaml +++ b/project.yaml @@ -653,30 +653,6 @@ Layer: properties: minzoom: 7 advanced: {} - - id: "line-barriers" - name: "line-barriers" - class: "barriers" - geometry: "linestring" - <<: *extents - Datasource: - <<: *osm2pgsql - table: |- - (SELECT - way, COALESCE(historic, barrier) AS feature - FROM (SELECT way, - ('barrier_' || (CASE WHEN barrier IN ('chain', 'city_wall', 'embankment', 'ditch', 'fence', 'guard_rail', - 'handrail', 'hedge', 'kerb', 'retaining_wall', 'wall') THEN barrier ELSE NULL END)) AS barrier, - ('historic_' || (CASE WHEN historic = 'citywalls' THEN historic ELSE NULL END)) AS historic - FROM planet_osm_line - WHERE barrier IN ('chain', 'city_wall', 'embankment', 'ditch', 'fence', 'guard_rail', - 'handrail', 'hedge', 'kerb', 'retaining_wall', 'wall') - OR historic = 'city_wall' - AND (waterway IS NULL OR waterway NOT IN ('river', 'canal', 'derelict_canal', 'stream', 'drain', 'ditch', 'wadi')) - ) AS features - ) AS line_barriers - properties: - minzoom: 14 - advanced: {} - id: "cliffs" name: "cliffs" class: "" @@ -693,25 +669,6 @@ Layer: properties: minzoom: 13 advanced: {} - - id: "area-barriers" - name: "area-barriers" - class: "barriers" - geometry: "polygon" - <<: *extents - Datasource: - <<: *osm2pgsql - table: |- - (SELECT - way, barrier AS feature - FROM (SELECT way, - ('barrier_' || barrier) AS barrier - FROM planet_osm_polygon - WHERE barrier IS NOT NULL - ) AS features - ) AS area_barriers - properties: - minzoom: 16 - advanced: {} - id: "ferry-routes" name: "ferry-routes" class: "" @@ -1118,6 +1075,49 @@ Layer: properties: minzoom: 15 advanced: {} + - id: "line-barriers" + name: "line-barriers" + class: "barriers" + geometry: "linestring" + <<: *extents + Datasource: + <<: *osm2pgsql + table: |- + (SELECT + way, COALESCE(historic, barrier) AS feature + FROM (SELECT way, + ('barrier_' || (CASE WHEN barrier IN ('chain', 'city_wall', 'embankment', 'ditch', 'fence', 'guard_rail', + 'handrail', 'hedge', 'kerb', 'retaining_wall', 'wall') THEN barrier ELSE NULL END)) AS barrier, + ('historic_' || (CASE WHEN historic = 'citywalls' THEN historic ELSE NULL END)) AS historic + FROM planet_osm_line + WHERE barrier IN ('chain', 'city_wall', 'embankment', 'ditch', 'fence', 'guard_rail', + 'handrail', 'hedge', 'kerb', 'retaining_wall', 'wall') + OR historic = 'city_wall' + AND (waterway IS NULL OR waterway NOT IN ('river', 'canal', 'derelict_canal', 'stream', 'drain', 'ditch', 'wadi')) + ) AS features + ) AS line_barriers + properties: + minzoom: 14 + advanced: {} + - id: "area-barriers" + name: "area-barriers" + class: "barriers" + geometry: "polygon" + <<: *extents + Datasource: + <<: *osm2pgsql + table: |- + (SELECT + way, barrier AS feature + FROM (SELECT way, + ('barrier_' || barrier) AS barrier + FROM planet_osm_polygon + WHERE barrier IS NOT NULL + ) AS features + ) AS area_barriers + properties: + minzoom: 16 + advanced: {} - id: "aerialways" name: "aerialways" class: ""