-
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
Conversation
@matkoniecz @matthijsmelissen Could you check this code? I'm not sure if it does not change anything else beside moving to overlay. |
One thing that is certainly worth testing - is labelling of such areas still working correctly? I see nothing obviously problematic but it should be checked. |
Could you make this additional check? |
it's working from my side: |
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.
Thanks for your pull request, and sorry for the delay in reviewing! I have two small comments.
project.mml
Outdated
@@ -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 |
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
project.mml
Outdated
@@ -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 comment
The 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 comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
Thanks! |
This reflects changes to the SQL query of layer landuser-overlay introduced by commit 52085d3 (pull request gravitystorm#3469).
This reflects changes to the SQL query of layer landuser-overlay introduced by commit 52085d3 (pull request gravitystorm#3469).
This reflects changes to the SQL query of layer landuser-overlay introduced by commit 52085d3 (pull request gravitystorm#3469).
way_area/NULLIF(!pixel_width!::real*!pixel_height!::real,0) AS way_pixels | ||
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 comment
The 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 landuse = 'military' OR (military = 'danger_area' AND building IS NULL)
. The intended meaning is of course (landuse = 'military' OR military = 'danger_area') AND building IS NULL
so we are missing a pair of brackets here.
Fixes #3454
Changes proposed in this pull request:
Render
military=danger_area
above other landuses by moving it into thelanduse-overlay
layerTest rendering with links to the example places:
https://www.openstreetmap.org/way/307904554
Before
After