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

Pushing small amenities to higher zoom levels #1884

Closed
wants to merge 1 commit into from
Closed
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
19 changes: 9 additions & 10 deletions amenity-points.mss
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
point-placement: interior;
}

[feature = 'amenity_atm'][zoom >= 17] {
[feature = 'amenity_atm'][zoom >= 18] {
marker-file: url('symbols/atm.16.svg');
marker-fill: @amenity-brown;
marker-placement: interior;
Expand Down Expand Up @@ -95,7 +95,7 @@
marker-clip: false;
}

[feature = 'highway_traffic_signals'][zoom >= 17] {
[feature = 'highway_traffic_signals'][zoom >= 19] {
marker-file: url('symbols/traffic_light.svg');
marker-fill: #0a0a0a;
marker-placement: interior;
Expand Down Expand Up @@ -399,7 +399,7 @@
marker-clip: false;
}

[feature = 'amenity_post_box'][zoom >= 17] {
[feature = 'amenity_post_box'][zoom >= 18] {
marker-file: url('symbols/post_box-12.svg');
marker-fill: @amenity-brown;
marker-placement: interior;
Expand Down Expand Up @@ -452,14 +452,14 @@
marker-clip: false;
}

[feature = 'amenity_telephone'][zoom >= 17] {
[feature = 'amenity_telephone'][zoom >= 18] {
marker-file: url('symbols/telephone.16.svg');
marker-fill: @amenity-brown;
marker-placement: interior;
marker-clip: false;
}

[feature = 'amenity_emergency_phone'][zoom >= 17] {
[feature = 'amenity_emergency_phone'][zoom >= 19] {
marker-file: url('symbols/emergency_phone.16.svg');
marker-fill: @amenity-brown;
marker-placement: interior;
Expand All @@ -473,14 +473,14 @@
marker-clip: false;
}

[feature = 'amenity_toilets'][zoom >= 17] {
[feature = 'amenity_toilets'][zoom >= 18] {
marker-file: url('symbols/toilets.16.svg');
marker-fill: @amenity-brown;
marker-placement: interior;
marker-clip: false;
}

[feature = 'amenity_drinking_water'][zoom >= 17] {
[feature = 'amenity_drinking_water'][zoom >= 18] {
marker-file: url('symbols/drinking_water.16.svg');
marker-fill: @amenity-brown;
marker-placement: interior;
Expand Down Expand Up @@ -1208,7 +1208,7 @@
[feature = 'amenity_car_wash'][zoom >= 17],
[feature = 'amenity_community_centre'][zoom >= 17],
[feature = 'amenity_fire_station'][zoom >= 17],
[feature = 'amenity_drinking_water'][zoom >= 17],
[feature = 'amenity_drinking_water'][zoom >= 18],
[feature = 'tourism_picnic_site'][zoom >= 17],
[feature = 'leisure_picnic_table'][zoom >= 17],
[feature = 'amenity_post_office'][zoom >= 17] {
Expand Down Expand Up @@ -1348,7 +1348,6 @@
}
}


[feature = 'leisure_miniature_golf'][zoom >= 17],
[feature = 'leisure_golf_course'][zoom >= 15] {
text-name: "[name]";
Expand Down Expand Up @@ -1757,7 +1756,7 @@
}

[feature = 'amenity_bank'][zoom >= 17],
[feature = 'amenity_atm'][zoom >= 17] {
[feature = 'amenity_atm'][zoom >= 18] {
text-name: "[name]";
[feature = 'amenity_atm'] {
text-name: "[operator]";
Expand Down
4 changes: 2 additions & 2 deletions project.mml
Original file line number Diff line number Diff line change
Expand Up @@ -1997,7 +1997,7 @@
"srs": "+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0.0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs +over",
"Datasource": {
"extent": "-20037508,-20037508,20037508,20037508",
"table": "(SELECT\n way,\n amenity,\n railway,\n highway,\n barrier,\n man_made,\n historic,\n access,\n name,\n CASE WHEN amenity='waste_basket' THEN 2 ELSE 1 END AS prio\n FROM planet_osm_point p\n WHERE barrier IN ('bollard', 'gate', 'lift_gate', 'block')\n OR highway IN ('mini_roundabout')\n OR railway = 'level_crossing'\n OR amenity IN ('parking', 'bicycle_parking', 'motorcycle_parking', 'bench', 'waste_basket')\n OR historic = 'wayside_cross'\n OR man_made = 'cross'\n ORDER BY prio\n ) AS amenity_low_priority",
"table": "(SELECT\n way,\n amenity,\n railway,\n highway,\n barrier,\n man_made,\n historic,\n access,\n name,\n CASE WHEN amenity='waste_basket' THEN 4\n WHEN amenity IN ('bench', 'emergency_phone') THEN 3 \n WHEN amenity IN ('atm', 'telephone', 'post_box') THEN 1 \n ELSE 2 END\n AS prio\n FROM planet_osm_point p\n WHERE barrier IN ('bollard', 'gate', 'lift_gate', 'block')\n OR highway IN ('mini_roundabout')\n OR railway = 'level_crossing'\n OR amenity IN ('atm', 'parking', 'bicycle_parking', 'motorcycle_parking', 'bench', \n 'waste_basket', 'telephone', 'emergency_phone', 'post_box')\n OR historic = 'wayside_cross'\n OR man_made = 'cross'\n ORDER BY prio\n ) AS amenity_low_priority",
"geometry_field": "way",
"type": "postgis",
"key_field": "",
Expand All @@ -2023,7 +2023,7 @@
"srs": "+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0.0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs +over",
"Datasource": {
"extent": "-20037508,-20037508,20037508,20037508",
"table": "(SELECT\n way,\n amenity,\n railway,\n highway,\n barrier,\n man_made,\n historic,\n access,\n name\n FROM planet_osm_polygon\n WHERE barrier IN ('bollard', 'gate', 'lift_gate', 'block')\n OR highway IN ('mini_roundabout')\n OR railway = 'level_crossing'\n OR amenity IN ('parking', 'bicycle_parking', 'motorcycle_parking')\n ) AS amenity_low_priority_poly",
"table": "(SELECT\n way,\n amenity,\n railway,\n highway,\n barrier,\n man_made,\n historic,\n access,\n name\n FROM planet_osm_polygon\n WHERE barrier IN ('bollard', 'gate', 'lift_gate', 'block')\n OR highway IN ('mini_roundabout')\n OR railway = 'level_crossing'\n OR amenity IN ('parking', 'bicycle_parking', 'motorcycle_parking')\n ) AS amenity_low_priority_poly",
"geometry_field": "way",
"type": "postgis",
"key_field": "",
Expand Down
11 changes: 8 additions & 3 deletions project.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2456,12 +2456,17 @@ Layer:
historic,
access,
name,
CASE WHEN amenity='waste_basket' THEN 2 ELSE 1 END AS prio
CASE WHEN amenity='waste_basket' THEN 4
WHEN amenity IN ('bench', 'emergency_phone') THEN 3
WHEN amenity IN ('atm', 'telephone', 'post_box') THEN 1
ELSE 2 END
AS prio
FROM planet_osm_point p
WHERE barrier IN ('bollard', 'gate', 'lift_gate', 'block')
OR highway IN ('mini_roundabout')
OR railway = 'level_crossing'
OR amenity IN ('parking', 'bicycle_parking', 'motorcycle_parking', 'bench', 'waste_basket')
OR amenity IN ('atm', 'parking', 'bicycle_parking', 'motorcycle_parking', 'bench',
'waste_basket', 'telephone', 'emergency_phone', 'post_box')
OR historic = 'wayside_cross'
OR man_made = 'cross'
ORDER BY prio
Expand Down Expand Up @@ -2491,7 +2496,7 @@ Layer:
WHERE barrier IN ('bollard', 'gate', 'lift_gate', 'block')
OR highway IN ('mini_roundabout')
OR railway = 'level_crossing'
OR amenity IN ('parking', 'bicycle_parking', 'motorcycle_parking')
OR amenity IN ('parking', 'bicycle_parking', 'motorcycle_parking')
) AS amenity_low_priority_poly
properties:
minzoom: 14
Expand Down