Skip to content

Commit

Permalink
Add rendering for healthcare tag scheme (#3498)
Browse files Browse the repository at this point in the history
  • Loading branch information
jragusa authored and kocio-pl committed Nov 24, 2018
1 parent 8ba9c4a commit f4919ff
Show file tree
Hide file tree
Showing 3 changed files with 116 additions and 36 deletions.
106 changes: 89 additions & 17 deletions amenity-points.mss
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
@accommodation-icon: @transportation-icon;
@accommodation-text: @transportation-text;
@airtransport: #8461C4; //also ferry_terminal
@health-color: #da0092;
@health-color: #BF0000;
@amenity-brown: #734a08;
@gastronomy-icon: #C77400;
@gastronomy-text: darken(@gastronomy-icon, 5%);
Expand Down Expand Up @@ -339,13 +339,6 @@
marker-clip: false;
}

[feature = 'amenity_hospital'][zoom >= 15] {
marker-file: url('symbols/amenity/hospital.svg');
marker-fill: @health-color;
marker-placement: interior;
marker-clip: false;
}

[feature = 'amenity_casino'][zoom >= 17] {
marker-file: url('symbols/amenity/casino.svg');
marker-fill: @amenity-brown;
Expand Down Expand Up @@ -615,23 +608,53 @@
}
}

