Skip to content

Commit

Permalink
Render flood_prone=yes + concatenate all conditionals
Browse files Browse the repository at this point in the history
  • Loading branch information
Phyks committed Nov 25, 2020
1 parent f0067b7 commit 525428e
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 19 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
* Distinguish access for toilets and drinking water.
* Add subicon at POI for bicycle services (pump, tool, rental/repair/retail).
* Render islands names. See #456.
* Add flood prone text for `flood_prone=yes` highways. See #374.
* Render all available conditionals, concatenated.


## v0.3.7
Expand Down
16 changes: 1 addition & 15 deletions labels.mss
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,6 @@


#roads-text-conditional[zoom >= 20] {
text-name: ""; /* Useless since it is overloaded after, but it rises a warning. */
text-fill: @conditional-text;
text-size: 9;
text-halo-radius: @standard-halo-radius;
Expand All @@ -387,20 +386,7 @@
text-vertical-alignment: top;
text-dy: -12;
text-repeat-distance: @minor-highway-text-repeat-distance;

[motor_vehicle_conditional != null] {
text-name: "motor=" + [motor_vehicle_conditional];
text-fill: @conditional-cycle-text;
}
[access_conditional != null] {
text-name: "all=" + [access_conditional];
}
[vehicle_conditional != null] {
text-name: "vehicle=" + [vehicle_conditional];
}
[bicycle_conditional != null] {
text-name: "bicycle=" + [bicycle_conditional];
}
text-name: "[conditional]";
}

#paths-text-name {
Expand Down
15 changes: 11 additions & 4 deletions project.mml
Original file line number Diff line number Diff line change
Expand Up @@ -2619,16 +2619,23 @@ Layer:
SELECT
way,
highway,
tags->'motor_vehicle:conditional' AS motor_vehicle_conditional,
tags->'vehicle:conditional' AS vehicle_conditional,
tags->'access:conditional' AS access_conditional,
tags->'bicycle:conditional' AS bicycle_conditional
TRIM(
LEADING ', ' FROM
CONCAT(
tags->'bicycle:conditional',
CASE WHEN tags->'motor_vehicle:conditional' IS NOT NULL THEN CONCAT(', motor=', tags->'motor_vehicle:conditional') ELSE NULL END,
CASE WHEN tags->'vehicle:conditional' IS NOT NULL THEN CONCAT(', vehicle=', tags->'vehicle:conditional') ELSE NULL END,
CASE WHEN tags->'access:conditional' IS NOT NULL THEN CONCAT(', all=', tags->'access:conditional') ELSE NULL END,
CASE WHEN tags->'flood_prone'='yes' THEN ', flood prone' ELSE NULL END
)
) AS conditional
FROM planet_osm_line
WHERE highway IS NOT NULL AND (
tags->'motor_vehicle:conditional' IS NOT NULL
OR tags->'vehicle:conditional' IS NOT NULL
OR tags->'access:conditional' IS NOT NULL
OR tags->'bicycle:conditional' IS NOT NULL
OR tags->'flood_prone'='yes'
)
) AS data
properties:
Expand Down

0 comments on commit 525428e

Please sign in to comment.