Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optimize roads.mss #364

Merged
merged 11 commits into from
May 20, 2020
6 changes: 3 additions & 3 deletions project.mml
Original file line number Diff line number Diff line change
Expand Up @@ -748,13 +748,13 @@ Layer:
CASE
WHEN bicycle IS NOT NULL THEN bicycle
WHEN tags->'motorroad' IN ('yes') THEN 'no'
WHEN highway NOT IN ('motorway', 'motorway_link') AND tags->'vehicle' IS NOT NULL THEN tags->'vehicle'
Phyks marked this conversation as resolved.
Show resolved Hide resolved
WHEN highway NOT IN ('motorway', 'motorway_link') AND access IS NOT NULL THEN access
WHEN highway NOT IN ('motorway') AND tags->'vehicle' IS NOT NULL THEN tags->'vehicle'
WHEN highway NOT IN ('motorway') AND access IS NOT NULL THEN access
ELSE NULL
END AS can_bicycle
FROM planet_osm_roads
WHERE (railway IN ('rail')
OR highway IN ('motorway', 'motorway_link', 'trunk', 'trunk_link', 'primary', 'secondary', 'railway'))
OR highway IN ('motorway', 'trunk', 'primary', 'secondary'))
AND way && !bbox!
ORDER BY CASE
WHEN railway IS NOT NULL THEN 0
Expand Down
51 changes: 12 additions & 39 deletions roads.mss
Original file line number Diff line number Diff line change
Expand Up @@ -33,61 +33,34 @@
// as well.

#roads_med[zoom >= 9] {
line-color: @motorway-trunk-fill;

[type='railway'] {
line-width: 1;
line-color: @rail-line;
}

[type='motorway'],
[type='motorway_link'] {
line-color: @motorway-trunk-fill;
[can_bicycle='yes'] {
line-color: @motorway-trunk-cycle-fill;
}
}
[type='trunk'],
[type='trunk_link'] {
line-color: @motorway-trunk-cycle-fill;
[can_bicycle='no'] {
line-color: @motorway-trunk-fill;
}
[type='motorway'][can_bicycle='yes'],
[type='trunk'][can_bicycle!='no'] {
line-color: @motorway-trunk-cycle-fill;
}
[type='primary'] {
line-color: @primary-case;
}
[type='secondary'],
[type='tertiary'] {
[type='secondary'] {
line-color: @standard-case;
}

[type='motorway'],
[type='trunk'],
[type='primary'],
[type='motorway_link'],
[type='trunk_link'] {
line-width: 1;
[type='railway'] {
line-color: @rail-line;
}
[type='secondary'],
[type='tertiary']

line-width: 1;
[type='secondary']
{
line-width: 0.6;
}


[zoom >= 10] {
[type='motorway'],
[type='trunk'],
[type='primary'],
[type='motorway_link'],
[type='trunk_link'],
[type='secondary'],
[type='tertiary'] {
[zoom >= 10] {
line-width: 1;
}
}
}

/*
// At higher levels the roads become more complex. We're now showing
//more than just automobile routes - railways, footways, and cycleways
//come in as well.
Expand Down