From 110235977d1b0c8f9329cba1363f7e08332839aa Mon Sep 17 00:00:00 2001 From: Math1985 Date: Thu, 12 Jun 2014 13:49:44 +0100 Subject: [PATCH] Move control over road rendering order to SQL Currently, rendering order of road rendering within one layer is handled by the z_order column, which comes from osm2pgsql. As such, we have little control over road rendering without reloading the database. This PR moves control over the rendering order to the SQL query. This adds complexity to the SQL queries, but increases customizability, and simplifies the roads.mms code. This solves the following issues: * #462 (Move rendering order road types from osm2pgsql to our SQL queries) * #163 (Railways are now drawn above roads) * #167 (Tramway layering issues) * #168 (Paths are now drawn below link roads) * Trac 2024 (Service roads are now rendered below link roads) * Trac 3649 (Service roads are now rendered below race tracks) * Pedestrian and living streets are now consistently ordered * Footways are now always displayed under service ways --- project.mml | 31 +---- roads.mss | 378 ++++++++++++---------------------------------------- 2 files changed, 88 insertions(+), 321 deletions(-) diff --git a/project.mml b/project.mml index 4dfa46dcab..19380428d8 100644 --- a/project.mml +++ b/project.mml @@ -443,7 +443,7 @@ ], "Datasource": { "type": "postgis", - "table": "(select way,coalesce(('highway_' || highway), ('railway_' ||(case when railway='preserved' and service in ('spur','siding','yard') then 'INT-preserved-ssy'::text when (railway='rail' and service in ('spur','siding','yard')) then 'INT-spur-siding-yard' when railway in ('light_rail', 'narrow_gauge', 'funicular', 'rail', 'subway', 'tram', 'spur', 'siding', 'monorail', 'platform', 'preserved', 'disused', 'construction', 'miniature', 'turntable') then railway else null end)), ('aeroway_' || aeroway)) as feature, horse, foot, bicycle, tracktype, case when access in ('destination') then 'destination'::text when access in ('no', 'private') then 'no'::text else null end as access, construction, case when service in ('parking_aisle','drive-through','driveway') then 'INT-minor'::text else 'INT-normal'::text end as service, case when oneway in ('yes', '-1') and highway in ('motorway','motorway_link','trunk','trunk_link','primary','primary_link','secondary','secondary_link','tertiary','tertiary_link','residential','unclassified','road','service','pedestrian','raceway','living_street','construction') then oneway else null end as oneway, case when layer is null then '0' else layer end as layernotnull from planet_osm_line where (highway in ('motorway', 'motorway_link', 'trunk', 'trunk_link', 'primary', 'primary_link', 'secondary', 'secondary_link', 'tertiary', 'tertiary_link', 'residential', 'road', 'unclassified', 'service', 'pedestrian', 'living_street', 'raceway', 'bridleway', 'footway', 'cycleway', 'path', 'track', 'steps', 'platform', 'proposed', 'construction') or aeroway in ('runway','taxiway') or railway in ('light_rail', 'subway', 'narrow_gauge', 'rail', 'spur', 'siding', 'preserved', 'funicular', 'tram', 'monorail', 'platform', 'miniature', 'turntable', 'disused', 'construction')) and (tunnel='yes' or tunnel='building_passage' or covered='yes') order by layernotnull, z_order) as tunnels", + "table": "(select way,coalesce(('highway_' || (case when substr(highway, length(highway)-3, 4) = 'link' then substr(highway,0,length(highway)-4) else highway end)), ('railway_' ||(case when railway='preserved' and service in ('spur','siding','yard') then 'INT-preserved-ssy'::text when (railway='rail' and service in ('spur','siding','yard')) then 'INT-spur-siding-yard' else railway end)), ('aeroway_' || aeroway)) as feature, horse, foot, bicycle, tracktype, case when access in ('destination') then 'destination'::text when access in ('no', 'private') then 'no'::text else null end as access, construction, case when service in ('parking_aisle','drive-through','driveway') then 'INT-minor'::text else 'INT-normal'::text end as service, case when oneway in ('yes', '-1') and highway in ('motorway','motorway_link','trunk','trunk_link','primary','primary_link','secondary','secondary_link','tertiary','tertiary_link','residential','unclassified','road','service','pedestrian','raceway','living_street','construction') then oneway else null end as oneway, case when substr(highway, length(highway)-3, 4) = 'link' then 'yes' else 'no' end as link, case when layer is null then '0' else layer end as layernotnull from planet_osm_line join (values ('railway_rail',430), ('railway_spur',430), ('railway_siding',430), ('railway_subway',420), ('railway_narrow_gauge',420), ('railway_light_rail',420), ('railway_preserved',420), ('railway_funicular',420), ('railway_monorail',420), ('railway_miniature',420), ('railway_turntable',420), ('railway_tram',410), ('railway_disused',400), ('railway_construction',400), ('highway_motorway',370), ('highway_trunk',360), ('highway_primary',350), ('highway_secondary',340), ('highway_tertiary',340), ('highway_residential',330), ('highway_unclassified',330), ('highway_road',330), ('highway_living_street',320), ('highway_pedestrian',310), ('highway_raceway',300), ('highway_motorway_link',240), ('highway_trunk_link',230), ('highway_primary_link',220), ('highway_secondary_link',210), ('highway_tertiary_link',200), ('highway_service',150), ('highway_track',110), ('highway_path',100), ('highway_footway',100), ('highway_bridleway',100), ('highway_cycleway',100), ('highway_steps',100), ('railway_platform',100), ('aeroway_runway',60), ('aeroway_taxiway',50), ('highway_proposed',20), ('highway_construction',10)) as ordertable (feature, prio) on coalesce(('highway_' || planet_osm_line.highway), ('railway_' || planet_osm_line.railway), ('aeroway_' || planet_osm_line.aeroway)) = ordertable.feature where (tunnel='yes' or tunnel='building_passage' or covered='yes') order by layernotnull, ordertable.prio) as tunnels", "extent": "-20037508,-20037508,20037508,20037508", "key_field": "", "geometry_field": "way", @@ -722,7 +722,7 @@ ], "Datasource": { "type": "postgis", - "table": " (select way,coalesce(('highway_' || highway), ('railway_' ||(case when railway='preserved' and service in ('spur','siding','yard') then 'INT-preserved-ssy'::text when (railway='rail' and service in ('spur','siding','yard')) then 'INT-spur-siding-yard' when railway in ('light_rail', 'narrow_gauge', 'funicular', 'rail', 'subway', 'tram', 'spur', 'siding', 'monorail', 'platform', 'preserved', 'disused', 'construction', 'miniature', 'turntable') then railway else null end)), ('aeroway_' || aeroway)) as feature, horse, foot, bicycle, tracktype, case when access in ('destination') then 'destination'::text when access in ('no', 'private') then 'no'::text else null end as access, construction, case when service in ('parking_aisle','drive-through','driveway') then 'INT-minor'::text else 'INT-normal'::text end as service, case when oneway in ('yes', '-1') and highway in ('motorway','motorway_link','trunk','trunk_link','primary','primary_link','secondary','secondary_link','tertiary','tertiary_link','residential','unclassified','road','service','pedestrian','raceway','living_street','construction') then oneway else null end as oneway, case when layer is null then '0' else layer end as layernotnull from planet_osm_line where (highway in ('motorway', 'motorway_link', 'trunk', 'trunk_link', 'primary', 'primary_link', 'secondary', 'secondary_link', 'tertiary', 'tertiary_link', 'residential', 'road', 'unclassified', 'service', 'pedestrian', 'living_street', 'raceway', 'bridleway', 'footway', 'cycleway', 'path', 'track', 'steps', 'platform', 'proposed', 'construction') or aeroway in ('runway','taxiway') or railway in ('light_rail', 'subway', 'narrow_gauge', 'rail', 'spur', 'siding', 'preserved', 'funicular', 'tram', 'monorail', 'platform', 'miniature', 'turntable', 'disused', 'construction')) and (tunnel is null or not tunnel in ('yes','building_passage')) and (covered is null or not covered='yes') and (bridge is null or not bridge in ('yes','true','1','viaduct')) order by z_order) as roads", + "table": "(select way,coalesce(('highway_' || (case when substr(highway, length(highway)-3, 4) = 'link' then substr(highway,0,length(highway)-4) else highway end)), ('railway_' ||(case when railway='preserved' and service in ('spur','siding','yard') then 'INT-preserved-ssy'::text when (railway='rail' and service in ('spur','siding','yard')) then 'INT-spur-siding-yard' else railway end)), ('aeroway_' || aeroway)) as feature, horse, foot, bicycle, tracktype, case when access in ('destination') then 'destination'::text when access in ('no', 'private') then 'no'::text else null end as access, construction, case when service in ('parking_aisle','drive-through','driveway') then 'INT-minor'::text else 'INT-normal'::text end as service, case when oneway in ('yes', '-1') and highway in ('motorway','motorway_link','trunk','trunk_link','primary','primary_link','secondary','secondary_link','tertiary','tertiary_link','residential','unclassified','road','service','pedestrian','raceway','living_street','construction') then oneway else null end as oneway, case when substr(highway, length(highway)-3, 4) = 'link' then 'yes' else 'no' end as link, case when layer is null then '0' else layer end as layernotnull from planet_osm_line join ( values ('railway_rail',430), ('railway_spur',430), ('railway_siding',430), ('railway_subway',420), ('railway_narrow_gauge',420), ('railway_light_rail',420), ('railway_preserved',420), ('railway_funicular',420), ('railway_monorail',420), ('railway_miniature',420), ('railway_turntable',420), ('railway_tram',410), ('railway_disused',400), ('railway_construction',400), ('highway_motorway',370), ('highway_trunk',360), ('highway_primary',350), ('highway_secondary',340), ('highway_tertiary',340), ('highway_residential',330), ('highway_unclassified',330), ('highway_road',330), ('highway_living_street',320), ('highway_pedestrian',310), ('highway_raceway',300), ('highway_motorway_link',240), ('highway_trunk_link',230), ('highway_primary_link',220), ('highway_secondary_link',210), ('highway_tertiary_link',200), ('highway_service',150), ('highway_track',110), ('highway_path',100), ('highway_footway',100), ('highway_bridleway',100), ('highway_cycleway',100), ('highway_steps',100), ('railway_platform',100), ('aeroway_runway',60), ('aeroway_taxiway',50), ('highway_proposed',20), ('highway_construction',10)) as ordertable (feature, prio) on coalesce(('highway_' || planet_osm_line.highway), ('railway_' || planet_osm_line.railway), ('aeroway_' || planet_osm_line.aeroway)) = ordertable.feature where (tunnel is null or not tunnel in ('yes','building_passage')) and (covered is null or not covered='yes') and (bridge is null or not bridge in ('yes','true','1','viaduct')) order by ordertable.prio) as roads", "extent": "-20037508,-20037508,20037508,20037508", "key_field": "", "geometry_field": "way", @@ -767,7 +767,7 @@ ], "Datasource": { "type": "postgis", - "table": " (select way,coalesce(('highway_' || highway), ('railway_' ||(case when railway='preserved' and service in ('spur','siding','yard') then 'INT-preserved-ssy'::text when (railway='rail' and service in ('spur','siding','yard')) then 'INT-spur-siding-yard' when railway in ('light_rail', 'narrow_gauge', 'funicular', 'rail', 'subway', 'tram', 'spur', 'siding', 'monorail', 'platform', 'preserved', 'disused', 'construction', 'miniature', 'turntable') then railway else null end)), ('aeroway_' || aeroway)) as feature, horse, foot, bicycle, tracktype, case when access in ('destination') then 'destination'::text when access in ('no', 'private') then 'no'::text else null end as access, construction, case when service in ('parking_aisle','drive-through','driveway') then 'INT-minor'::text else 'INT-normal'::text end as service, case when oneway in ('yes', '-1') and highway in ('motorway','motorway_link','trunk','trunk_link','primary','primary_link','secondary','secondary_link','tertiary','tertiary_link','residential','unclassified','road','service','pedestrian','raceway','living_street','construction') then oneway else null end as oneway, case when layer is null then '0' else layer end as layernotnull from planet_osm_line where (highway in ('motorway', 'motorway_link', 'trunk', 'trunk_link', 'primary', 'primary_link', 'secondary', 'secondary_link', 'tertiary', 'tertiary_link', 'residential', 'road', 'unclassified', 'service', 'pedestrian', 'living_street', 'raceway', 'bridleway', 'footway', 'cycleway', 'path', 'track', 'steps', 'platform', 'proposed', 'construction') or aeroway in ('runway','taxiway') or railway in ('light_rail', 'subway', 'narrow_gauge', 'rail', 'spur', 'siding', 'preserved', 'funicular', 'tram', 'monorail', 'platform', 'miniature', 'turntable', 'disused', 'construction')) and (tunnel is null or not tunnel in ('yes','building_passage')) and (covered is null or not covered='yes') and (bridge is null or not bridge in ('yes','true','1','viaduct')) order by z_order) as roads_fill", + "table": "(select way,coalesce(('highway_' || (case when substr(highway, length(highway)-3, 4) = 'link' then substr(highway,0,length(highway)-4) else highway end)), ('railway_' ||(case when railway='preserved' and service in ('spur','siding','yard') then 'INT-preserved-ssy'::text when (railway='rail' and service in ('spur','siding','yard')) then 'INT-spur-siding-yard' else railway end)), ('aeroway_' || aeroway)) as feature, horse, foot, bicycle, tracktype, case when access in ('destination') then 'destination'::text when access in ('no', 'private') then 'no'::text else null end as access, construction, case when service in ('parking_aisle','drive-through','driveway') then 'INT-minor'::text else 'INT-normal'::text end as service, case when oneway in ('yes', '-1') and highway in ('motorway','motorway_link','trunk','trunk_link','primary','primary_link','secondary','secondary_link','tertiary','tertiary_link','residential','unclassified','road','service','pedestrian','raceway','living_street','construction') then oneway else null end as oneway, case when substr(highway, length(highway)-3, 4) = 'link' then 'yes' else 'no' end as link, case when layer is null then '0' else layer end as layernotnull from planet_osm_line join ( values ('railway_rail',430), ('railway_spur',430), ('railway_siding',430), ('railway_subway',420), ('railway_narrow_gauge',420), ('railway_light_rail',420), ('railway_preserved',420), ('railway_funicular',420), ('railway_monorail',420), ('railway_miniature',420), ('railway_turntable',420), ('railway_tram',410), ('railway_disused',400), ('railway_construction',400), ('highway_motorway',370), ('highway_trunk',360), ('highway_primary',350), ('highway_secondary',340), ('highway_tertiary',340), ('highway_residential',330), ('highway_unclassified',330), ('highway_road',330), ('highway_living_street',320), ('highway_pedestrian',310), ('highway_raceway',300), ('highway_motorway_link',240), ('highway_trunk_link',230), ('highway_primary_link',220), ('highway_secondary_link',210), ('highway_tertiary_link',200), ('highway_service',150), ('highway_track',110), ('highway_path',100), ('highway_footway',100), ('highway_bridleway',100), ('highway_cycleway',100), ('highway_steps',100), ('railway_platform',100), ('aeroway_runway',60), ('aeroway_taxiway',50), ('highway_proposed',20), ('highway_construction',10)) as ordertable (feature, prio) on coalesce(('highway_' || planet_osm_line.highway), ('railway_' || planet_osm_line.railway), ('aeroway_' || planet_osm_line.aeroway)) = ordertable.feature where (tunnel is null or not tunnel in ('yes','building_passage')) and (covered is null or not covered='yes') and (bridge is null or not bridge in ('yes','true','1','viaduct')) order by ordertable.prio) as roads_fill", "extent": "-20037508,-20037508,20037508,20037508", "key_field": "", "geometry_field": "way", @@ -882,7 +882,7 @@ ], "Datasource": { "type": "postgis", - "table": "(select way,coalesce(('highway_' || highway), ('railway_' ||(case when railway='preserved' and service in ('spur','siding','yard') then 'INT-preserved-ssy'::text when (railway='rail' and service in ('spur','siding','yard')) then 'INT-spur-siding-yard' when railway in ('light_rail', 'narrow_gauge', 'funicular', 'rail', 'subway', 'tram', 'spur', 'siding', 'monorail', 'platform', 'preserved', 'disused', 'construction', 'miniature', 'turntable') then railway else null end)), ('aeroway_' || aeroway)) as feature, horse, foot, bicycle, tracktype, case when access in ('destination') then 'destination'::text when access in ('no', 'private') then 'no'::text else null end as access, construction, case when service in ('parking_aisle','drive-through','driveway') then 'INT-minor'::text else 'INT-normal'::text end as service, case when oneway in ('yes', '-1') and highway in ('motorway','motorway_link','trunk','trunk_link','primary','primary_link','secondary','secondary_link','tertiary','tertiary_link','residential','unclassified','road','service','pedestrian','raceway','living_street','construction') then oneway else null end as oneway, case when layer is null then '0' else layer end as layernotnull from planet_osm_line where (highway in ('motorway', 'motorway_link', 'trunk', 'trunk_link', 'primary', 'primary_link', 'secondary', 'secondary_link', 'tertiary', 'tertiary_link', 'residential', 'road', 'unclassified', 'service', 'pedestrian', 'living_street', 'raceway', 'bridleway', 'footway', 'cycleway', 'path', 'track', 'steps', 'platform', 'proposed', 'construction') or aeroway in ('runway','taxiway') or railway in ('light_rail', 'subway', 'narrow_gauge', 'rail', 'spur', 'siding', 'preserved', 'funicular', 'tram', 'monorail', 'platform', 'miniature', 'turntable', 'disused', 'construction')) and bridge in ('yes','true','1','viaduct') and (layer is null or (layer in ('0','1','2','3','4','5'))) order by layernotnull, z_order) as bridges", + "table": "(select way,coalesce(('highway_' || (case when substr(highway, length(highway)-3, 4) = 'link' then substr(highway,0,length(highway)-4) else highway end)), ('railway_' ||(case when railway='preserved' and service in ('spur','siding','yard') then 'INT-preserved-ssy'::text when (railway='rail' and service in ('spur','siding','yard')) then 'INT-spur-siding-yard' else railway end)), ('aeroway_' || aeroway)) as feature, horse, foot, bicycle, tracktype, case when access in ('destination') then 'destination'::text when access in ('no', 'private') then 'no'::text else null end as access, construction, case when service in ('parking_aisle','drive-through','driveway') then 'INT-minor'::text else 'INT-normal'::text end as service, case when oneway in ('yes', '-1') and highway in ('motorway','motorway_link','trunk','trunk_link','primary','primary_link','secondary','secondary_link','tertiary','tertiary_link','residential','unclassified','road','service','pedestrian','raceway','living_street','construction') then oneway else null end as oneway, case when substr(highway, length(highway)-3, 4) = 'link' then 'yes' else 'no' end as link, case when layer is null then '0' else layer end as layernotnull from planet_osm_line join ( values ('railway_rail',430), ('railway_spur',430), ('railway_siding',430), ('railway_subway',420), ('railway_narrow_gauge',420), ('railway_light_rail',420), ('railway_preserved',420), ('railway_funicular',420), ('railway_monorail',420), ('railway_miniature',420), ('railway_turntable',420), ('railway_tram',410), ('railway_disused',400), ('railway_construction',400), ('highway_motorway',370), ('highway_trunk',360), ('highway_primary',350), ('highway_secondary',340), ('highway_tertiary',340), ('highway_residential',330), ('highway_unclassified',330), ('highway_road',330), ('highway_living_street',320), ('highway_pedestrian',310), ('highway_raceway',300), ('highway_motorway_link',240), ('highway_trunk_link',230), ('highway_primary_link',220), ('highway_secondary_link',210), ('highway_tertiary_link',200), ('highway_service',150), ('highway_track',110), ('highway_path',100), ('highway_footway',100), ('highway_bridleway',100), ('highway_cycleway',100), ('highway_steps',100), ('railway_platform',100), ('aeroway_runway',60), ('aeroway_taxiway',50), ('highway_proposed',20), ('highway_construction',10)) as ordertable (feature, prio) on coalesce(('highway_' || planet_osm_line.highway), ('railway_' || planet_osm_line.railway), ('aeroway_' || planet_osm_line.aeroway)) = ordertable.feature where bridge in ('yes','true','1','viaduct') and (layer is null or (layer in ('0','1','2','3','4','5'))) order by layernotnull, ordertable.prio) as bridges", "extent": "-20037508,-20037508,20037508,20037508", "key_field": "", "geometry_field": "way", @@ -898,29 +898,6 @@ "group-by": "layernotnull" } }, - { - "geometry": "linestring", - "extent": [ - -179.99999692067183, - -85.05112877980659, - 179.99999692067183, - 85.05112877980659 - ], - "Datasource": { - "type": "postgis", - "table": "(select way,railway,bridge from planet_osm_line where railway='tram' and (tunnel is null or tunnel != 'yes')) as trams", - "extent": "-20037508,-20037508,20037508,20037508", - "key_field": "", - "geometry_field": "way", - "dbname": "gis" - }, - "id": "trams", - "class": "", - "srs-name": "900913", - "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", - "advanced": {}, - "name": "trams" - }, { "geometry": "linestring", "extent": [ diff --git a/roads.mss b/roads.mss index d1488724ac..2f36aa8871 100644 --- a/roads.mss +++ b/roads.mss @@ -132,134 +132,20 @@ @paths-tunnel-casing-width: 1; .roads-casing, .bridges-casing, .tunnels-casing { - ::casing_links { - [feature = 'highway_raceway'] { - [zoom >= 12] { - line-color: pink; - line-width: 1.2; - line-join: round; - line-cap: round; - } - [zoom >= 13] { line-width: 4; } - [zoom >= 15] { line-width: 7; } - } - - [feature = 'highway_motorway_link'] { - [zoom >= 12] { - line-color: @motorway-casing; - line-width: @motorway-link-width-z12; - [zoom >= 13] { line-width: @motorway-link-width-z13; } - [zoom >= 15] { line-width: @motorway-link-width-z15; } - [zoom >= 17] { line-width: @motorway-link-width-z17; } - .roads-casing { - line-join: round; - } - .tunnels-casing { - line-dasharray: 4,2; - } - .bridges-casing { - line-join: round; - [zoom >= 13] { line-color: @bridge-casing; } - } - } - } - - [feature = 'highway_trunk_link'] { - [zoom >= 12] { - line-width: @trunk-width-z12; - [zoom >= 13] { line-width: @trunk-width-z13; } - [zoom >= 15] { line-width: @trunk-width-z15; } - [zoom >= 17] { line-width: @trunk-width-z17; } - line-color: @trunk-casing; - .roads-casing { - line-join: round; - line-cap: round; - } - .tunnels-casing { - line-dasharray: 4,2; - } - .bridges-casing { - line-join: round; - [zoom >= 13] { line-color: @bridge-casing; } - } - } - } - - [feature = 'highway_primary_link'] { - [zoom >= 12] { - line-color: @primary-casing; - line-width: @primary-width-z12; - [zoom >= 13] { line-width: @primary-width-z13; } - [zoom >= 15] { line-width: @primary-width-z15; } - [zoom >= 17] { line-width: @primary-width-z17; } - .roads-casing { - line-join: round; - line-cap: round; - } - .tunnels-casing { - line-dasharray: 4,2; - } - .bridges-casing { - line-join: round; - [zoom >= 13] { line-color: @bridge-casing; } - } - } - } - - [feature = 'highway_secondary_link'] { - [zoom >= 12] { - line-color: @secondary-casing; - line-width: @secondary-width-z12; - [zoom >= 13] { line-width: @secondary-width-z13; } - [zoom >= 15] { line-width: @secondary-width-z15; } - [zoom >= 17] { line-width: @secondary-width-z17; } - .roads-casing { - line-cap: round; - line-join: round; - } - .tunnels-casing { - line-dasharray: 4,2; - } - .bridges-casing { - [zoom >= 13] { - line-color: @bridge-casing; - line-join: round; - } - } - } - } - - [feature = 'highway_tertiary_link'] { - [zoom >= 13] { - line-color: @tertiary-casing; - line-width: @tertiary-width-z13; - [zoom >= 14] { line-width: @tertiary-width-z14; } - [zoom >= 15] { line-width: @tertiary-width-z15; } - [zoom >= 17] { line-width: @tertiary-width-z17; } - .roads-casing { - line-cap: round; - line-join: round; - } - .tunnels-casing { - line-dasharray: 4,2; - } - .bridges-casing { - [zoom >= 14] { - line-color: @bridge-casing; - line-join: round; - } - } - } - } - } - ::casing { [zoom >= 12] { + [feature = 'highway_motorway_link'], [feature = 'highway_motorway'] { line-width: @motorway-width-z12; [zoom >= 13] { line-width: @motorway-width-z13; } [zoom >= 15] { line-width: @motorway-width-z15; } [zoom >= 17] { line-width: @motorway-width-z17; } + [link = 'yes'] { + line-width: @motorway-link-width-z12; + [zoom >= 13] { line-width: @motorway-link-width-z13; } + [zoom >= 15] { line-width: @motorway-link-width-z15; } + [zoom >= 17] { line-width: @motorway-link-width-z17; } + } line-color: @motorway-casing; .roads-casing { line-join: round; @@ -275,6 +161,7 @@ } } + [feature = 'highway_trunk_link'], [feature = 'highway_trunk'] { [zoom >= 12] { line-color: @trunk-casing; @@ -296,6 +183,7 @@ } } + [feature = 'highway_primary_link'], [feature = 'highway_primary'] { [zoom >= 12] { line-color: @primary-casing; @@ -317,6 +205,7 @@ } } + [feature = 'highway_secondary_link'], [feature = 'highway_secondary'] { [zoom >= 12] { line-color: @secondary-casing; @@ -340,6 +229,7 @@ } } + [feature = 'highway_tertiary_link'], [feature = 'highway_tertiary'] { [zoom >= 13] { line-color: @tertiary-casing; @@ -552,10 +442,34 @@ } } + [feature = 'highway_raceway'] { + [zoom >= 12] { + line-color: pink; + line-width: 1.2; + line-join: round; + line-cap: round; + } + [zoom >= 13] { line-width: 4; } + [zoom >= 15] { line-width: 7; } + } + + [feature = 'railway_tram'] { + .bridges-casing { + [zoom >= 13] { + line-width: 4; + [zoom >= 15] { + line-width: 5; + } + line-color: black; + line-join: round; + } + } + } + [feature = 'railway_subway'] { .bridges-casing { [zoom >= 14] { - line-width: 5.5; + line-width: 5; line-color: black; line-join: round; } @@ -754,6 +668,18 @@ } } + [feature = 'railway_tram'] { + .bridges-casing { + [zoom >= 13] { + line-width: 3; + [zoom >= 15] { + line-width: 4; + } + line-color: white; + } + } + } + [feature = 'railway_subway'] { .bridges-casing { [zoom >= 14] { @@ -779,125 +705,7 @@ } .roads-fill,.bridges-fill,.tunnels-fill { - ::fill_links { - [feature = 'highway_motorway_link'] { - [zoom >= 12] { - line-width: @motorway-link-width-z12 - 2 * @casing-width-z12; - [zoom >= 13] { line-width: @motorway-link-width-z13 - 2 * @casing-width-z13; } - [zoom >= 15] { line-width: @motorway-link-width-z15 - 2 * @casing-width-z15; } - [zoom >= 17] { line-width: @motorway-link-width-z17 - 2 * @casing-width-z17; } - .roads-fill, .bridges-fill { - line-color: @motorway-fill; - } - .tunnels-fill { - line-color: @motorway-tunnel-fill; - } - .bridges-fill { - line-width: @motorway-link-width-z12 - 2 * @bridge-casing-width-z12; - [zoom >= 13] { line-width: @motorway-link-width-z13 - 2 * @bridge-casing-width-z13; } - [zoom >= 15] { line-width: @motorway-link-width-z15 - 2 * @bridge-casing-width-z15; } - [zoom >= 17] { line-width: @motorway-link-width-z17 - 2 * @bridge-casing-width-z17; } - } - line-cap: round; - line-join: round; - } - } - - [feature = 'highway_trunk_link'] { - [zoom >= 12] { - line-width: @trunk-width-z12 - 2 * @casing-width-z12; - [zoom >= 13] { line-width: @trunk-width-z13 - 2 * @casing-width-z13; } - [zoom >= 15] { line-width: @trunk-width-z15 - 2 * @casing-width-z15; } - [zoom >= 17] { line-width: @trunk-width-z17 - 2 * @casing-width-z17; } - .roads-fill, .bridges-fill { - line-color: @trunk-fill; - } - .tunnels-fill { - line-color: @trunk-tunnel-fill; - } - .bridges-fill { - line-width: @trunk-width-z12 - 2 * @bridge-casing-width-z12; - [zoom >= 13] { line-width: @trunk-width-z13 - 2 * @bridge-casing-width-z13; } - [zoom >= 15] { line-width: @trunk-width-z15 - 2 * @bridge-casing-width-z15; } - [zoom >= 17] { line-width: @trunk-width-z17 - 2 * @bridge-casing-width-z17; } - } - line-cap: round; - line-join: round; - } - } - - [feature = 'highway_primary_link'] { - [zoom >= 12] { - line-width: @primary-width-z12 - 2 * @casing-width-z12; - [zoom >= 13] { line-width: @primary-width-z13 - 2 * @casing-width-z13; } - [zoom >= 15] { line-width: @primary-width-z15 - 2 * @casing-width-z15; } - [zoom >= 17] { line-width: @primary-width-z17 - 2 * @casing-width-z17; } - .roads-fill, .bridges-fill { - line-color: @primary-fill; - } - .tunnels-fill { - line-color: @primary-tunnel-fill; - } - .bridges-fill { - line-width: @primary-width-z12 - 2 * @bridge-casing-width-z12; - [zoom >= 13] { line-width: @primary-width-z13 - 2 * @bridge-casing-width-z13; } - [zoom >= 15] { line-width: @primary-width-z15 - 2 * @bridge-casing-width-z15; } - [zoom >= 17] { line-width: @primary-width-z17 - 2 * @bridge-casing-width-z17; } - } - line-cap: round; - line-join: round; - } - } - - [feature = 'highway_secondary_link'] { - [zoom >= 12] { - line-width: @secondary-width-z12 - 2 * @casing-width-z12; - [zoom >= 13] { line-width: @secondary-width-z13 - 2 * @casing-width-z13; } - [zoom >= 15] { line-width: @secondary-width-z15 - 2 * @casing-width-z15; } - [zoom >= 17] { line-width: @secondary-width-z17 - 2 * @casing-width-z17; } - .roads-fill, .bridges-fill { - line-color: @secondary-fill; - } - .tunnels-fill { - line-color: @secondary-tunnel-fill; - } - .bridges-fill { - line-width: @secondary-width-z12 - 2 * @bridge-casing-width-z12; - [zoom >= 13] { line-width: @secondary-width-z13 - 2 * @bridge-casing-width-z13; } - [zoom >= 15] { line-width: @secondary-width-z15 - 2 * @bridge-casing-width-z15; } - [zoom >= 17] { line-width: @secondary-width-z17 - 2 * @bridge-casing-width-z17; } - } - line-cap: round; - line-join: round; - } - } - - [feature = 'highway_tertiary_link'] { - [zoom >= 13] { - line-width: @tertiary-width-z13 - 2 * @casing-width-z13; - [zoom >= 14] { line-width: @tertiary-width-z14 - 2 * @casing-width-z14; } - [zoom >= 15] { line-width: @tertiary-width-z15 - 2 * @tertiary-width-z15; } - [zoom >= 17] { line-width: @tertiary-width-z17 - 2 * @tertiary-width-z17; } - .roads-fill, .bridges-fill { - line-color: @tertiary-fill; - } - .tunnels-fill { - line-color: @tertiary-tunnel-fill; - } - .bridges-fill { - line-width: @tertiary-width-z13 - 2 * @bridge-casing-width-z13; - [zoom >= 14] { line-width: @tertiary-width-z14 - 2 * @bridge-casing-width-z14; } - [zoom >= 15] { line-width: @tertiary-width-z15 - 2 * @bridge-casing-width-z15; } - [zoom >= 17] { line-width: @tertiary-width-z17 - 2 * @bridge-casing-width-z17; } - } - line-cap: round; - line-join: round; - } - } - } - ::fill { - /* * The construction rules for small roads are strange, since if construction is null its assumed that * it's a more major road. The line-width = 0 could be removed by playing with the query to set a construction @@ -915,24 +723,19 @@ line-width: 2; line-color: #9cc; - [construction = 'motorway'], - [construction = 'motorway_link'] { + [construction = 'motorway'] { line-color: @motorway-fill; } - [construction = 'trunk'], - [construction = 'trunk_link'] { + [construction = 'trunk'] { line-color: @trunk-fill; } - [construction = 'primary'], - [construction = 'primary_link'] { + [construction = 'primary'] { line-color: @primary-fill; } - [construction = 'secondary'], - [construction = 'secondary_link'] { + [construction = 'secondary'] { line-color: @secondary-fill; } - [construction = 'tertiary'], - [construction = 'tertiary_link'] { + [construction = 'tertiary'] { line-color: @tertiary-fill; [zoom < 13] { line-width: 0; @@ -983,12 +786,19 @@ } } + [feature = 'highway_motorway_link'], [feature = 'highway_motorway'] { [zoom >= 12] { line-width: @motorway-width-z12 - 2 * @casing-width-z12; [zoom >= 13] { line-width: @motorway-width-z13 - 2 * @casing-width-z13; } [zoom >= 15] { line-width: @motorway-width-z15 - 2 * @casing-width-z15; } [zoom >= 17] { line-width: @motorway-width-z17 - 2 * @casing-width-z17; } + [link = 'yes'] { + line-width: @motorway-link-width-z12 - 2 * @casing-width-z12; + [zoom >= 13] { line-width: @motorway-link-width-z13 - 2 * @casing-width-z13; } + [zoom >= 15] { line-width: @motorway-link-width-z15 - 2 * @casing-width-z15; } + [zoom >= 17] { line-width: @motorway-link-width-z17 - 2 * @casing-width-z17; } + } .roads-fill, .bridges-fill { line-color: @motorway-fill; } @@ -1000,12 +810,19 @@ [zoom >= 13] { line-width: @motorway-width-z13 - 2 * @bridge-casing-width-z13; } [zoom >= 15] { line-width: @motorway-width-z15 - 2 * @bridge-casing-width-z15; } [zoom >= 17] { line-width: @motorway-width-z17 - 2 * @bridge-casing-width-z17; } + [link = 'yes'] { + line-width: @motorway-link-width-z12 - 2 * @bridge-casing-width-z12; + [zoom >= 13] { line-width: @motorway-link-width-z13 - 2 * @bridge-casing-width-z13; } + [zoom >= 15] { line-width: @motorway-link-width-z15 - 2 * @bridge-casing-width-z15; } + [zoom >= 17] { line-width: @motorway-link-width-z17 - 2 * @bridge-casing-width-z17; } + } } line-cap: round; line-join: round; } } + [feature = 'highway_trunk_link'], [feature = 'highway_trunk'] { [zoom >= 12] { line-width: @trunk-width-z12 - 2 * @casing-width-z12; @@ -1029,6 +846,7 @@ } } + [feature = 'highway_primary_link'], [feature = 'highway_primary'] { [zoom >= 12] { line-width: @primary-width-z12 - 2 * @casing-width-z12; @@ -1052,6 +870,7 @@ } } + [feature = 'highway_secondary_link'], [feature = 'highway_secondary'] { [zoom >= 12] { line-width: @secondary-width-z12 - 2 * @casing-width-z12; @@ -1075,6 +894,7 @@ } } + [feature = 'highway_tertiary_link'], [feature = 'highway_tertiary'] { [zoom >= 13] { line-width: @tertiary-width-z13 - 2 * @casing-width-z13; @@ -1563,12 +1383,14 @@ } [feature = 'railway_tram'] { - .tunnels-fill { - [zoom >= 13] { - line-width: 1; + [zoom >= 13] { + line-color: #444; + line-width: 1; + [zoom >= 15] { + line-width: 2; + } + .tunnels-fill { line-dasharray: 5,3; - line-color: #444; - [zoom >= 15] { line-width: 2; } } } } @@ -1975,15 +1797,10 @@ } [access = 'no'] { [feature = 'highway_motorway'], - [feature = 'highway_motorway_link'], [feature = 'highway_trunk'], - [feature = 'highway_trunk_link'], [feature = 'highway_primary'], - [feature = 'highway_primary_link'], [feature = 'highway_secondary'], - [feature = 'highway_secondary_link'], [feature = 'highway_tertiary'], - [feature = 'highway_tertiary_link'], [feature = 'highway_unclassified'], [feature = 'highway_residential'], [feature = 'highway_road'], @@ -2016,8 +1833,7 @@ } #roads-low-zoom { - [feature = 'highway_motorway'], - [feature = 'highway_motorway_link'] { + [feature = 'highway_motorway'] { [zoom >= 5][zoom < 12] { line-width: 0.5; line-color: @motorway-fill; @@ -2028,8 +1844,7 @@ } } - [feature = 'highway_trunk'], - [feature = 'highway_trunk_link'] { + [feature = 'highway_trunk'] { [zoom >= 5][zoom < 12] { line-width: 0.4; line-color: @trunk-fill; @@ -2042,8 +1857,7 @@ } } - [feature = 'highway_primary'], - [feature = 'highway_primary_link'] { + [feature = 'highway_primary'] { [zoom >= 7][zoom < 12] { line-width: 0.5; line-color: @primary-fill; @@ -2053,8 +1867,7 @@ } } - [feature = 'highway_secondary'], - [feature = 'highway_secondary_link'] { + [feature = 'highway_secondary'] { [zoom >= 9][zoom < 12] { line-width: 1; line-color: @secondary-fill; @@ -2094,24 +1907,6 @@ } } -#trams { - [railway = 'tram'][zoom >= 13] { - line-color: #444; - line-width: 1; - [zoom >= 15] { - line-width: 2; - [bridge = 'yes'] { - line-width: 5; - line-color: black; - b/line-width: 4; - b/line-color: white; - c/line-width: 2; - c/line-color: #444; - } - } - } -} - #guideways { [zoom >= 13] { line-width: 3; @@ -2274,11 +2069,8 @@ #roads-text-name { [highway = 'motorway'], - [highway = 'motorway_link'], [highway = 'trunk'], - [highway = 'trunk_link'], - [highway = 'primary'], - [highway = 'primary_link'] { + [highway = 'primary'] { [zoom >= 13] { text-name: "[name]"; text-size: 8; @@ -2296,8 +2088,7 @@ text-size: 10; } } - [highway = 'secondary'], - [highway = 'secondary_link'] { + [highway = 'secondary'] { [zoom >= 13] { text-name: "[name]"; text-size: 8; @@ -2315,8 +2106,7 @@ text-size: 10; } } - [highway = 'tertiary'], - [highway = 'tertiary_link'] { + [highway = 'tertiary'] { [zoom >= 15] { text-name: "[name]"; text-size: 9;