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

Reorder layers to get all the road layers together #4464

Closed
wants to merge 5 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
324 changes: 162 additions & 162 deletions project.mml
Expand Up @@ -321,6 +321,20 @@ Layer:
) AS icesheet_outlines
properties:
minzoom: 5
- id: cliffs
geometry: linestring
<<: *extents
Datasource:
<<: *osm2pgsql
table: |-
(SELECT
way, "natural", man_made
FROM planet_osm_line
WHERE "natural" IN ('arete', 'cliff', 'ridge') OR man_made = 'embankment'
) AS cliffs
properties:
cache-features: true
minzoom: 13
- id: marinas-area
geometry: polygon
<<: *extents
Expand Down Expand Up @@ -436,6 +450,92 @@ Layer:
) AS buildings
properties:
minzoom: 14
- id: landuse-overlay
geometry: polygon
<<: *extents
Datasource:
<<: *osm2pgsql
table: |-
(SELECT
way,
landuse,
military,
way_area/NULLIF(POW(!scale_denominator!*0.001*0.28,2),0) AS way_pixels
FROM planet_osm_polygon
WHERE (landuse = 'military'
OR military = 'danger_area')
AND building IS NULL
) AS landuse_overlay
properties:
minzoom: 8
- id: tourism-boundary
geometry: polygon
<<: *extents
Datasource:
<<: *osm2pgsql
table: |-
(SELECT
way,
way_area/NULLIF(POW(!scale_denominator!*0.001*0.28,2),0) AS way_pixels,
tourism
FROM planet_osm_polygon
WHERE tourism = 'theme_park'
OR tourism = 'zoo'
) AS tourism_boundary
properties:
minzoom: 10
- id: 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', 'ditch', 'fence', 'guard_rail',
'handrail', 'hedge', 'retaining_wall', 'wall') THEN barrier END)) AS barrier,
('historic_' || (CASE WHEN historic = 'citywalls' THEN historic END)) AS historic
FROM
(SELECT
way,
historic,
barrier,
waterway
FROM planet_osm_polygon
WHERE way && !bbox!
UNION ALL
SELECT
way,
historic,
barrier,
waterway
FROM planet_osm_line
WHERE way && !bbox!
) _
WHERE barrier IN ('chain', 'city_wall', 'ditch', 'fence', 'guard_rail',
'handrail', 'hedge', 'retaining_wall', 'wall')
OR historic = 'citywalls'
AND (waterway IS NULL OR waterway NOT IN ('river', 'canal', 'stream', 'drain', 'ditch'))
) AS features
) AS line_barriers
properties:
minzoom: 15
- id: ferry-routes
geometry: linestring
<<: *extents
Datasource:
<<: *osm2pgsql
table: |-
(SELECT
way
FROM planet_osm_line
WHERE route = 'ferry'
AND osm_id > 0
) AS ferry_routes
properties:
minzoom: 8
- id: tunnels
geometry: linestring
<<: *extents
Expand Down Expand Up @@ -524,106 +624,6 @@ Layer:
cache-features: true
group-by: layernotnull
minzoom: 10
- id: landuse-overlay
geometry: polygon
<<: *extents
Datasource:
<<: *osm2pgsql
table: |-
(SELECT
way,
landuse,
military,
way_area/NULLIF(POW(!scale_denominator!*0.001*0.28,2),0) AS way_pixels
FROM planet_osm_polygon
WHERE (landuse = 'military'
OR military = 'danger_area')
AND building IS NULL
) AS landuse_overlay
properties:
minzoom: 8
- id: tourism-boundary
geometry: polygon
<<: *extents
Datasource:
<<: *osm2pgsql
table: |-
(SELECT
way,
way_area/NULLIF(POW(!scale_denominator!*0.001*0.28,2),0) AS way_pixels,
tourism
FROM planet_osm_polygon
WHERE tourism = 'theme_park'
OR tourism = 'zoo'
) AS tourism_boundary
properties:
minzoom: 10
- id: 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', 'ditch', 'fence', 'guard_rail',
'handrail', 'hedge', 'retaining_wall', 'wall') THEN barrier END)) AS barrier,
('historic_' || (CASE WHEN historic = 'citywalls' THEN historic END)) AS historic
FROM
(SELECT
way,
historic,
barrier,
waterway
FROM planet_osm_polygon
WHERE way && !bbox!
UNION ALL
SELECT
way,
historic,
barrier,
waterway
FROM planet_osm_line
WHERE way && !bbox!
) _
WHERE barrier IN ('chain', 'city_wall', 'ditch', 'fence', 'guard_rail',
'handrail', 'hedge', 'retaining_wall', 'wall')
OR historic = 'citywalls'
AND (waterway IS NULL OR waterway NOT IN ('river', 'canal', 'stream', 'drain', 'ditch'))
) AS features
) AS line_barriers
properties:
minzoom: 15
- id: cliffs
geometry: linestring
<<: *extents
Datasource:
<<: *osm2pgsql
table: |-
(SELECT
way, "natural", man_made
FROM planet_osm_line
WHERE "natural" IN ('arete', 'cliff', 'ridge') OR man_made = 'embankment'
) AS cliffs
properties:
cache-features: true
minzoom: 13
- id: ferry-routes
geometry: linestring
<<: *extents
Datasource:
<<: *osm2pgsql
table: |-
(SELECT
way
FROM planet_osm_line
WHERE route = 'ferry'
AND osm_id > 0
) AS ferry_routes
properties:
minzoom: 8
- id: turning-circle-casing
geometry: point
<<: *extents
Expand Down Expand Up @@ -829,35 +829,6 @@ Layer:
table: *turning-circle_sql
properties:
minzoom: 15
- id: aerialways
geometry: linestring
<<: *extents
Datasource:
<<: *osm2pgsql
table: |-
(SELECT
way,
aerialway,
man_made,
tags->'substance' AS substance
FROM planet_osm_line
WHERE aerialway IS NOT NULL
OR (man_made = 'pipeline'
AND tags-> 'location' IN ('overground', 'overhead', 'surface', 'outdoor')
OR bridge IN ('yes', 'aqueduct', 'cantilever', 'covered', 'trestle', 'viaduct'))
OR (man_made = 'goods_conveyor'
AND (tags->'location' NOT IN ('underground') OR (tags->'location') IS NULL)
AND (tunnel NOT IN ('yes') OR tunnel IS NULL))
ORDER BY
CASE
WHEN man_made IN ('goods_conveyor', 'pipeline') THEN 1
WHEN tags-> 'location' = 'overhead' THEN 2
WHEN bridge IS NOT NULL THEN 3
WHEN aerialway IS NOT NULL THEN 4
END
) AS aerialways
properties:
minzoom: 12
- id: roads-low-zoom
geometry: linestring
<<: *extents
Expand Down Expand Up @@ -890,29 +861,6 @@ Layer:
cache-features: true
minzoom: 6
maxzoom: 9
- id: waterway-bridges
geometry: linestring
<<: *extents
Datasource:
<<: *osm2pgsql
table: |-
(SELECT
way,
waterway,
CASE WHEN tags->'intermittent' IN ('yes')
OR tags->'seasonal' IN ('yes', 'spring', 'summer', 'autumn', 'winter', 'wet_season', 'dry_season')
THEN 'yes' ELSE 'no' END AS int_intermittent,
CASE WHEN tunnel IN ('yes', 'culvert')
OR waterway = 'canal' AND tunnel = 'flooded'
THEN 'yes' ELSE 'no' END AS int_tunnel,
'yes' AS bridge
FROM planet_osm_line
WHERE waterway IN ('river', 'canal', 'stream', 'drain', 'ditch')
AND bridge IN ('yes', 'aqueduct')
ORDER BY COALESCE(layer,0)
) AS waterway_bridges
properties:
minzoom: 12
- id: bridges
geometry: linestring
<<: *extents
Expand Down Expand Up @@ -1012,23 +960,29 @@ Layer:
) AS guideways
properties:
minzoom: 11
- id: entrances
geometry: point
- id: waterway-bridges
geometry: linestring
<<: *extents
Datasource:
<<: *osm2pgsql
table: |-
(SELECT
way,
tags->'entrance' AS entrance,
access
FROM planet_osm_point
WHERE (tags->'entrance') IS NOT NULL AND
(tags->'indoor' = 'no'
OR (tags->'indoor') IS NULL))
AS entrances
waterway,
CASE WHEN tags->'intermittent' IN ('yes')
OR tags->'seasonal' IN ('yes', 'spring', 'summer', 'autumn', 'winter', 'wet_season', 'dry_season')
THEN 'yes' ELSE 'no' END AS int_intermittent,
CASE WHEN tunnel IN ('yes', 'culvert')
OR waterway = 'canal' AND tunnel = 'flooded'
THEN 'yes' ELSE 'no' END AS int_tunnel,
'yes' AS bridge
FROM planet_osm_line
WHERE waterway IN ('river', 'canal', 'stream', 'drain', 'ditch')
AND bridge IN ('yes', 'aqueduct')
ORDER BY COALESCE(layer,0)
) AS waterway_bridges
properties:
minzoom: 18
minzoom: 12
- id: aeroways
geometry: linestring
<<: *extents
Expand All @@ -1047,6 +1001,35 @@ Layer:
properties:
cache-features: true
minzoom: 11
- id: aerialways
geometry: linestring
<<: *extents
Datasource:
<<: *osm2pgsql
table: |-
(SELECT
way,
aerialway,
man_made,
tags->'substance' AS substance
FROM planet_osm_line
WHERE aerialway IS NOT NULL
OR (man_made = 'pipeline'
AND tags-> 'location' IN ('overground', 'overhead', 'surface', 'outdoor')
OR bridge IN ('yes', 'aqueduct', 'cantilever', 'covered', 'trestle', 'viaduct'))
OR (man_made = 'goods_conveyor'
AND (tags->'location' NOT IN ('underground') OR (tags->'location') IS NULL)
AND (tunnel NOT IN ('yes') OR tunnel IS NULL))
ORDER BY
CASE
WHEN man_made IN ('goods_conveyor', 'pipeline') THEN 1
WHEN tags-> 'location' = 'overhead' THEN 2
WHEN bridge IS NOT NULL THEN 3
WHEN aerialway IS NOT NULL THEN 4
END
) AS aerialways
properties:
minzoom: 12
- id: golf-line
geometry: linestring
<<: *extents
Expand Down Expand Up @@ -1465,6 +1448,23 @@ Layer:
) AS county_names
properties:
minzoom: 8
- id: entrances
geometry: point
<<: *extents
Datasource:
<<: *osm2pgsql
table: |-
(SELECT
way,
tags->'entrance' AS entrance,
access
FROM planet_osm_point
WHERE (tags->'entrance') IS NOT NULL AND
(tags->'indoor' = 'no'
OR (tags->'indoor') IS NULL))
AS entrances
properties:
minzoom: 18
- id: amenity-points
geometry: point
<<: *extents
Expand Down