Skip to content

Commit

Permalink
Render offices as dots + names (#3163)
Browse files Browse the repository at this point in the history
* Render offices as dots + names

Rebased to a new master branch

* Unify rendering of all office points

- Use a toned down steelblue colour instead of darkblue
- Removed shop-like offices.
  Two classes of offices left: larger and regular.
  Differ only with filtering options.
- No longer rendering office=yes

* Render all offices

- dots at z17+
- labels of large offices at z17+
- labels of documented office types at z18+
- labels of all other offices at z19+
  • Loading branch information
andrzej-r authored and kocio-pl committed Apr 19, 2018
1 parent 5960e3a commit b7ff38e
Show file tree
Hide file tree
Showing 2 changed files with 111 additions and 1 deletion.
99 changes: 98 additions & 1 deletion amenity-points.mss
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
@memorials: @amenity-brown;
@culture: @amenity-brown;
@public-service: @amenity-brown;
@office: #4863A0;
@man-made-icon: #555;
@advertising-grey: @man-made-icon;
@landform-color: #d08f55;
Expand Down Expand Up @@ -1024,6 +1025,18 @@
marker-clip: false;
}

// office points
[office != null][zoom >= 17] {
marker-width: 4;
[zoom >= 18] {
marker-width: 6;
}
marker-line-width: 0;
marker-placement: interior;
marker-clip: false;
marker-fill: @office;
}

[feature = 'leisure_water_park'][zoom >= 17] {
marker-file: url('symbols/water_park.svg');
marker-placement: interior;
Expand Down Expand Up @@ -2296,7 +2309,7 @@
[feature = 'shop_variety_store'],
[feature = 'shop_video_games'],
[feature = 'shop_wine'],
[feature = 'shop_other']{
[feature = 'shop_other'] {
[way_pixels > 3000][zoom >= 17],
[zoom >= 18] {
text-name: "[name]";
Expand All @@ -2315,6 +2328,90 @@
}
}

// potentially larger offices
[zoom >= 17] {
[feature = 'office_administrative'],
[feature = 'office_adoption_agency'],
[feature = 'office_educational_institution'],
[feature = 'office_employment_agency'],
[feature = 'office_energy_supplier'],
[feature = 'office_financial'],
[feature = 'office_government'],
[feature = 'office_newspaper'],
[feature = 'office_ngo'],
[feature = 'office_political_party'],
[feature = 'office_quango'],
[feature = 'office_religion'],
[feature = 'office_research'],
[feature = 'office_tax'],
[feature = 'office_telecommunication'],
[feature = 'office_water_utility'],
{
text-name: "[name]";
text-size: @standard-font-size;
text-wrap-width: @standard-wrap-width;
text-line-spacing: @standard-line-spacing-size;
text-dy: 8;
text-fill: @office;
text-face-name: @standard-font;
text-halo-radius: @standard-halo-radius;
text-halo-fill: rgba(255, 255, 255, 0.6);
text-placement: interior;
}
}

// other documented office types
[zoom >= 18] {
[feature = 'office_accountant'],
[feature = 'office_advertising_agency'],
[feature = 'office_architect'],
[feature = 'office_association'],
[feature = 'office_charity'],
[feature = 'office_company'],
[feature = 'office_estate_agent'],
[feature = 'office_forestry'],
[feature = 'office_foundation'],
[feature = 'office_guide'],
[feature = 'office_insurance'],
[feature = 'office_it'],
[feature = 'office_lawyer'],
[feature = 'office_logistics'],
[feature = 'office_moving_company'],
[feature = 'office_notary'],
[feature = 'office_physician'],
[feature = 'office_private_investigator'],
[feature = 'office_property_management'],
[feature = 'office_surveyor'],
[feature = 'office_tax_advisor'],
[feature = 'office_therapist'],
[feature = 'office_travel_agent'] {
text-name: "[name]";
text-size: @standard-font-size;
text-wrap-width: @standard-wrap-width;
text-line-spacing: @standard-line-spacing-size;
text-dy: 8;
text-fill: @office;
text-face-name: @standard-font;
text-halo-radius: @standard-halo-radius;
text-halo-fill: rgba(255, 255, 255, 0.6);
text-placement: interior;
}
}

// all other offices
[office != null][zoom >= 19] {
text-name: "[name]";
text-size: @standard-font-size;
text-wrap-width: @standard-wrap-width;
text-line-spacing: @standard-line-spacing-size;
text-dy: 8;
text-fill: @office;
text-face-name: @standard-font;
text-halo-radius: @standard-halo-radius;
text-halo-fill: rgba(255, 255, 255, 0.6);
text-placement: interior;
}

[feature = 'shop_supermarket'],
[feature = 'shop_department_store'] {
[zoom >= 16] {
Expand Down
13 changes: 13 additions & 0 deletions project.mml
Original file line number Diff line number Diff line change
Expand Up @@ -1449,6 +1449,7 @@ Layer:
'charging_station', 'arts_centre', 'ferry_terminal', 'marketplace', 'waste_disposal', 'shower', 'bbq') THEN amenity 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 tags->'office' END,
'leisure_' || CASE WHEN leisure IN ('water_park', 'playground', 'miniature_golf', 'golf_course', 'picnic_table',
'fitness_centre', 'fitness_station', 'firepit', 'sauna', 'beach_resort') THEN leisure ELSE NULL END,
'man_made_' || CASE WHEN man_made IN ('mast', 'tower', 'water_tower', 'lighthouse', 'windmill', 'obelisk') THEN man_made ELSE NULL END,
Expand Down Expand Up @@ -1476,6 +1477,7 @@ Layer:
tags->'power_source' as power_source,
tags->'icao' as icao,
tags->'iata' as iata,
tags->'office' as office,
tags->'recycling_type' as recycling_type,
tags->'tower:construction' as "tower:construction",
tags->'tower:type' as "tower:type",
Expand All @@ -1499,6 +1501,7 @@ Layer:
OR amenity IS NOT NULL -- skip checking a huge list and use a null check
OR tags->'advertising' IN ('column')
OR shop IS NOT NULL
OR tags->'office' IS NOT NULL
OR leisure IN ('water_park', 'playground', 'miniature_golf', 'golf_course', 'picnic_table', 'fitness_centre',
'fitness_station', 'firepit', 'sauna', 'beach_resort')
OR man_made IN ('mast', 'tower', 'water_tower', 'lighthouse', 'windmill', 'obelisk')
Expand Down Expand Up @@ -1556,6 +1559,7 @@ Layer:
'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,
'office_' || CASE WHEN tags->'office' IN ('no', 'vacant', 'closed', 'disused', 'empty') OR tags->'office' IS NULL THEN NULL ELSE tags->'office' END,
'leisure_' || CASE WHEN leisure IN ('water_park', 'playground', 'miniature_golf', 'golf_course', 'picnic_table', 'slipway',
'dog_park', 'fitness_centre', 'fitness_station', 'firepit', 'sauna', 'beach_resort') THEN leisure ELSE NULL END,
'man_made_' || CASE WHEN man_made IN ('mast', 'tower', 'water_tower', 'lighthouse', 'windmill', 'obelisk') THEN man_made ELSE NULL END,
Expand Down Expand Up @@ -1601,6 +1605,7 @@ Layer:
tags->'power_source' as power_source,
tags->'icao' as icao,
tags->'iata' as iata,
tags->'office' as office,
tags->'recycling_type' as recycling_type,
tags->'tower:construction' as "tower:construction",
tags->'tower:type' as "tower:type",
Expand All @@ -1624,6 +1629,7 @@ Layer:
OR amenity IS NOT NULL -- skip checking a huge list and use a null check
OR shop IS NOT NULL
OR tags->'advertising' IN ('column')
OR tags->'office' IS NOT NULL
OR leisure IN ('water_park', 'playground', 'miniature_golf', 'golf_course', 'picnic_table', 'slipway',
'dog_park', 'fitness_centre', 'fitness_station', 'firepit', 'sauna', 'beach_resort')
OR barrier IN ('toll_booth')
Expand Down Expand Up @@ -2011,6 +2017,7 @@ Layer:
'perfumery', 'cosmetics', 'variety_store', 'wine', 'outdoor', 'copyshop', 'sports', 'deli', 'tobacco', 'art', 'tea',
'coffee', 'tyres', 'pastry', 'chocolate', 'music', 'medical_supply', 'dairy', 'video_games') THEN shop
WHEN shop IN ('no', 'vacant', 'closed', 'disused', 'empty') OR shop IS NULL THEN NULL ELSE 'other' END,
'office_' || CASE WHEN tags->'office' IN ('no', 'vacant', 'closed', 'disused', 'empty') OR tags->'office' IS NULL THEN NULL ELSE tags->'office' END,
'leisure_' || CASE WHEN leisure IN ('swimming_pool', 'water_park', 'miniature_golf', 'golf_course', 'fitness_centre', 'sports_centre', 'stadium', 'track',
'pitch', 'playground', 'park', 'recreation_ground', 'common', 'garden', 'nature_reserve', 'marina',
'picnic_table', 'dog_park', 'fitness_station', 'firepit', 'sauna', 'beach_resort') THEN leisure ELSE NULL END,
Expand Down Expand Up @@ -2053,6 +2060,7 @@ Layer:
tags->'operator' as operator,
tags->'icao' as icao,
tags->'iata' as iata,
tags->'office' as office,
tags->'recycling_type' as recycling_type,
tags->'castle_type' as castle_type,
ref,
Expand All @@ -2066,6 +2074,7 @@ Layer:
OR amenity IS NOT NULL -- skip checking a huge list and use a null check
OR tags->'advertising' IN ('column')
OR shop IS NOT NULL
OR tags->'office' IS NOT NULL
OR leisure IS NOT NULL
OR landuse IS NOT NULL
OR man_made IN ('lighthouse', 'windmill', 'mast', 'tower', 'water_tower', 'pier', 'breakwater', 'groyne', 'obelisk', 'works')
Expand Down Expand Up @@ -2138,6 +2147,7 @@ Layer:
operator,
icao,
iata,
office,
recycling_type,
castle_type,
ref,
Expand Down Expand Up @@ -2169,6 +2179,7 @@ Layer:
'variety_store', 'wine', 'outdoor', 'copyshop', 'sports', 'deli', 'tobacco', 'art', 'tea', 'coffee', 'tyres',
'pastry', 'chocolate', 'music', 'medical_supply','dairy', 'video_games') THEN shop
WHEN shop IN ('no', 'vacant', 'closed', 'disused', 'empty') OR shop IS NULL THEN NULL ELSE 'other' END,
'office_' || CASE WHEN tags->'office' IN ('no', 'vacant', 'closed', 'disused', 'empty') OR tags->'office' IS NULL THEN NULL ELSE tags->'office' END,
'leisure_' || CASE WHEN leisure IN ('swimming_pool', 'water_park', 'miniature_golf', 'golf_course', 'fitness_centre', 'sports_centre', 'stadium', 'track',
'pitch','playground', 'park', 'recreation_ground', 'common', 'garden', 'nature_reserve', 'marina',
'slipway', 'picnic_table', 'dog_park', 'fitness_station', 'firepit', 'sauna', 'beach_resort') THEN leisure ELSE NULL END,
Expand Down Expand Up @@ -2218,6 +2229,7 @@ Layer:
tags->'operator' as operator,
tags->'icao' as icao,
tags->'iata' as iata,
tags->'office' as office,
tags->'recycling_type' as recycling_type,
tags->'castle_type' as castle_type,
ref,
Expand All @@ -2231,6 +2243,7 @@ Layer:
OR amenity IS NOT NULL -- skip checking a huge list and use a null check
OR tags->'advertising' IN ('column')
OR shop IS NOT NULL
OR tags->'office' IS NOT NULL
OR leisure IS NOT NULL
OR landuse IN ('reservoir', 'basin', 'recreation_ground', 'village_green', 'quarry', 'vineyard', 'orchard', 'cemetery', 'residential',
'garages', 'meadow', 'grass', 'allotments', 'forest', 'farmyard', 'farmland', 'greenhouse_horticulture',
Expand Down

0 comments on commit b7ff38e

Please sign in to comment.