Skip to content

Commit

Permalink
Clean up low-zoom layer
Browse files Browse the repository at this point in the history
- Move preserved railways and monorails from low-zoom layer #roads-low-zoom
- Remove funicular rule that never gets hit
  • Loading branch information
matthijsmelissen committed Sep 17, 2013
1 parent b6dee06 commit 47d335d
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 45 deletions.
4 changes: 2 additions & 2 deletions project.mml
Original file line number Diff line number Diff line change
Expand Up @@ -839,7 +839,7 @@
],
"Datasource": {
"type": "postgis",
"table": " (select way,\n coalesce(('highway_' || (case when highway is not null then highway else null end)), ('railway_' ||(case when railway in ('spur','siding')\n or (railway='rail' and service in ('spur','siding','yard'))\n then 'spur-siding-yard'\n when railway in ('light_rail','narrow_gauge','funicular','rail','subway','tram','spur','siding','platform','disused','abandoned','construction','miniature','turntable')\n then railway else null end)), ('aeroway_' || (case when aeroway in ('runway', 'taxiway') then aeroway else null end))) as feature,\n horse,bicycle,foot,construction,\n case when tunnel in ('yes','true','1') then 'yes'::text else 'no'::text end as tunnel,\n case when bridge in ('yes','true','1','viaduct') then 'yes'::text else 'no'::text end as bridge,\n case when service in ('parking_aisle','drive-through','driveway') then 'INT-minor'::text else 'INT-normal'::text end as service\n from planet_osm_line\n where highway is not null\n or aeroway in ('runway','taxiway')\n or railway in ('light_rail','narrow_gauge','funicular','rail','subway','tram','spur','siding','platform','disused','abandoned','construction','miniature','turntable')\n order by z_order) as roads\n",
"table": " (select way,\n coalesce(('highway_' || (case when highway is not null then highway else null end)), ('railway_' ||(case when railway='preserved' and service in ('spur','siding','yard') then 'INT-preserved-ssy'::text\n when railway in ('spur','siding')\n or (railway='rail' and service in ('spur','siding','yard'))\n then 'spur-siding-yard'\n when railway in ('light_rail','narrow_gauge','funicular','rail','subway','tram','spur','siding','monorail','platform','preserved','disused','abandoned','construction','miniature','turntable')\n then railway else null end)), ('aeroway_' || (case when aeroway in ('runway', 'taxiway') then aeroway else null end))) as feature,\n horse,bicycle,foot,construction,\n case when tunnel in ('yes','true','1') then 'yes'::text else 'no'::text end as tunnel,\n case when bridge in ('yes','true','1','viaduct') then 'yes'::text else 'no'::text end as bridge,\n case when service in ('parking_aisle','drive-through','driveway') then 'INT-minor'::text else 'INT-normal'::text end as service\n from planet_osm_line\n where highway is not null\n or aeroway in ('runway','taxiway')\n or railway in ('light_rail','narrow_gauge','funicular','rail','subway','tram','spur','siding','monorail','platform','preserved','disused','abandoned','construction','miniature','turntable')\n order by z_order) as roads\n",
"extent": "-20037508,-19929239,20037508,19929239",
"key_field": "",
"geometry_field": "way",
Expand Down Expand Up @@ -931,7 +931,7 @@
],
"Datasource": {
"type": "postgis",
"table": " (select way,coalesce(('highway_' || (case when highway is not null then highway else null end)), ('railway_' || (case when railway='preserved' and service in ('spur','siding','yard') then 'INT-preserved-ssy'::text when railway in ('rail','tram','light_rail','narrow_gauge','preserved','monorail') then railway else null end))) as feature,\n case when tunnel in ('yes','true','1') then 'yes'::text else tunnel end as tunnel\n from planet_osm_roads\n where highway is not null\n or (railway is not null and railway!='preserved' and (service is null or service not in ('spur','siding','yard')))\n or railway='preserved'\n order by z_order\n ) as roads",
"table": " (select way,coalesce(('highway_' || (case when highway is not null then highway else null end)), ('railway_' || (case when railway in ('rail','tram','light_rail','narrow_gauge') then railway else null end))) as feature,\n case when tunnel in ('yes','true','1') then 'yes'::text else tunnel end as tunnel\n from planet_osm_roads\n where highway is not null\n or (railway is not null and railway!='preserved' and (service is null or service not in ('spur','siding','yard')))\n order by z_order\n ) as roads",
"extent": "-20037508,-19929239,20037508,19929239",
"key_field": "",
"geometry_field": "way",
Expand Down
86 changes: 43 additions & 43 deletions roads.mss
Original file line number Diff line number Diff line change
Expand Up @@ -1230,6 +1230,48 @@
}
}


