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

Change text-poly-low-zoom to use ST_PointOnSurface #3921

Merged
merged 1 commit into from
Jan 28, 2020
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
5 changes: 0 additions & 5 deletions amenity-points.mss
Original file line number Diff line number Diff line change
Expand Up @@ -1597,7 +1597,6 @@
text-face-name: @oblique-fonts;
text-halo-radius: @standard-halo-radius;
text-halo-fill: @standard-halo-fill;
text-placement: interior;
}

[feature = 'place_locality'][zoom >= 16] {
Expand Down Expand Up @@ -2056,7 +2055,6 @@
text-face-name: @landcover-face-name;
text-halo-radius: @standard-halo-radius;
text-halo-fill: @standard-halo-fill;
text-placement: interior;
[feature = 'landuse_military'] {
text-fill: darken(@military, 40%);
}
Expand Down Expand Up @@ -2096,7 +2094,6 @@
text-face-name: @landcover-face-name;
text-halo-radius: @standard-halo-radius;
text-halo-fill: @standard-halo-fill;
text-placement: interior;
}
}

Expand Down Expand Up @@ -2746,7 +2743,6 @@
text-face-name: @landcover-face-name;
text-halo-radius: @standard-halo-radius;
text-halo-fill: @standard-halo-fill;
text-placement: interior;
[feature = 'natural_scree'],
[feature = 'natural_shingle'],
[feature = 'natural_bare_rock'] {
Expand Down Expand Up @@ -2829,7 +2825,6 @@
text-face-name: @landcover-face-name;
text-halo-radius: @standard-halo-radius;
text-halo-fill: @standard-halo-fill;
text-placement: interior;
}
}

Expand Down
5 changes: 3 additions & 2 deletions project.mml
Original file line number Diff line number Diff line change
Expand Up @@ -1975,7 +1975,7 @@ Layer:
<<: *osm2pgsql
table: |-
(SELECT
way,
ST_PointOnSurface(way) AS way,
way_area/NULLIF(POW(!scale_denominator!*0.001*0.28,2),0) AS way_pixels,
COALESCE(
'landuse_' || CASE WHEN landuse IN ('forest', 'military', 'farmland') THEN landuse ELSE NULL END,
Expand All @@ -1992,7 +1992,8 @@ Layer:
name,
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')
WHERE way && !bbox!
AND (landuse IN ('forest', 'military', 'farmland')
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AND has higher precedence than OR In SQL, so we need a pair or brackers around all the OR statements.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In addition to the pair here?

  AND (landuse IN....
...
  OR leisure IN ('nature_reserve'))

Where should the brackets be? It seems to work currently

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The brackets look good to me as-is.

OR military IN ('danger_area')
OR "natural" IN ('wood', 'glacier', 'sand', 'scree', 'shingle', 'bare_rock', 'water', 'bay', 'strait')
OR "place" IN ('island')
Expand Down