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

Revert "Render unpaved roads different" #3386

Merged
merged 1 commit into from
Sep 13, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
189 changes: 26 additions & 163 deletions project.mml
Original file line number Diff line number Diff line change
Expand Up @@ -550,15 +550,12 @@ Layer:
z_order,
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 feature IN ('highway_road') THEN 0 ELSE 1 END,
CASE WHEN feature IN ('highway_platform', 'railway_platform') 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
) AS tunnels
properties:
group-by: layernotnull
minzoom: 10
cache-features: true
- id: landuse-overlay
geometry: polygon
<<: *extents
Expand Down Expand Up @@ -797,14 +794,11 @@ Layer:
z_order,
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 feature IN ('highway_road') THEN 0 ELSE 1 END,
CASE WHEN feature IN ('highway_platform', 'railway_platform') 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
) AS roads_casing
properties:
minzoom: 10
cache-features: true
- id: highway-area-fill
# FIXME: No geometry?
<<: *extents
Expand All @@ -822,13 +816,7 @@ Layer:
AND (covered NOT IN ('yes') OR covered IS NULL))
THEN railway ELSE NULL END)),
(('aeroway_' || CASE WHEN aeroway IN ('runway', 'taxiway', 'helipad') THEN aeroway ELSE NULL END))
) AS feature,
CASE WHEN surface IN ('unpaved', 'compacted', 'dirt', 'earth', 'fine_gravel', 'grass', 'grass_paver', 'gravel', 'ground',
'mud', 'pebblestone', 'salt', 'sand', 'woodchips', 'clay', 'ice', 'snow') THEN 'unpaved'
WHEN surface IN ('paved', 'asphalt', 'cobblestone', 'cobblestone:flattened', 'sett', 'concrete', 'concrete:lanes',
'concrete:plates', 'paving_stones', 'metal', 'wood', 'unhewn_cobblestone') THEN 'paved'
ELSE NULL
END AS int_surface
) AS feature
FROM planet_osm_polygon
WHERE highway IN ('residential', 'unclassified', 'pedestrian', 'service', 'footway', 'living_street', 'track', 'path', 'platform', 'services')
OR (railway IN ('platform')
Expand Down Expand Up @@ -909,12 +897,7 @@ Layer:
foot,
bicycle,
tracktype,
CASE WHEN surface IN ('unpaved', 'compacted', 'dirt', 'earth', 'fine_gravel', 'grass', 'grass_paver', 'gravel', 'ground',
'mud', 'pebblestone', 'salt', 'sand', 'woodchips', 'clay', 'ice', 'snow') THEN 'unpaved'
WHEN surface IN ('paved', 'asphalt', 'cobblestone', 'cobblestone:flattened', 'sett', 'concrete', 'concrete:lanes',
'concrete:plates', 'paving_stones', 'metal', 'wood', 'unhewn_cobblestone') THEN 'paved'
ELSE NULL
END AS int_surface,
'null' AS surface, -- Should be a SQL NULL?
CASE
WHEN access IN ('destination') THEN 'destination'::text
WHEN access IN ('no', 'private') THEN 'no'::text
Expand All @@ -931,90 +914,45 @@ Layer:
AND (covered IS NULL OR NOT covered = 'yes')
AND (bridge IS NULL OR NOT bridge IN ('yes', 'boardwalk', 'cantilever', 'covered', 'low_water_crossing', 'movable', 'trestle', 'viaduct'))
AND railway IS NOT NULL -- end of rail select
UNION ALL
(SELECT
ST_MakeEnvelope(-20037508.342789244, -20037508.342789244, 20037508.342789244, 20037508.342789244, 900913) AS way,
'globalboundingbox' AS feature,
NULL AS horse,
NULL AS foot,
NULL AS bicycle,
NULL AS tracktype,
NULL AS surface,
NULL AS access,
NULL AS construction,
NULL AS service,
NULL AS link,
NULL AS layernotnull,
NULL AS z_order
)
) AS features
ORDER BY
layernotnull,
z_order,
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 feature IN ('highway_road') THEN 0 ELSE 1 END,
CASE WHEN feature IN ('highway_platform', 'railway_platform') 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
) AS roads_fill
properties:
minzoom: 10
cache-features: true
- id: turning-circle-fill
geometry: point
<<: *extents
Datasource:
<<: *osm2pgsql
table: |-
(SELECT
way,
feature,
int_tc_type,
int_surface,
int_tc_service
FROM
(SELECT DISTINCT on (p.way)
p.way AS way,
NULL::TEXT AS feature,
l.highway AS int_tc_type,
CASE
WHEN surface IN ('unpaved', 'compacted', 'dirt', 'earth', 'fine_gravel', 'grass', 'grass_paver', 'gravel', 'ground',
'mud', 'pebblestone', 'salt', 'sand', 'woodchips', 'clay', 'ice', 'snow') THEN 'unpaved'
WHEN surface IN ('paved', 'asphalt', 'cobblestone', 'cobblestone:flattened', 'sett', 'concrete', 'concrete:lanes',
'concrete:plates', 'paving_stones', 'metal', 'wood', 'unhewn_cobblestone') THEN 'paved'
ELSE NULL
END AS int_surface,
CASE
WHEN l.service IN ('parking_aisle', 'drive-through', 'driveway') THEN 'INT-minor'::text
ELSE 'INT-normal'::text
END AS int_tc_service
FROM planet_osm_point p
JOIN planet_osm_line l
ON ST_DWithin(p.way, l.way, 0.1)
JOIN (VALUES
('tertiary', 1),
('unclassified', 2),
('residential', 3),
('living_street', 4),
('service', 5),
('track', 6)
) AS v (highway, prio)
ON v.highway=l.highway
WHERE p.highway = 'turning_circle' OR p.highway = 'turning_loop'
ORDER BY p.way, v.prio
) AS turning_circle_fill_inner_query
UNION ALL
(SELECT
ST_MakeEnvelope(-20037508.342789244, -20037508.342789244, 20037508.342789244, 20037508.342789244, 900913) AS way,
'globalboundingbox' AS feature,
NULL AS int_tc_type,
NULL AS int_surface,
NULL AS int_tc_service
)
) AS turning_circle_fill_outer_query
DISTINCT on (p.way)
p.way AS way, l.highway AS int_tc_type,
CASE WHEN l.service IN ('parking_aisle', 'drive-through', 'driveway') THEN 'INT-minor'::text
ELSE 'INT-normal'::text END AS int_tc_service
FROM planet_osm_point p
JOIN planet_osm_line l
ON ST_DWithin(p.way, l.way, 0.1)
JOIN (VALUES
('tertiary', 1),
('unclassified', 2),
('residential', 3),
('living_street', 4),
('service', 5),
('track', 6)
) AS v (highway, prio)
ON v.highway=l.highway
WHERE p.highway = 'turning_circle' OR p.highway = 'turning_loop'
ORDER BY p.way, v.prio
) AS turning_circle_fill
properties:
minzoom: 15
cache-features: true
- id: aerialways
geometry: linestring
<<: *extents
Expand Down Expand Up @@ -1050,28 +988,17 @@ Layer:
WHEN surface IN ('paved', 'asphalt', 'cobblestone', 'cobblestone:flattened', 'sett', 'concrete', 'concrete:lanes',
'concrete:plates', 'paving_stones', 'metal', 'wood', 'unhewn_cobblestone') THEN 'paved'
ELSE NULL
END AS int_surface,
z_order
END AS int_surface
FROM planet_osm_roads
WHERE highway IS NOT NULL
OR (railway IS NOT NULL AND railway != 'preserved'
AND (service IS NULL OR service NOT IN ('spur', 'siding', 'yard')))
UNION ALL
(SELECT
ST_MakeEnvelope(-20037508.342789244, -20037508.342789244, 20037508.342789244, 20037508.342789244, 900913) AS way,
'globalboundingbox' AS feature,
NULL AS int_tunnel,
NULL AS link,
NULL AS int_surface,
NULL AS z_order
)
ORDER BY
z_order
) AS roads_low_zoom
properties:
minzoom: 6
maxzoom: 9
cache-features: true
- id: waterway-bridges
class: water-lines
geometry: linestring
Expand Down Expand Up @@ -1116,8 +1043,7 @@ Layer:
link,
layernotnull
FROM ( -- subselect that contains both roads and rail/aero
WITH features_real AS ( -- this is the actual data (which is used both as is and to determine the distinct layer values present in it)
SELECT
SELECT
way,
'highway_' || highway AS feature, --only motorway to tertiary links are accepted later on
horse,
Expand Down Expand Up @@ -1148,40 +1074,6 @@ Layer:
FROM planet_osm_line
WHERE bridge IN ('yes', 'boardwalk', 'cantilever', 'covered', 'low_water_crossing', 'movable', 'trestle', 'viaduct')
AND highway IS NOT NULL -- end of road select
AND way && !bbox!
)
SELECT
way,
feature,
horse,
foot,
bicycle,
tracktype,
int_surface,
access,
construction,
service,
link,
layernotnull,
z_order
FROM features_real
UNION ALL
SELECT
ST_MakeEnvelope(-20037508.342789244, -20037508.342789244, 20037508.342789244, 20037508.342789244, 900913) AS way,
'globalboundingbox' AS feature,
NULL AS horse,
NULL AS foot,
NULL AS bicycle,
NULL AS tracktype,
NULL AS surface,
NULL AS access,
NULL AS construction,
NULL AS service,
NULL AS link,
layernotnull,
NULL AS z_order
FROM
(SELECT DISTINCT layernotnull FROM features_real) AS layers_list
UNION ALL
SELECT
way,
Expand All @@ -1207,22 +1099,18 @@ Layer:
FROM planet_osm_line
WHERE bridge IN ('yes', 'boardwalk', 'cantilever', 'covered', 'low_water_crossing', 'movable', 'trestle', 'viaduct')
AND railway IS NOT NULL -- end of rail select
AND way && !bbox!
) AS features
ORDER BY
layernotnull,
z_order,
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 feature IN ('highway_road') THEN 0 ELSE 1 END,
CASE WHEN feature IN ('highway_platform', 'railway_platform') 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
) AS bridges
properties:
group-by: layernotnull
minzoom: 10
cache-features: true
- id: guideways
geometry: linestring
<<: *extents
Expand Down Expand Up @@ -1260,41 +1148,16 @@ Layer:
<<: *osm2pgsql
table: |-
(SELECT
way,
feature,
aeroway,
bridge,
int_surface
FROM
(SELECT
way,
NULL as feature,
aeroway,
bridge IN ('yes', 'boardwalk', 'cantilever', 'covered', 'low_water_crossing', 'movable', 'trestle', 'viaduct') AS bridge,
CASE WHEN surface IN ('unpaved', 'compacted', 'dirt', 'earth', 'fine_gravel', 'grass', 'grass_paver', 'gravel', 'ground',
'mud', 'pebblestone', 'salt', 'sand', 'woodchips', 'clay', 'ice', 'snow') THEN 'unpaved'
WHEN surface IN ('paved', 'asphalt', 'cobblestone', 'cobblestone:flattened', 'sett', 'concrete', 'concrete:lanes',
'concrete:plates', 'paving_stones', 'metal', 'wood', 'unhewn_cobblestone') THEN 'paved'
ELSE NULL
END AS int_surface
bridge IN ('yes', 'boardwalk', 'cantilever', 'covered', 'low_water_crossing', 'movable', 'trestle', 'viaduct') AS bridge
FROM planet_osm_line
WHERE aeroway IN ('runway', 'taxiway')
UNION ALL
(SELECT
ST_MakeEnvelope(-20037508.342789244, -20037508.342789244, 20037508.342789244, 20037508.342789244, 900913) AS way,
'globalboundingbox' AS feature,
NULL AS aeroway,
NULL AS bridge,
NULL AS int_surface
)
) AS features
ORDER BY bridge NULLS FIRST,
CASE WHEN aeroway = 'runway' THEN 10 ELSE 0 END,
CASE WHEN int_surface IN ('unpaved') THEN 0 ELSE 2 END
CASE WHEN aeroway = 'runway' THEN 10 ELSE 0 END
) AS aeroways
properties:
minzoom: 11
cache-features: true
- id: admin-low-zoom
geometry: linestring
<<: *extents
Expand Down
Loading