[feature = 'railway_preserved'][zoom >= 12] {
line-width: 1.5;
line-color: #aaa;
line-join: round;
[zoom >= 13] {
line-width: 3;
line-color: #999999;
b/line-width: 1;
b/line-color: white;
b/line-dasharray: 0,1,8,1;
b/line-join: round;
}
}

[feature = 'railway_INT-preserved-ssy'][zoom >= 12] {
line-width: 1;
line-color: #aaa;
line-join: round;
[zoom >= 13] {
line-width: 2;
line-color: #999999;
b/line-width: 0.8;
b/line-color: white;
b/line-dasharray: 0,1,8,1;
b/line-join: round;
}
}

[feature = 'railway_monorail'][zoom >= 14] {
line-width: 4;
line-color: #fff;
line-opacity: 0.4;
line-cap: round;
line-join: round;
b/line-width: 3;
b/line-color: #777;
b/line-dasharray: 2,3;
b/line-cap: round;
b/line-join: round;
}

[feature = 'railway_disused'],
[feature = 'railway_abandoned'],
[feature = 'railway_construction'] {
Expand Down Expand Up @@ -2146,55 +2188,13 @@

[feature = 'railway_tram'],
[feature = 'railway_light_rail'],
[feature = 'railway_narrow_gauge'],
[feature = 'railway_funicular'] {

This comment has been minimized.

Copy link
@gravitystorm

gravitystorm Sep 18, 2013

I don't understand why you're removing the selector - 'funicular' appears in the roads-fill SQL query, and this selector appears within the #roads-fill layer.

This comment has been minimized.

Copy link
@matthijsmelissen

matthijsmelissen Sep 18, 2013

Author Owner

The value 'funicular' only appeared in the roads-fill SQL query, not in the roads-low-zoom SQL query. Therefore, I removed it from the roads-low-zoom layer (to which you reply). It still occurs in the roads-fill layer.

This comment has been minimized.

Copy link
@gravitystorm

gravitystorm Sep 18, 2013

Ah, my mistake - this is in the lowzoom layer. Still, the correct fix is to re-instate the funiculars at the lower zooms by adding them to the query, which I'll take care of.

This comment has been minimized.

Copy link
@matthijsmelissen

matthijsmelissen Sep 18, 2013

Author Owner

No problem, and thanks for checking. Adding funiculars to the query is also fine. I focused on cleaning up the code, and tried to minimize the number of changes in rendering.

Actually I'm not even sure whether rendering funiculars on low-zoom levels is a good idea. The longest is 2km long, and typical ones, such as here in Lisbon, are only a couple hundreds of metres. Not sure how useful it is to have them rendered at zoom level 12.

[feature = 'railway_narrow_gauge'] {
[zoom >= 8][zoom < 13] {
line-width: 1;
line-color: #ccc;
[zoom >= 10] { line-color: #aaa }
}
}

[feature = 'railway_preserved'][zoom >= 12] {
line-width: 1.5;
line-color: #aaa;
line-join: round;
[zoom >= 13] {
line-width: 3;
line-color: #999999;
b/line-width: 1;
b/line-color: white;
b/line-dasharray: 0,1,8,1;
b/line-join: round;
}
}

[feature = 'railway_INT-preserved-ssy'][zoom >= 12] {
line-width: 1;
line-color: #aaa;
line-join: round;
[zoom >= 13] {
line-width: 2;
line-color: #999999;
b/line-width: 0.8;
b/line-color: white;
b/line-dasharray: 0,1,8,1;
b/line-join: round;
}
}

[feature = 'railway_monorail'][zoom >= 14] {
line-width: 4;
line-color: #fff;
line-opacity: 0.4;
line-cap: round;
line-join: round;
b/line-width: 3;
b/line-color: #777;
b/line-dasharray: 2,3;
b/line-cap: round;
b/line-join: round;
}
}

#trams {
Expand Down

0 comments on commit 47d335d

Please sign in to comment.