[feature = 'amenity_pharmacy'][zoom >= 17] {
marker-file: url('symbols/amenity/pharmacy.svg');
[feature = 'amenity_clinic'][zoom >= 17],
[feature = 'healthcare_clinic'][zoom >= 17],
[feature = 'amenity_doctors'][zoom >= 17],
[feature = 'healthcare_centre'][zoom >= 17] {
marker-file: url('symbols/amenity/doctors.svg');
marker-fill: @health-color;
marker-placement: interior;
marker-clip: false;
}

[feature = 'amenity_clinic'][zoom >= 16],
[feature = 'amenity_doctors'][zoom >= 17] {
marker-file: url('symbols/amenity/doctors.svg');
[feature = 'healthcare_doctor'][zoom >= 17] {
[zoom >= 17][zoom < 18] {
marker-width: 4;
marker-line-width: 0;
}
[zoom >= 18] {
marker-file: url('symbols/amenity/doctors.svg');
}
marker-fill: @health-color;
marker-placement: interior;
marker-clip: false;
}

[feature = 'amenity_dentist'][zoom >= 17],
[feature = 'healthcare_dentist'][zoom >= 17] {
[zoom >= 17][zoom < 18] {
marker-width: 4;
marker-line-width: 0;
}
[zoom >= 18] {
marker-file: url('symbols/amenity/dentist.svg');
}
marker-fill: @health-color;
marker-placement: interior;
marker-clip: false;
}

[feature = 'amenity_dentist'][zoom >= 17] {
marker-file: url('symbols/amenity/dentist.svg');
[feature = 'amenity_hospital'][zoom >= 15],
[feature = 'healthcare_hospital'][zoom >= 15] {
marker-file: url('symbols/amenity/hospital.svg');
marker-fill: @health-color;
marker-placement: interior;
marker-clip: false;
}

[feature = 'amenity_pharmacy'][zoom >= 17] {
marker-file: url('symbols/amenity/pharmacy.svg');
marker-fill: @health-color;
marker-placement: interior;
marker-clip: false;
Expand All @@ -644,6 +667,34 @@
marker-clip: false;
}

[feature = 'healthcare_alternative'],
[feature = 'healthcare_audiologist'],
[feature = 'healthcare_birthing_center'],
[feature = 'healthcare_blood_bank'],
[feature = 'healthcare_blood_donation'],
[feature = 'healthcare_dialysis'],
[feature = 'healthcare_laboratory'],
[feature = 'healthcare_midwife'],
[feature = 'healthcare_occupational_therapist'],
[feature = 'healthcare_optometrist'],
[feature = 'healthcare_physiotherapist'],
[feature = 'healthcare_podiatrist'],
[feature = 'healthcare_psychotherapist'],
[feature = 'healthcare_rehabilitation'],
[feature = 'healthcare_speech_therapist'],
[feature = 'healthcare_yes'] {
[zoom >= 17] {
marker-width: 4;
[zoom >= 18] {
marker-width: 6;
}
marker-line-width: 0;
marker-placement: interior;
marker-clip: false;
marker-fill: @health-color;
}
}

[feature = 'amenity_place_of_worship'][zoom >= 16] {
marker-file: url('symbols/amenity/place_of_worship.svg');
marker-fill: #000000;
Expand Down Expand Up @@ -2554,7 +2605,8 @@
text-placement: interior;
}

[feature = 'amenity_hospital'][zoom >= 16] {
[feature = 'amenity_hospital'][zoom >= 16],
[feature = 'healthcare_hospital'][zoom >= 16] {
text-name: "[name]";
text-fill: @health-color;
text-size: @standard-font-size;
Expand All @@ -2572,7 +2624,27 @@
[feature = 'amenity_pharmacy'],
[feature = 'amenity_doctors'],
[feature = 'amenity_dentist'],
[feature = 'amenity_veterinary'] {
[feature = 'amenity_veterinary'],
[feature = 'healthcare_alternative'],
[feature = 'healthcare_audiologist'],
[feature = 'healthcare_birthing_center'],
[feature = 'healthcare_blood_bank'],
[feature = 'healthcare_blood_donation'],
[feature = 'healthcare_centre'],
[feature = 'healthcare_clinic'],
[feature = 'healthcare_dentist'],
[feature = 'healthcare_dialysis'],
[feature = 'healthcare_doctor'],
[feature = 'healthcare_laboratory'],
[feature = 'healthcare_midwife'],
[feature = 'healthcare_occupational_therapist'],
[feature = 'healthcare_optometrist'],
[feature = 'healthcare_physiotherapist'],
[feature = 'healthcare_podiatrist'],
[feature = 'healthcare_psychotherapist'],
[feature = 'healthcare_rehabilitation'],
[feature = 'healthcare_speech_therapist'],
[feature = 'healthcare_yes'] {
[zoom >= 17] {
text-name: "[name]";
text-size: @standard-font-size;
Expand Down
22 changes: 22 additions & 0 deletions project.mml
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ Layer:
'hospital', 'kindergarten', 'grave_yard', 'prison', 'place_of_worship', 'clinic', 'ferry_terminal',
'marketplace', 'community_centre', 'social_facility', 'arts_centre', 'parking_space', 'bus_station',
'fire_station', 'police') THEN amenity ELSE NULL END)) AS amenity,
('healthcare_' || (CASE WHEN tags->'healthcare' IN ('clinic' ,'hospital') THEN tags->'healthcare' ELSE NULL END)) AS healthcare,
('landuse_' || (CASE WHEN landuse IN ('quarry', 'vineyard', 'orchard', 'cemetery', 'residential', 'garages', 'meadow', 'grass',
'allotments', 'forest', 'farmyard', 'farmland', 'greenhouse_horticulture',
'recreation_ground', 'village_green', 'retail', 'industrial', 'railway', 'commercial',
Expand All @@ -147,6 +148,7 @@ Layer:
OR amenity IN ('parking', 'bicycle_parking', 'motorcycle_parking', 'taxi', 'university', 'college', 'school', 'hospital', 'kindergarten',
'grave_yard', 'place_of_worship', 'prison', 'clinic', 'ferry_terminal', 'marketplace', 'community_centre', 'social_facility',
'arts_centre', 'parking_space', 'bus_station', 'fire_station', 'police')
OR tags->'healthcare' IN ('clinic', 'hospital')
OR man_made IN ('works', 'wastewater_plant','water_works')
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')
Expand Down Expand Up @@ -1459,6 +1461,9 @@ Layer:
'prison', 'hunting_stand', 'nightclub', 'veterinary', 'social_facility', 'vehicle_inspection',
'charging_station', 'arts_centre', 'ferry_terminal', 'marketplace', 'waste_disposal', 'shower', 'bbq',
'nursing_home', 'childcare', 'driving_school', 'casino', 'boat_rental', 'bicycle_repair_station') THEN amenity ELSE NULL END,
'healthcare_' || CASE WHEN tags->'healthcare' IN ('alternative', 'audiologist', 'birthing_center', 'blood_bank', 'blood_donation', 'centre', 'clinic',
'dentist', 'dialysis', 'doctor', 'hospital', 'laboratory', 'midwife', 'occupational_therapist', 'optometrist',
'physiotherapist', 'podiatrist', 'psychotherapist', 'rehabilitation', 'speech_therapist', 'yes') THEN tags->'healthcare' ELSE NULL END,
'advertising_' || CASE WHEN tags->'advertising' in ('column') THEN tags->'advertising' else NULL END,
'shop' || CASE WHEN shop IN ('no', 'vacant', 'closed', 'disused', 'empty') OR shop IS NULL THEN NULL ELSE '' END,
'office' || CASE WHEN tags->'office' IN ('no', 'vacant', 'closed', 'disused', 'empty') OR (tags->'office') IS NULL THEN NULL ELSE '' END,
Expand Down Expand Up @@ -1507,6 +1512,7 @@ Layer:
tags->'castle_type' as castle_type,
tags->'sport' as sport,
tags->'information' as information,
tags->'healthcare' as healthcare,
tags->'memorial' as memorial,
tags->'artwork_type' as artwork_type,
CASE WHEN shop IN ('supermarket', 'bag', 'bakery', 'beauty', 'bed', 'bookmaker', 'books', 'butcher', 'clothes', 'computer',
Expand All @@ -1527,6 +1533,7 @@ Layer:
OR tourism IN ('artwork', 'alpine_hut', 'camp_site', 'caravan_site', 'chalet', 'wilderness_hut', 'guest_house', 'apartment', 'hostel',
'hotel', 'motel', 'information', 'museum', 'viewpoint', 'picnic_site', 'gallery')
OR amenity IS NOT NULL -- skip checking a huge list and use a null check
OR (tags->'healthcare') IS NOT NULL
OR tags->'advertising' IN ('column')
OR shop IS NOT NULL
OR (tags->'office') IS NOT NULL
Expand Down Expand Up @@ -1592,6 +1599,9 @@ Layer:
'charging_station', 'arts_centre', 'ferry_terminal', 'marketplace', 'shower', 'bbq',
'nursing_home', 'childcare', 'driving_school', 'casino', 'boat_rental', 'bicycle_repair_station') THEN amenity ELSE NULL END,
'amenity_' || CASE WHEN amenity IN ('parking_entrance') AND tags->'parking' IN ('underground') AND (access IS NULL OR access NOT IN ('private', 'no')) THEN amenity ELSE NULL END,
'healthcare_' || CASE WHEN tags->'healthcare' IN ('alternative', 'audiologist', 'birthing_center', 'blood_bank', 'blood_donation', 'centre', 'clinic',
'dentist', 'dialysis', 'doctor', 'hospital', 'laboratory', 'midwife', 'occupational_therapist', 'optometrist',
'physiotherapist', 'podiatrist', 'psychotherapist', 'rehabilitation', 'speech_therapist', 'yes') THEN tags->'healthcare' ELSE NULL END,
'advertising_' || CASE WHEN tags->'advertising' in ('column') THEN tags->'advertising' else NULL END,
'emergency_' || CASE WHEN tags->'emergency' IN ('phone') THEN tags->'emergency' ELSE NULL END,
'shop' || CASE WHEN shop IN ('no', 'vacant', 'closed', 'disused', 'empty') OR shop IS NULL THEN NULL ELSE '' END,
Expand Down Expand Up @@ -1660,6 +1670,7 @@ Layer:
tags->'castle_type' as castle_type,
tags->'sport' as sport,
tags->'information' as information,
tags->'healthcare' as healthcare,
tags->'memorial' as memorial,
tags->'artwork_type' as artwork_type,
CASE WHEN shop IN ('supermarket', 'bag', 'bakery', 'beauty', 'bed', 'bookmaker', 'books', 'butcher', 'clothes', 'computer',
Expand All @@ -1680,6 +1691,7 @@ Layer:
OR tourism IN ('artwork', 'alpine_hut', 'camp_site', 'caravan_site', 'chalet', 'wilderness_hut', 'guest_house', 'apartment', 'hostel',
'hotel', 'motel', 'information', 'museum', 'viewpoint', 'picnic_site', 'gallery')
OR amenity IS NOT NULL -- skip checking a huge list and use a null check
OR (tags->'healthcare') IS NOT NULL
OR shop IS NOT NULL
OR tags->'advertising' IN ('column')
OR (tags->'office') IS NOT NULL
Expand Down Expand Up @@ -2069,6 +2081,9 @@ Layer:
'nightclub', 'veterinary', 'social_facility', 'vehicle_inspection', 'charging_station', 'arts_centre',
'ferry_terminal', 'marketplace', 'shower', 'bbq', 'nursing_home', 'childcare', 'driving_school',
'casino', 'boat_rental', 'bicycle_repair_station') THEN amenity ELSE NULL END,
'healthcare_' || CASE WHEN tags->'healthcare' IN ('alternative', 'audiologist', 'birthing_center', 'blood_bank', 'blood_donation', 'centre', 'clinic',
'dentist', 'dialysis', 'doctor', 'hospital', 'laboratory', 'midwife', 'occupational_therapist', 'optometrist',
'physiotherapist', 'podiatrist', 'psychotherapist', 'rehabilitation', 'speech_therapist', 'yes') THEN tags->'healthcare' ELSE NULL END,
'advertising_' || CASE WHEN tags->'advertising' in ('column') THEN tags->'advertising' else NULL END,
'shop_' || CASE WHEN shop IN ('supermarket', 'bag', 'bakery', 'beauty', 'bed', 'bookmaker', 'books', 'butcher', 'clothes', 'computer', 'confectionery',
'fashion', 'convenience', 'department_store', 'doityourself', 'hardware', 'fishmonger', 'florist', 'garden_centre',
Expand Down Expand Up @@ -2141,6 +2156,7 @@ Layer:
tags->'castle_type' as castle_type,
tags->'sport' as sport,
tags->'information' as information,
tags->'healthcare' as healthcare,
tags->'memorial' as memorial,
tags->'artwork_type' as artwork_type,
ref,
Expand All @@ -2152,6 +2168,7 @@ Layer:
OR tourism IN ('artwork', 'alpine_hut', 'hotel', 'motel', 'hostel', 'chalet', 'wilderness_hut', 'guest_house', 'apartment',
'camp_site', 'caravan_site', 'theme_park', 'museum', 'viewpoint', 'attraction', 'zoo', 'information', 'picnic_site', 'gallery')
OR amenity IS NOT NULL -- skip checking a huge list and use a null check
OR (tags->'healthcare') IS NOT NULL
OR tags->'advertising' IN ('column')
OR shop IS NOT NULL
OR (tags->'office') IS NOT NULL
Expand Down Expand Up @@ -2258,6 +2275,9 @@ Layer:
'charging_station', 'arts_centre', 'ferry_terminal', 'marketplace', 'shower', 'bbq',
'nursing_home', 'childcare', 'driving_school', 'casino', 'boat_rental', 'bicycle_repair_station') THEN amenity ELSE NULL END,
'amenity_' || CASE WHEN amenity IN ('parking_entrance') AND tags->'parking' IN ('underground') AND (access IS NULL OR access NOT IN ('private', 'no')) THEN amenity ELSE NULL END,
'healthcare_' || CASE WHEN tags->'healthcare' IN ('alternative', 'audiologist', 'birthing_center', 'blood_bank', 'blood_donation', 'centre', 'clinic',
'dentist', 'dialysis', 'doctor', 'hospital', 'laboratory', 'midwife', 'occupational_therapist', 'optometrist',
'physiotherapist', 'podiatrist', 'psychotherapist', 'rehabilitation', 'speech_therapist', 'yes') THEN tags->'healthcare' ELSE NULL END,
'advertising_' || CASE WHEN tags->'advertising' in ('column') THEN tags->'advertising' else NULL END,
'shop_' || CASE WHEN shop IN ('supermarket', 'bag','bakery', 'beauty', 'bed', 'bookmaker', 'books', 'butcher', 'clothes', 'computer', 'confectionery', 'fashion',
'convenience', 'department_store', 'doityourself', 'hardware', 'fishmonger', 'florist', 'garden_centre', 'hairdresser',
Expand Down Expand Up @@ -2331,6 +2351,7 @@ Layer:
tags->'castle_type' as castle_type,
tags->'sport' as sport,
tags->'information' as information,
tags->'healthcare' as healthcare,
tags->'memorial' as memorial,
tags->'artwork_type' as artwork_type,
ref,
Expand All @@ -2342,6 +2363,7 @@ Layer:
OR tourism IN ('artwork', 'alpine_hut', 'hotel', 'motel', 'hostel', 'chalet', 'wilderness_hut', 'guest_house', 'apartment', 'camp_site', 'caravan_site', 'theme_park',
'museum', 'viewpoint', 'attraction', 'zoo', 'information', 'picnic_site', 'gallery')
OR amenity IS NOT NULL -- skip checking a huge list and use a null check
OR (tags->'healthcare') IS NOT NULL
OR tags->'advertising' IN ('column')
OR shop IS NOT NULL
OR (tags->'office') IS NOT NULL
Expand Down
24 changes: 5 additions & 19 deletions symbols/amenity/hospital.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit f4919ff

Please sign in to comment.