-
Notifications
You must be signed in to change notification settings - Fork 822
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
Move danger_area into landuse-overlay #3469
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -87,15 +87,17 @@ Layer: | |
table: |- | ||
(SELECT | ||
way, name, way_pixels, religion, | ||
COALESCE(wetland, landuse, "natural") AS feature | ||
COALESCE(wetland, landuse, military, "natural") AS feature | ||
FROM (SELECT | ||
way, COALESCE(name, '') AS name, religion, | ||
('landuse_' || (CASE WHEN landuse IN ('forest', 'military', 'farmland', 'residential', 'commercial', 'retail', 'industrial', 'meadow') THEN landuse ELSE NULL END)) AS landuse, | ||
('military_' || (CASE WHEN military IN ('danger_area') THEN military ELSE NULL END)) AS military, | ||
('natural_' || (CASE WHEN "natural" IN ('wood', 'sand', 'scree', 'shingle', 'bare_rock', 'heath', 'grassland') THEN "natural" ELSE NULL END)) AS "natural", | ||
('wetland_' || (CASE WHEN "natural" IN ('wetland', 'mud') THEN (CASE WHEN "natural" IN ('mud') THEN "natural" ELSE tags->'wetland' END) ELSE NULL END)) AS wetland, | ||
way_area/NULLIF(!pixel_width!::real*!pixel_height!::real,0) AS way_pixels | ||
FROM planet_osm_polygon | ||
WHERE (landuse IN ('forest', 'military', 'farmland', 'residential', 'commercial', 'retail', 'industrial', 'meadow') | ||
OR military IN ('danger_area') | ||
OR "natural" IN ('wood', 'wetland', 'mud', 'sand', 'scree', 'shingle', 'bare_rock', 'heath', 'grassland')) | ||
AND way_area > 1*!pixel_width!::real*!pixel_height!::real | ||
AND building IS NULL | ||
|
@@ -113,7 +115,7 @@ Layer: | |
table: |- | ||
(SELECT | ||
way, name, religion, way_pixels, | ||
COALESCE(aeroway, amenity, wetland, power, landuse, leisure, man_made, military, "natural", tourism, highway, railway) AS feature | ||
COALESCE(aeroway, amenity, wetland, power, landuse, leisure, man_made, "natural", tourism, highway, railway) AS feature | ||
FROM (SELECT | ||
way, COALESCE(name, '') AS name, | ||
('aeroway_' || (CASE WHEN aeroway IN ('apron', 'aerodrome') THEN aeroway ELSE NULL END)) AS aeroway, | ||
|
@@ -129,7 +131,6 @@ Layer: | |
'golf_course', 'miniature_golf', 'sports_centre', 'stadium', 'pitch', | ||
'track', 'dog_park', 'fitness_station') THEN leisure ELSE NULL END)) AS leisure, | ||
('man_made_' || (CASE WHEN man_made IN ('works', 'wastewater_plant', 'water_works') THEN man_made ELSE NULL END)) AS man_made, | ||
('military_' || (CASE WHEN military IN ('danger_area') THEN military ELSE NULL END)) AS military, | ||
('natural_' || (CASE WHEN "natural" IN ('beach', 'shoal', 'heath', 'grassland', 'wood', 'sand', 'scree', 'shingle', 'bare_rock', 'scrub') THEN "natural" ELSE NULL END)) AS "natural", | ||
('wetland_' || (CASE WHEN "natural" IN ('wetland', 'marsh', 'mud') THEN (CASE WHEN "natural" IN ('marsh', 'mud') THEN "natural" ELSE tags->'wetland' END) ELSE NULL END)) AS wetland, | ||
('power_' || (CASE WHEN power IN ('station', 'sub_station', 'substation', 'generator') THEN power ELSE NULL END)) AS power, | ||
|
@@ -146,7 +147,6 @@ Layer: | |
'grave_yard', 'place_of_worship', 'prison', 'clinic', 'ferry_terminal', 'marketplace', 'community_centre', 'social_facility', | ||
'arts_centre', 'parking_space', 'bus_station', 'fire_station', 'police') | ||
OR man_made IN ('works', 'wastewater_plant','water_works') | ||
OR military IN ('danger_area') | ||
OR "natural" IN ('beach', 'shoal', 'heath', 'mud', 'marsh', 'wetland', 'grassland', 'wood', 'sand', 'scree', 'shingle', 'bare_rock', 'scrub') | ||
OR power IN ('station', 'sub_station', 'substation', 'generator') | ||
OR tourism IN ('camp_site', 'caravan_site', 'picnic_site') | ||
|
@@ -538,9 +538,11 @@ Layer: | |
(SELECT | ||
way, | ||
landuse, | ||
way_area/NULLIF(!pixel_width!::real*!pixel_height!::real,0) AS way_pixels | ||
way_area/NULLIF(!pixel_width!::real*!pixel_height!::real,0) AS way_pixels, | ||
military | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe swap these lines for clarity. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. fixed |
||
FROM planet_osm_polygon | ||
WHERE landuse = 'military' | ||
OR military = 'danger_area' | ||
AND building IS NULL | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In SQL, AND has precedence over OR, so this will be parsed as |
||
) AS landuse_overlay | ||
properties: | ||
|
@@ -1997,6 +1999,7 @@ Layer: | |
way_area/NULLIF(!pixel_width!::real*!pixel_height!::real,0) AS way_pixels, | ||
COALESCE( | ||
'landuse_' || CASE WHEN landuse IN ('forest', 'military', 'farmland') THEN landuse ELSE NULL END, | ||
'military_' || CASE WHEN military IN ('danger_area') THEN military ELSE NULL END, | ||
'natural_' || CASE WHEN "natural" IN ('wood', 'glacier', 'sand', 'scree', 'shingle', 'bare_rock', | ||
'water', 'bay', 'strait') THEN "natural" ELSE NULL END, | ||
'place_' || CASE WHEN place IN ('island') THEN place ELSE NULL END, | ||
|
@@ -2007,6 +2010,7 @@ Layer: | |
CASE WHEN building = 'no' OR building IS NULL THEN 'no' ELSE 'yes' END AS is_building -- always no with the where conditions | ||
FROM planet_osm_polygon | ||
WHERE (landuse IN ('forest', 'military', 'farmland') | ||
OR military IN ('danger_area') | ||
OR "natural" IN ('wood', 'glacier', 'sand', 'scree', 'shingle', 'bare_rock', 'water', 'bay', 'strait') | ||
OR "place" IN ('island') | ||
OR boundary IN ('national_park') | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we don't need military=danger_area in this layer. The layer
landuse-overlay
also works for lowzoom rendering.We can even remove the landuse=military from this layer: the style for #landcover-low-zoom does not seem to use landuse=military.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed