From 810448b808ef2dbec7d583bc2e31721bac16b12b Mon Sep 17 00:00:00 2001 From: jeisenbe Date: Wed, 16 Jan 2019 19:38:43 +0900 Subject: [PATCH 1/3] Add "construction=" values to z-order table so highway=construction layers properly This change is in openstreetmap-carto.lua, so it will take effect for new features and after database reload --- openstreetmap-carto.lua | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/openstreetmap-carto.lua b/openstreetmap-carto.lua index 151a7b09be..d1435a589c 100644 --- a/openstreetmap-carto.lua +++ b/openstreetmap-carto.lua @@ -204,7 +204,32 @@ local roads_info = { cycleway = {z = 100, roads = false}, steps = {z = 90, roads = false}, platform = {z = 90, roads = false}, - construction = {z = 10, roads = false} + construction = {z = 33, roads = false} + }, + construction = { + motorway = {z = 38, roads = false}, + trunk = {z = 37, roads = false}, + primary = {z = 36, roads = false}, + secondary = {z = 35, roads = false}, + tertiary = {z = 34, roads = false}, + residential = {z = 33, roads = false}, + unclassified = {z = 33, roads = false}, + road = {z = 33, roads = false}, + living_street = {z = 32, roads = false}, + pedestrian = {z = 31, roads = false}, + raceway = {z = 30, roads = false}, + motorway_link = {z = 24, roads = false}, + trunk_link = {z = 23, roads = false}, + primary_link = {z = 22, roads = false}, + secondary_link = {z = 21, roads = false}, + tertiary_link = {z = 20, roads = false}, + service = {z = 15, roads = false}, + track = {z = 11, roads = false}, + path = {z = 10, roads = false}, + footway = {z = 10, roads = false}, + bridleway = {z = 10, roads = false}, + cycleway = {z = 10, roads = false}, + steps = {z = 9, roads = false}, }, railway = { rail = {z = 440, roads = true}, From 363b7ef45c9ace5b999c52d7dcc54003b033043a Mon Sep 17 00:00:00 2001 From: jeisenbe Date: Wed, 16 Jan 2019 20:15:59 +0900 Subject: [PATCH 2/3] Order roads-fill by osm_id last, when all else is equal This will cause roads to layer consistently between different zoom level, though this will only be visible for highway=construction Also adjust uncategorized construciton z-order and modify z-order for minor highways --- openstreetmap-carto.lua | 12 ++++++------ project.mml | 5 ++++- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/openstreetmap-carto.lua b/openstreetmap-carto.lua index d1435a589c..a4caca1b7a 100644 --- a/openstreetmap-carto.lua +++ b/openstreetmap-carto.lua @@ -204,7 +204,7 @@ local roads_info = { cycleway = {z = 100, roads = false}, steps = {z = 90, roads = false}, platform = {z = 90, roads = false}, - construction = {z = 33, roads = false} + construction = {z = 31, roads = false} }, construction = { motorway = {z = 38, roads = false}, @@ -212,12 +212,12 @@ local roads_info = { primary = {z = 36, roads = false}, secondary = {z = 35, roads = false}, tertiary = {z = 34, roads = false}, - residential = {z = 33, roads = false}, unclassified = {z = 33, roads = false}, - road = {z = 33, roads = false}, - living_street = {z = 32, roads = false}, - pedestrian = {z = 31, roads = false}, - raceway = {z = 30, roads = false}, + residential = {z = 32, roads = false}, + road = {z = 31, roads = false}, + living_street = {z = 30, roads = false}, + pedestrian = {z = 29, roads = false}, + raceway = {z = 28, roads = false}, motorway_link = {z = 24, roads = false}, trunk_link = {z = 23, roads = false}, primary_link = {z = 22, roads = false}, diff --git a/project.mml b/project.mml index 344d861980..4627eb548d 100644 --- a/project.mml +++ b/project.mml @@ -869,6 +869,7 @@ Layer: ELSE 'no' END AS link, COALESCE(layer,0) AS layernotnull, + osm_id, z_order FROM planet_osm_line WHERE (tunnel IS NULL OR NOT tunnel IN ('yes', 'building_passage')) @@ -897,6 +898,7 @@ Layer: ELSE 'INT-normal'::text END AS service, 'no' AS link, COALESCE(layer,0) AS layernotnull, + osm_id, z_order FROM planet_osm_line WHERE (tunnel IS NULL OR NOT tunnel IN ('yes', 'building_passage')) @@ -910,7 +912,8 @@ Layer: CASE WHEN substring(feature for 8) = 'railway_' THEN 2 ELSE 1 END, CASE WHEN feature IN ('railway_INT-preserved-ssy', 'railway_INT-spur-siding-yard', 'railway_tram-service') THEN 0 ELSE 1 END, CASE WHEN access IN ('no', 'private') THEN 0 WHEN access IN ('destination') THEN 1 ELSE 2 END, - CASE WHEN int_surface IN ('unpaved') THEN 0 ELSE 2 END + CASE WHEN int_surface IN ('unpaved') THEN 0 ELSE 2 END, + osm_id ) AS roads_fill properties: minzoom: 10 From ba170982a8be1d2daa31f3a7c0fff915de807d37 Mon Sep 17 00:00:00 2001 From: jeisenbe Date: Fri, 18 Jan 2019 00:09:43 +0900 Subject: [PATCH 3/3] Remove construction types from z-order lua table Pending database reload, we cannot yet make changes to the openstreetmap-carto.lua file --- openstreetmap-carto.lua | 27 +-------------------------- 1 file changed, 1 insertion(+), 26 deletions(-) diff --git a/openstreetmap-carto.lua b/openstreetmap-carto.lua index a4caca1b7a..151a7b09be 100644 --- a/openstreetmap-carto.lua +++ b/openstreetmap-carto.lua @@ -204,32 +204,7 @@ local roads_info = { cycleway = {z = 100, roads = false}, steps = {z = 90, roads = false}, platform = {z = 90, roads = false}, - construction = {z = 31, roads = false} - }, - construction = { - motorway = {z = 38, roads = false}, - trunk = {z = 37, roads = false}, - primary = {z = 36, roads = false}, - secondary = {z = 35, roads = false}, - tertiary = {z = 34, roads = false}, - unclassified = {z = 33, roads = false}, - residential = {z = 32, roads = false}, - road = {z = 31, roads = false}, - living_street = {z = 30, roads = false}, - pedestrian = {z = 29, roads = false}, - raceway = {z = 28, roads = false}, - motorway_link = {z = 24, roads = false}, - trunk_link = {z = 23, roads = false}, - primary_link = {z = 22, roads = false}, - secondary_link = {z = 21, roads = false}, - tertiary_link = {z = 20, roads = false}, - service = {z = 15, roads = false}, - track = {z = 11, roads = false}, - path = {z = 10, roads = false}, - footway = {z = 10, roads = false}, - bridleway = {z = 10, roads = false}, - cycleway = {z = 10, roads = false}, - steps = {z = 9, roads = false}, + construction = {z = 10, roads = false} }, railway = { rail = {z = 440, roads = true},